Skip to content

feat: merge project name and switcher chevron into one button - #296

Draft
Guilhem-lm wants to merge 1 commit into
mainfrom
glm/project-picker
Draft

feat: merge project name and switcher chevron into one button#296
Guilhem-lm wants to merge 1 commit into
mainfrom
glm/project-picker

Conversation

@Guilhem-lm

Copy link
Copy Markdown
Contributor

Summary

The sidebar header previously showed the project name as a static heading with a separate tiny chevron button to open the project switcher. This merges them into a single button: clicking the project name (or the chevron) opens the switcher menu, giving a larger hit target and a cleaner header.

Changes

  • frontend/src/lib/ProjectSwitcher.svelte: trigger now takes a label prop and renders the project name + chevron inside one button, wrapped in the <h1> for heading semantics; label truncates and the chevron stays visible.
  • frontend/src/App.svelte: removed the standalone <h1> and passes config.name ?? "Dashboard" as the switcher label.

Test plan

  • bun run check in frontend — 0 errors, 0 warnings
  • Click the project name in the sidebar header — switcher menu opens, positioned under the button
  • Long project names truncate without pushing the chevron out of view

Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
webmux 26bad64 Commit Preview URL

Branch Preview URL
Jul 20 2026, 03:50 PM

@claude

claude Bot commented Jul 20, 2026

Copy link
Copy Markdown

Claude finished @Guilhem-lm's task in 1m 12s —— View job


Code Review — PR #296

  • Read PR diff against origin/main
  • Review ProjectSwitcher.svelte changes
  • Review App.svelte changes
  • Check accessibility & Svelte conventions

Nice, focused change. The merge of the project name and chevron into a single trigger is well executed and the code is clean. Verdict: approve with a couple of minor observations (nothing blocking).

What's good

  • Semantics are valid. A <button> inside an <h1> is allowed — <button> is phrasing content, so heading semantics are preserved while the whole label becomes the click target. Nice larger hit area.
  • No duplicate heading. App.svelte correctly drops its standalone <h1>, so there's still exactly one <h1> in the header.
  • Truncation chain is correct. min-w-0 is threaded all the way down (div.min-w-0h1.min-w-0button.max-w-full min-w-0span.truncate), and the chevron has shrink-0, so long names truncate without pushing the chevron out of view. ✅ matches your test plan.
  • Accessibility preserved. aria-haspopup, aria-expanded, and the accessible name (from the label text) are all intact; title still provides the tooltip.
  • Prop typing is correct — label: string required, and the single call site in App.svelte:1153 supplies it.

Minor observations (non-blocking)

  1. Menu width now scales with the trigger width. In positionMenu() (ProjectSwitcher.svelte:34):

    const width = Math.max(rect.width + 120, 280);

    When the trigger was a fixed ~24px chevron, this always resolved to the 280 floor. Now that the trigger spans the (potentially wide) project name, rect.width + 120 can make the dropdown noticeably wider than before for long project names. It's still clamped to the viewport by the left calc, so not a bug — but if you want the menu width to stay stable regardless of project-name length, consider basing it on a fixed value rather than the trigger width. Fix this →

  2. title="Switch project" is now slightly redundant since the label text is the visible name — but it still usefully communicates the button's action, so keeping it is reasonable.

Parity note

Per AGENTS.md, user-facing features should work on both frontend and CLI. This change is purely a presentational refactor of an existing frontend-only control (the project switcher), so no CLI parity work is needed here.

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