Skip to content

refactor(workspace): unify project open ordering in backend and drop display-order heuristics - #3955

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/simplify-workspace-order
Nov 16, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/simplify-workspace-order

Conversation

@bobleer

@bobleer bobleer commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make backend WorkspaceManager the single authority for opened workspace ordering:
    • Newly opened and explicitly re-opened project workspaces (promote_if_opened: true) are placed at the first project slot while preserving assistant slots.
    • Ordinary workspace activation (set_active_workspace / open_workspace_by_id), legacy path-only upgrade opens, and background SSH restore (promoteIfOpened: false) keep existing opened_workspace_ids positions unchanged.
  • Wire promoteIfOpened through Desktop open_remote_workspace, CLI Peer open_workspace / open_remote_workspace, Server open_workspace, and GlobalAPI.openRemoteWorkspace (defaulting legacy payloads without promoteIfOpened to true).
  • Remove the frontend's cross-version activation-drift heuristic state machine (stableWorkspaceOrder, isActivationReorder, hostOrders, lastSeenHostOrders, noteWorkspaceActivated, noteWorkspaceOrderPersisted) and the redundant post-open reorderOpenedWorkspaces RPC pipeline (persistPromotedWorkspaceOrder, catalogMutationDepth, openedBefore).
  • Preserve per-surface latest-order synchronization (setWorkspaceDisplayOrder / orderWorkspacesForDisplay) for jump-free live/background device hand-overs, manual drag-and-drop reorder, pre-commit FLIP promotion snapshots, and sidebar scroll reveal.

Verification & Remote Scenario Coverage

  • cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,remote-workspace --lib service::workspace::
  • cargo test --locked -p openbitfun-cli --bin openbitfun peer_host::
  • cargo test --locked -p openbitfun-desktop --lib assistant_workspace_delete_tests (includes legacy deserialization coverage for OpenRemoteWorkspaceRequest)
  • cargo check --locked -p openbitfun-core --no-default-features && cargo check --locked -p openbitfun-server
  • Vitest (206 tests across workspaceDisplayOrder, workspaceManager, deviceWorkspaceCatalog, WorkspaceListSection, DeviceCatalogSection, DeviceWorkspaceSections, MainNav.projectCreation, SSHRemoteProvider)
  • pnpm run check:web, pnpm run check:core-boundaries, pnpm run check:repo-hygiene
  • Remote scenarios exercised via unit/DOM/host-adapter fixtures (not live SSH/Relay connections): SSH Remote Workspace (promote_if_opened on explicit open vs background restore), Peer Device Mode (Desktop & CLI Peer host-invoke + controller surface isolation and cached hand-over), and Remote Control / legacy upgrade (finish_legacy_workspace_open order preservation).

@bobleer
bobleer merged commit f86f80a into openBitFun:main Nov 16, 2026
13 checks passed
@bobleer
bobleer deleted the bob/simplify-workspace-order branch November 16, 2026 17:53
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.

1 participant