Skip to content

Sync collapsed sidebar rows and sections through the server - #3305

Merged
SawyerHood merged 1 commit into
bb/ui-preferences-client-syncfrom
bb/ui-preferences-collapsed-sets
Sep 9, 2026
Merged

Sync collapsed sidebar rows and sections through the server#3305
SawyerHood merged 1 commit into
bb/ui-preferences-client-syncfrom
bb/ui-preferences-collapsed-sets

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

After #3304 the structural sidebar settings sync, but the six collapsed-id lists (projects, threads, environments, built-in sections, thread sections, machines) still live only in localStorage.

What changed

Layer 3 of 3 (stack #3306). Base: #3304.

  • sidebarCollapsedAtoms.ts: the six collapsed atoms become in-memory synced preferences; their atomWithStorage wrappers and the folder-era storage adapter are deleted. Every existing toggle site already uses functional updates, so conflicting writes from two devices re-apply on top of the server list instead of clobbering it, and toggles made while a request is in flight compose into the next one. RootComposeMobileRecents.test.tsx seeds the atom through a jotai store instead of localStorage.
  • Ids of deleted entities are not pruned server-side. The client already drops a deleted project's id on the delete broadcast, a stale id renders nothing, and the registry caps each list at 10,000 entries.

Review

One GPT-6 Astra review round requested changes. All three findings were in the layer 2 sync controller (writes rebased onto the submitted revision, composed functional updates through a conflict, and reconciling the authoritative response after pending writes settle). They are fixed and tested in #3304. A later simplification pass removed this layer's server-side pruning and write debounce as not worth their code.

How you verified

  • Sidebar, cache-owner, and mobile-recents suites plus the full @bb/app, @bb/db, and @bb/server public-route suites green; pnpm exec turbo run typecheck --filter='...[origin/main]' green.
  • Live in the dev app: clicking a project chevron in one window stores the id on the server and a fresh window opens with the row collapsed; a CLI write containing an unknown id is stored as sent.

AGENT GENERATED

🤖 Generated with Claude Code

@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from 6357c14 to d6c85c3 Compare September 8, 2026 23:32
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from d6c85c3 to aeb4604 Compare September 8, 2026 23:40
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch 2 times, most recently from a42fee7 to f2bcf0f Compare September 8, 2026 23:48
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from f2bcf0f to 133805c Compare September 9, 2026 17:03
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from 133805c to 7304258 Compare September 9, 2026 17:12
@SawyerHood
SawyerHood marked this pull request as ready for review September 9, 2026 17:24
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from 7304258 to 2c37a95 Compare September 9, 2026 17:40
Convert the six collapsed-id atoms to synced preferences with a short
write debounce so rapid toggles coalesce into one request, and prune ids
of deleted projects, threads, environments, and thread sections on the
server when a collapsed list is stored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SawyerHood
SawyerHood force-pushed the bb/ui-preferences-collapsed-sets branch from 2c37a95 to 13cd5b3 Compare September 9, 2026 18:31
@SawyerHood
SawyerHood merged commit eccf01e into main Sep 9, 2026
21 of 30 checks passed
@SawyerHood
SawyerHood deleted the bb/ui-preferences-collapsed-sets branch September 9, 2026 18:46
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