Skip to content

feat(desktop): add setting to wrap sidebar workspace names instead of truncating - #6263

Open
aiwebb wants to merge 4 commits into
ParadevAI:mainfrom
aiwebb:workspace-name-wrap-optio
Open

aiwebb wants to merge 4 commits into
ParadevAI:mainfrom
aiwebb:workspace-name-wrap-optio

Conversation

@aiwebb

@aiwebb aiwebb commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Long workspace names in the dashboard sidebar are always truncated with an ellipsis, and there's no way to see them in full short of hovering for the hover card. This adds an opt-in Appearance → Wrap workspace names setting that wraps them onto multiple lines instead. Off by default, so nothing changes unless you turn it on.

Off (default, unchanged) On
truncated wrapped

setting

Implementation notes:

  • Preference lives in a persisted zustand singleton (sidebar-preferences, registered in the persisted-key allowlist) rather than local-db, matching markdown-preferences — it's a renderer-only appearance toggle, so this avoids a schema migration. Fixed-size singleton, so it's bounded by construction; the lifecycle (bound / deletion path / DEAD_KEYS on feature removal) is documented at the persist config per apps/desktop/AGENTS.md.
  • Registered in the settings-search index (appearance-sidebar-workspace-names, v2) so it's findable by searching "wrap", "truncate", "long names", etc.
  • truncate → min-w-0 break-words on the name, and the row switches to items-start so the icon and row actions align with the first line instead of the vertical middle of a multi-line name. break-words also breaks unbroken strings, so a long branch-style name can't overflow the sidebar.
  • Wrapping is only pleasant if the row geometry holds still, so the wrap branch also stabilises the trailing meta column, which is an auto track sized by its widest child: diff stats only render for the active row and the actions only on hover, so that track — and therefore the wrapped name's width — used to change as they came and went, rewrapping the text mid-interaction. Under wrapping, both children stay in layout and swap visibility, and the track gets a minmax(3.5rem, auto) floor that fits either one. Cost is ~14px of name width; an unusually large diff count can still widen the track, but no longer differently per hover/active state.
  • The non-wrapping path emits the original class strings verbatim, so the default rendering is byte-identical to today.

While wiring the setting up it turned out the v2 marking wasn't doing anything, which pulled in two related fixes:

  • appearance/page.tsx now applies v1/v2 variant filtering. It was the only settings page that didn't: it passed search matches through directly (and null on an empty query), so every section rendered in both UIs regardless of variant. It now uses getVisibleItemsForSection({ section, searchQuery, isV2 }) like behavior, experimental, terminal, links, and git. Without this, a v1 user could toggle this setting and see nothing happen.
  • Corrected the Typography variants to shared. They were marked v2, but getFontSettings drives screens/main/…/Terminal.tsx, …/CodeEditor.tsx, and …/LightDiffViewer.tsx — all v1 surfaces — as well as the v2 panes. Filtering the page while leaving them v2 would have hidden font controls that still affect the v1 UI. Their descriptions no longer claim to be V2-only either.

How I tested it

Drove the dev desktop app over CDP using real clicks and keystrokes — dev sign-in, add project, New Workspace with a long name, Settings → Appearance → toggle, back to the dashboard. Target identity was confirmed against Superset (workspace-name-wrap-optio).app on this workspace's DESKTOP_VITE_PORT before testing, since other worktrees' apps were live. Screenshots above are from that session.

Measured geometry rather than eyeballing it:

  • Off: white-space: nowrap, text-overflow: ellipsis, 324px of text in a 206px box → clipped, 1 line, row 32px.

  • On: white-space: normal, text-overflow: clip, scrollWidth == clientWidth → not clipped, 2 lines, row 45px. Applies live with no reload, persists across the settings round-trip, and returns to truncation when switched back off.

  • Unbroken name: renamed a row in place to refactor/DashboardSidebarExpandedWorkspaceRowTruncationHandling → wraps to 3 lines, nothing overflows the sidebar edge.

  • Stability sweep on one row, wrap on — active/idle, active/hover, inactive/idle, inactive/hover: name width 203px, 3 lines, row height 61px, meta column 56px in all four. Only visibility changes. Both reflow bugs this guards against were caught in review before landing, so they're regression-prone.

  • Appearance page in v2 after the variant-filtering change — Theme, Custom themes, Markdown style, Wrap workspace names, Typography and Live surfaces all still render:

    appearance page

  • 4 new tests in settings-search.test.ts lock the variant behaviour in: the wrap item is v2-only (including in v1 search results), while theme / markdown / custom themes / typography stay visible in both variants.

Gates: bun run lint (exit 0), bun run typecheck (37/37), bun run test (15/15 tasks, 0 fail; desktop package alone 2555 pass).

Not verified: the v1 render itself. The variant filtering is covered by the tests above, but I didn't flip a running app into the legacy v1 UI to look at it.

Authorship

Written by Claude (Claude Code, Opus 5) running in a Superset workspace, prompted and reviewed by @aiwebb. Claude wrote the code, ran the gates, drove the CDP verification, and captured the screenshots. @aiwebb specified the feature, caught two layout regressions during manual review that the first pass missed (the name rewrapping on hover, then again between active and inactive rows), and confirmed the final behaviour. The commits carry a Co-Authored-By: Claude trailer.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Summary by CodeRabbit

  • New Features

    • Added an appearance setting to wrap workspace names in the sidebar.
    • Workspace names can now wrap onto multiple lines instead of being truncated.
    • Sidebar layout preserves alignment and space for actions and change statistics when names wrap.
    • Added search support for the new appearance setting.
  • Bug Fixes

    • Improved sidebar hover behavior and handling of long workspace names.
    • Updated typography setting descriptions for clarity.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ff4ec5a-0822-4b7c-92f4-fcbf7b12425d

📥 Commits

Reviewing files that changed from the base of the PR and between d89d1d7 and b452868.

📒 Files selected for processing (13)
  • apps/desktop/src/renderer/lib/persisted-keys/persisted-key-registry.test-data.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceDiffStats/DashboardSidebarWorkspaceDiffStats.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/AppearanceSettings.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/FontSettingSection/FontSettingSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/SidebarWorkspaceNamesSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/page.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
  • apps/desktop/src/renderer/stores/index.ts
  • apps/desktop/src/renderer/stores/sidebar-preferences/index.ts
  • apps/desktop/src/renderer/stores/sidebar-preferences/store.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • apps/desktop/src/renderer/stores/sidebar-preferences/store.ts
  • apps/desktop/src/renderer/lib/persisted-keys/persisted-key-registry.test-data.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/FontSettingSection/FontSettingSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/index.ts
  • apps/desktop/src/renderer/stores/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/SidebarWorkspaceNamesSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/page.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceDiffStats/DashboardSidebarWorkspaceDiffStats.tsx
  • apps/desktop/src/renderer/stores/sidebar-preferences/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/AppearanceSettings.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Adds a persisted workspace-name wrapping preference. Appearance settings expose the preference. Dashboard sidebar rows wrap long workspace names and preserve layout for statistics and actions.

Changes

Workspace Name Wrapping

Layer / File(s) Summary
Persisted sidebar preference
apps/desktop/src/renderer/stores/sidebar-preferences/..., apps/desktop/src/renderer/stores/index.ts, apps/desktop/src/renderer/lib/persisted-keys/persisted-key-registry.test-data.ts
Adds the persisted wrapWorkspaceNames Zustand state, selector hooks, public exports, devtools registration, and persisted-key registry entry.
Appearance settings integration
apps/desktop/src/renderer/routes/_authenticated/settings/appearance/..., apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts, apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.test.ts
Registers searchable setting metadata, applies V2 visibility rules, updates typography descriptions, and renders a switch for workspace-name wrapping when the setting is visible.
Wrapped workspace-row layout
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/...
Applies conditional wrapping, alignment, word breaking, action-column reservation, and diff-stat visibility behavior to workspace rows.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to b4528

This adds an opt-in workspace-name wrapping preference while preserving the existing default behavior and updates appearance-setting visibility for variants. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant SidebarWorkspaceNamesSection
  participant SidebarPreferencesStore
  participant DashboardSidebarExpandedWorkspaceRow
  participant DashboardSidebarWorkspaceDiffStats

  SidebarWorkspaceNamesSection->>SidebarPreferencesStore: Update wrapWorkspaceNames
  SidebarPreferencesStore-->>DashboardSidebarExpandedWorkspaceRow: Provide wrapping preference
  DashboardSidebarExpandedWorkspaceRow->>DashboardSidebarWorkspaceDiffStats: Pass keepLayoutOnHover
  DashboardSidebarExpandedWorkspaceRow-->>DashboardSidebarWorkspaceDiffStats: Render wrapped row layout
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format and clearly states the primary desktop feature: wrapping sidebar workspace names instead of truncating them.
Description check ✅ Passed The description explains the change, motivation, implementation, testing, screenshots, checklist status, and the unverified v1 render.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/renderer/stores/sidebar-preferences/store.ts`:
- Around line 20-22: Document the sidebar-preferences persist configuration with
its fixed-size bound, deletion owner or path, and behavior when the feature is
removed. When removing the writer, also add the storage key to DEAD_KEYS in the
same change, using the existing lifecycle-documentation conventions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 637861a3-5dda-4149-b191-3320f718e0ff

📥 Commits

Reviewing files that changed from the base of the PR and between 93168b7 and f2c06d8.

📒 Files selected for processing (10)
  • apps/desktop/src/renderer/lib/persisted-keys/persisted-key-registry.test-data.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceDiffStats/DashboardSidebarWorkspaceDiffStats.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/AppearanceSettings.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/SidebarWorkspaceNamesSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/SidebarWorkspaceNamesSection/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
  • apps/desktop/src/renderer/stores/index.ts
  • apps/desktop/src/renderer/stores/sidebar-preferences/index.ts
  • apps/desktop/src/renderer/stores/sidebar-preferences/store.ts

Long workspace names in the dashboard sidebar were always ellipsized with
no way to see them in full without hovering. Adds an opt-in Appearance
setting (off by default) that wraps them across lines instead.

Wrapping only pays off if the row geometry stays put, so the wrap branch
also keeps the trailing meta column stable: diff stats and the hover
actions stay in layout and swap `visibility`, and the column gets a
minimum track width so it no longer resizes as those come and go. The
truncating default path is unchanged.

Co-Authored-By: Claude <[email protected]>
@aiwebb
aiwebb force-pushed the workspace-name-wrap-optio branch from f2c06d8 to 84aceff Compare August 7, 2026 20:27
Answers the three questions apps/desktop/AGENTS.md requires for any
renderer localStorage writer — bound, deletion path, and behavior when
the feature is removed — at the persist config itself.

Co-Authored-By: Claude <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Alex Webb and others added 2 commits August 7, 2026 17:16
…s page

The Appearance page was the only settings page that never consulted the
v1/v2 variant registry: it passed search matches straight through (and
`null` when the search box was empty), so every section rendered in both
UIs. The new wrap setting is registered `v2` but the v2 dashboard sidebar
is the only place it does anything, so a v1 user could toggle it and see
nothing happen. Switch the page to `getVisibleItemsForSection` like every
sibling page.

Typography was mismarked while we were here. `getFontSettings` drives the
v1 terminal, code editor, and light diff viewer under `screens/main` as
well as the v2 panes, so the two typography items are `shared`, not `v2`
— filtering the page without this would have hidden controls that still
apply in v1. Their descriptions no longer claim to be V2-only either.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@AviPeltz

Copy link
Copy Markdown
Collaborator

any chance you would want to add this behavior instead of the wrapping behavior?

Screen.Recording.2026-08-20.at.12.34.16.PM.mov

@aiwebb

aiwebb commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

any chance you would want to add this behavior instead of the wrapping behavior?

Screen.Recording.2026-08-20.at.12.34.16.PM.mov

@AviPeltz Interesting - but in my case, my motivation for wrapping was so I can more easily tell at a glance what's what - I want to be able to look at a dozen open workspaces and see all the workspace titles. A solution that requires me to hover over each one in turn, and wait for the ticker to scroll in order to read the full title, wouldn't address the motivating problem for me any better than the existing hover card does.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 53 days and will close in 7 days unless there is new activity. If this contribution is still important or relevant, please leave a comment to keep it open. If it closes, you are welcome to reopen it or ask a maintainer to reopen it. Thank you for contributing!

@github-actions github-actions Bot added the stale label Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants