Persist spec list directory expansion state across reloads - #34733
Open
pj-18 wants to merge 3 commits into
Open
Conversation
pj-18
requested a deployment
to
fork-pr-review
September 2, 2026 09:07 — with
GitHub Actions
Waiting
pj-18
requested a deployment
to
fork-pr-review
September 2, 2026 09:07 — with
GitHub Actions
Waiting
pj-18
requested a deployment
to
fork-pr-review
September 2, 2026 09:07 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional details
The spec list's directory expansion/collapse state was only ever kept in an in-memory
ref/Map, so it reset every time the app reloaded — including the runner's own "Run all specs" flow, which relaunches in a new tab and clears alllocalStoragefor the app's origin before that tab mounts, solocalStoragewasn't a viable place to persist this either.This change persists the expansion state to the project's saved state on disk (the same disk-backed mechanism already used for the spec search filter), scoped per project, and restores it on load.
Implementation notes:
useCollapsibleTree's cache is now read throughtoRaw()when a node is first built. The tree is built inside acomputed, so previously every expansion write invalidated that computed and rebuilt the whole tree, which reset scroll position and keyboard focus on every single toggle. Writes still go through the reactive object so persistence still observes them, but the read no longer subscribes to it.setPreferencesGraphQL mutation previously deep-merged every saved preference, which meant a client could never actually remove an entry — only add or overwrite one.specsListTreeExpansionis now written as a full replacement snapshot instead of a merge patch, guarded so it only applies at the top level (a nested key that happens to share the name is unaffected).Steps to test
src/components,src/utils) incypress open.How has the user experience changed?
Directory collapse/expand state in the spec list now survives page reloads and the "Run all specs" new-tab relaunch, instead of always resetting to fully expanded.
PR Tasks
cypress-documentation?type definitions?