Skip to content

fix(projects): sync sidebar source-folder order with project settings - #751

Merged
im-ian merged 1 commit into
mainfrom
fix/project-source-folder-order
Aug 5, 2026
Merged

fix(projects): sync sidebar source-folder order with project settings#751
im-ian merged 1 commit into
mainfrom
fix/project-source-folder-order

Conversation

@im-ian

@im-ian im-ian commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

Keep a multi-root project source-folder order consistent between the sidebar and Project Settings.

  1. Persist sidebar source order — extract repository-root rows from the mixed sidebar DnD order and optimistically update Project.source_paths.
  2. Add a guarded backend reorder command — reorder only roots already attached to the project, ignore unknown paths, and preserve omitted roots without changing project membership.
  3. Cover the full flow — add store success/rollback tests, a Rust membership guard test, and a Playwright DnD-to-Project-Settings regression test.

Expected impact

Area Before After
Sidebar source-folder DnD Changed only the sidebar-local mixed item order Also persists the attached source-root order
Project Settings Could retain the original source-folder order Reflects the order chosen in the sidebar
Persistence failure No backend persistence path existed Optimistic state rolls back and surfaces the error

Design notes

  • Project.repo_path remains the primary-root identity; only existing extra roots in source_paths are reordered.
  • The sidebar filters its mixed session/workspace list down to default repository-root rows before calling the reorder action, so named workspaces and sessions cannot enter the source-root contract.
  • The backend appends any omitted existing roots and ignores unknown or duplicate input paths, preventing reorder requests from changing project membership.

Test plan

  • pnpm run typecheck
  • pnpm exec vitest run src/store.test.ts src/lib/sidebarProjectItems.test.ts — 186 passed
  • cargo test --manifest-path src-tauri/Cargo.toml reordering_project_sources_preserves_membership — 1 passed
  • pnpm exec playwright test tests/e2e/project-settings.spec.ts — 7 passed
  • pnpm run build
  • rustfmt --edition 2021 --check src-tauri/src/commands.rs

Notes

  • A production-profile local preview was built and launched successfully from commit a2494f8.

@im-ian im-ian added the fix Bug fix label Aug 5, 2026
@im-ian
im-ian merged commit 43ef69e into main Aug 5, 2026
3 checks passed
@im-ian
im-ian deleted the fix/project-source-folder-order branch August 5, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant