Skip to content

Persist timeline expand/collapse state in URL#183

Open
rawadhossain wants to merge 1 commit intoNetflix:masterfrom
rawadhossain:timeline-state
Open

Persist timeline expand/collapse state in URL#183
rawadhossain wants to merge 1 commit intoNetflix:masterfrom
rawadhossain:timeline-state

Conversation

@rawadhossain
Copy link
Copy Markdown

The timeline view's expand/collapse state was not reflected in the URL, making it impossible to share a view showing a specific set of tasks. Recipients would always see the default expanded state instead of what the sharer was viewing.

This PR adds an open_steps query parameter that persists the expand/collapse state of timeline steps in the URL.

Closes #42

Behavior

URL state Meaning
No open_steps param All steps expanded (default) — clean URLs
?open_steps=start,end Only these steps are expanded
?open_steps= (empty) All steps collapsed

Changes

  • useTaskListSettings.ts — Added open_steps as a URL query param via use-query-params. Excluded from custom mode localStorage presets.
  • RunPage.tsx — Single useEffect with phase tracking: applies URL state on initial load, syncs state URL on user toggle. Uses replaceIn so expand/collapse actions don't create browser history entries.
  • cypress/integration/run_details.js — Extended existing collapse tests with 3 new assertions for open_steps URL behavior.
  • PluginRegisterSystem.tsx (additional fix) — Fixed a pre-existing crash when the /plugin API returns a response instead of a plain array. This was blocking local development and was fixed while working on this PR.

Screenshots

Steps collapsed - open_steps param in URL
Untitled-2026-01-23-2132 excalidraw

Steps expanded - param removed from URL
expanded

Video Demo

test.mp4

Edge Cases Handled

  • Steps that load late are closed if they're not in the URL's open list
  • Switching to a different run reset everything cleanly
  • All open = no param in URL, all closed = open_steps= (empty), these are treated differently

@Harshil-Malisetty
Copy link
Copy Markdown

nice implementation, I had a similar approach in #184 but I see you used useTaskListSettings which is much cleaner since it follows the existing URL param pattern in the codebase. the Cypress tests is a good call as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the timeline view state part of the URL

2 participants