fix(desktop): sidebar polish — pin ordering, i18n, dead code - #149
Merged
Conversation
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
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.
The four leftovers from #147's sidebar reorganization that #148 deliberately left out. Found by
/reviewon #147.Pinning no longer reorders Recent
updatedAtdoubles as the cloud-sync revision —cloud-sync.ts:124pushes a conversation only when that value changes — sotogglePinnedhas 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 bytogglePinned. The sidebar and the search modal sort on it. Conversations written before the field existed fall back toupdatedAt, 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.newChatandt.galleryin 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
windowCustomEvent bus with props and left all oflib/team-workspace-events.tsuncalled — four functions, two event constants, one unused interface. OnlyTeamWorkspaceNavItemstill had a consumer; it moves next toCloudWorkspace, 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-historywrapper.Verification
npm run typecheck --workspace @blockrun/franklin-desktop— cleannpm run lint --workspace @blockrun/franklin-desktop— cleanvite build— cleannpm test --workspace @blockrun/franklin-desktop— security, cloud, and team-proxy suites passStill open
apps/desktophas no React/hook test harness — onlynode --testfor electron-security and the cloud server — sotogglePinned, 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