test(app): cover manual sidebar order across host filter switches#2409
Open
Abeelha wants to merge 1 commit into
Open
test(app): cover manual sidebar order across host filter switches#2409Abeelha wants to merge 1 commit into
Abeelha wants to merge 1 commit into
Conversation
Regression coverage for the report in issue getpaseo#1871 (manual workspace order resetting after switching the sidebar host filter). Adds: - integration tests driving useSidebarWorkspacesList against the real zustand stores: reorder while filtered to one host, switch filters away and back (including the all-hosts intermediate state), and an explicit pre-hydration persist race where a reconcile write lands before AsyncStorage hydration resolves - a browser e2e that follows the issue steps end to end with a real drag and the host filter menu The reported reset could not be reproduced with these paths on current main or on the reported v0.1.103; the suite pins the invariant so any future regression in the order pipeline turns red.
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.
While trying to reproduce #1871 I could not get the manual workspace order to reset on either current main or v0.1.103 (the version it was reported on). I went through the full pipeline: the sidebar order store, the reconcile effect in
use-sidebar-workspaces-list,mergeWithRemainderon drag end, and the dnd-kit drag path. Every writer is either strictly additive or driven by a genuine drag event, and zustand's persist rehydration always resolves in favor of the persisted order, so none of them can clobber a saved custom order during filter switches.Since this area had no coverage for the multi-host filter scenario, this PR adds it so the invariant stays locked:
packages/app/src/hooks/use-sidebar-workspaces-list.test.tsx: integration tests with two online hosts and real stores. Reorder while filtered to host A, switch to B and back (including the all-hosts intermediate), asserting both the resulting order and the persisted store contents. Also covers the pre-hydration write race explicitly.packages/app/e2e/sidebar-host-filter-order.spec.ts: Playwright spec following the exact repro steps from bug: workspace manual order resets after switching sidebar host filter #1871 with a real mouse drag and host filter menu round trips.All four existing sidebar-order suites still pass (33/33), oxlint and oxfmt are clean on the new files, and the app workspace typechecks.
One adjacent thing I noticed while auditing, separate from #1871: the reconcile effect computes
setProjectOrderfrom the render-timepersistedProjectOrdersnapshot, so two simultaneously mounted instances of the hook could in theory revert each other's project-order write. Workspace orders are not affected (they are read fresh viagetState()). Happy to follow up with a patch if that seems worth hardening.Refs #1871