Skip to content

fix(desktop): sidebar polish — pin ordering, i18n, dead code - #149

Merged
VickyXAI merged 1 commit into
mainfrom
fix/desktop-sidebar-polish
Sep 2, 2026
Merged

fix(desktop): sidebar polish — pin ordering, i18n, dead code#149
VickyXAI merged 1 commit into
mainfrom
fix/desktop-sidebar-polish

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The four leftovers from #147's sidebar reorganization that #148 deliberately left out. Found by /review on #147.

Pinning no longer reorders Recent

updatedAt doubles as the cloud-sync revision — cloud-sync.ts:124 pushes a conversation only when that value changes — so togglePinned has to bump it. The side effect: pin an old chat, unpin it, and it jumps to the top of Recent with no new messages.

Deleting the bump would stop pins syncing, so instead this adds activityAt, set by the three real content mutations (setMessages, renameChat, deleteMedia) and left alone by togglePinned. The sidebar and the search modal sort on it. Conversations written before the field existed fall back to updatedAt, so nothing needs migrating.

Sidebar strings are translated

"Agents", "New project", "Pinned", "Projects", "Recent", "Connecting…", "No projects", the Team Mode tooltips, and the pin/delete row labels were hardcoded English sitting next to t.newChat and t.gallery in the same file. 中文 and Español users got a half-translated sidebar.

13 keys across all three locales. Drops history, which the reorganization orphaned in en/zh/es.

Empty sections no longer render a bare header

Pinned has no empty-state text, so with nothing pinned it drew a "PINNED" label over nothing; it is now hidden when empty. Recent's empty note was gated on sorted.length === 0, so pinning every conversation left "RECENT" blank.

Dead code

#147 replaced the window CustomEvent bus with props and left all of lib/team-workspace-events.ts uncalled — four functions, two event constants, one unused interface. Only TeamWorkspaceNavItem still had a consumer; it moves next to CloudWorkspace, and the file is deleted.

Same commit orphaned CSS that goes with it: .try-space-switch (7 rules, the removed Personal/Team switcher), .try-history-group / .try-history-group-label (the old sticky group header), and the .try-history wrapper.

Verification

  • npm run typecheck --workspace @blockrun/franklin-desktop — clean
  • npm run lint --workspace @blockrun/franklin-desktop — clean
  • vite build — clean
  • npm test --workspace @blockrun/franklin-desktop — security, cloud, and team-proxy suites pass

Still open

apps/desktop has no React/hook test harness — only node --test for electron-security and the cloud server — so togglePinned, the space-routing handlers, and the visibility gating stay untested. Standing up jsdom + vitest is separate scope.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EdbfY8FiReoKH32UKeKfzN

Four leftovers from the #147 sidebar reorganization that #148 did not cover.

Pinning no longer reorders Recent. `updatedAt` doubles as the cloud-sync
revision — cloud-sync.ts only pushes a conversation when that value changes —
so togglePinned has to bump it, which meant pinning and then unpinning a months
old chat threw it to the top of Recent with no new messages. Adds `activityAt`,
set by the three real content mutations (setMessages, renameChat, deleteMedia)
and left alone by togglePinned, and sorts the sidebar and search on it.
Conversations saved before the field fall back to `updatedAt`.

Sidebar strings are translated. "Agents", "New project", "Pinned", "Projects",
"Recent", "Connecting…", "No projects", the Team Mode tooltips, and the row
pin/delete labels were hardcoded English next to t.newChat and t.gallery in the
same file, so 中文 and Español users got a half-translated sidebar. Adds 13 keys
across all three locales and drops `history`, which the reorganization orphaned.

Empty sections no longer render a bare header. Pinned has no empty-state text,
so with nothing pinned it showed a "PINNED" label over nothing; it is now
hidden when empty. Recent's empty note was gated on there being no
conversations at all, so pinning every chat left "RECENT" blank.

Deletes lib/team-workspace-events.ts. #147 replaced the window CustomEvent bus
with props, leaving all four functions and both event constants uncalled; the
one surviving type moves next to CloudWorkspace. Also drops the CSS the same
commit orphaned: .try-space-switch (7 rules), .try-history-group(-label), and
the .try-history wrapper.

Verified: typecheck, eslint, vite build, and the desktop suites all pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdbfY8FiReoKH32UKeKfzN
@VickyXAI
VickyXAI merged commit cb69951 into main Sep 2, 2026
6 checks passed
@VickyXAI
VickyXAI deleted the fix/desktop-sidebar-polish branch September 2, 2026 02:45
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