Repository navigation
fix(topbar): project rename in the v4 header (#180) - #185
Merged
Merged
Conversation
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`).
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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.
Summary
The rename button in the v4 in-renderer topbar had
style={{ all: "unset" }}on it, which clobbered the-webkit-app-region: no-dragrule inherited from.topbar buttoninEditorShellV4.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
.ghostBtnclass directly to the button (drop the wrapping<span>and theall: "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 withautoFocus+onFocusselect, move the inline input style into the CSS module, and add a:disabledstate for.ghostBtnso 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
Release impact
Desktop impact
Testing
npx tsc --noEmit— cleannpx vitest run src/components/ai-edition/v4/EditorTopBar.test.tsx— 8/8 passnpx vitest run src/components/ai-edition/— 67/67 passnpm run i18n:check— all 12 locales matchnpm run lint— no new errors (3noEmptyBlockStatementswarnings on the test file match the existing test pattern in the repo)npm run format— cleanManual smoke test on Windows / macOS still required (the bug itself only reproduces in the Electron build because jsdom does not honour
-webkit-app-region).