Skip to content

fix(topbar): project rename in the v4 header (#180) - #185

Merged
EtienneLescot merged 1 commit into
release/v1.8.0from
fix/180-rename-topbar
Jul 28, 2026
Merged

EtienneLescot merged 1 commit into
release/v1.8.0from
fix/180-rename-topbar

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The rename button in the v4 in-renderer topbar had style={{ all: "unset" }} on it, which clobbered the -webkit-app-region: no-drag rule inherited from .topbar button in EditorShellV4.module.css. The button then became a window-drag region: clicking the project title dragged the window instead of firing the onClick handler that opens the inline editor. That is the behaviour the v1.8.0.rc4 bug report describes — "the header title either does not respond to the rename gesture, the inline editor doesn't appear".

Apply the .ghostBtn class directly to the button (drop the wrapping <span> and the all: "unset" reset) so the topbar no-drag rule applies and the click reaches the handler. While here, collapse the three pieces of component state (editing, draft, inputRef + useEffect for focus) into a render switch with autoFocus + onFocus select, move the inline input style into the CSS module, and add a :disabled state for .ghostBtn so the no-project case is visually consistent with the other topbar buttons.

Cover the rename flow with a unit test: title is shown, no-project is disabled and labelled, click swaps to an input pre-filled with the title, Enter / blur commit, Escape cancels, whitespace-only is rejected, and a regression check that no element in the topbar reintroduces all: unset.

Related issue

Fixes #180

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Testing

  • npx tsc --noEmit — clean
  • npx vitest run src/components/ai-edition/v4/EditorTopBar.test.tsx — 8/8 pass
  • npx vitest run src/components/ai-edition/ — 67/67 pass
  • npm run i18n:check — all 12 locales match
  • npm run lint — no new errors (3 noEmptyBlockStatements warnings on the test file match the existing test pattern in the repo)
  • npm run format — clean

Manual smoke test on Windows / macOS still required (the bug itself only reproduces in the Electron build because jsdom does not honour -webkit-app-region).

The rename button in the v4 in-renderer topbar had `style={{ all: "unset" }}`
on it, which clobbered the `-webkit-app-region: no-drag` rule inherited from
`.topbar button` in EditorShellV4.module.css. The button then became a
window-drag region: clicking the project title dragged the window instead
of firing the onClick handler that opens the inline editor. That is the
behaviour the v1.8.0.rc4 bug report describes — "the header title either
does not respond to the rename gesture, the inline editor doesn't appear".

Apply the class directly to the button (drop the wrapping span and the
`all: "unset"` reset) so the topbar no-drag rule applies. While here,
collapse the three pieces of component state (editing, draft, inputRef +
useEffect for focus) into a render switch with autoFocus + onFocus select,
move the inline input style into the CSS module, and add a `:disabled`
state for `.ghostBtn` so the no-project case is visually consistent with
the other topbar buttons.

Cover the rename flow with a unit test (Enter / blur commit, Escape
cancels, whitespace-only is rejected, no-project is disabled, and a
regression check that no element in the topbar reintroduces `all: unset`).
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e11052c0-8016-4c9e-9071-3223c37f94fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/180-rename-topbar

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.

@EtienneLescot
EtienneLescot merged commit cc97851 into release/v1.8.0 Jul 28, 2026
9 checks passed
@EtienneLescot
EtienneLescot deleted the fix/180-rename-topbar branch July 28, 2026 08:47
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