Skip to content

fix: center Monaco find widget expand/collapse toggle chevron - #6683

Merged
Jinwoo-H merged 1 commit into
stablyai:mainfrom
Jingyue-Wu:fix/monaco-find-widget-toggle-centering
Jun 29, 2026
Merged

Jinwoo-H merged 1 commit into
stablyai:mainfrom
Jingyue-Wu:fix/monaco-find-widget-toggle-centering

Conversation

@Jingyue-Wu

@Jingyue-Wu Jingyue-Wu commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The expand/collapse toggle (the chevron > on the far left of the editor's
Find widget, Ctrl/Cmd+F) was not vertically centered — it rode high against the
top of the find row instead of sitting centered like the stock Monaco / VS Code
find widget.

Root cause was in Orca's find-widget overrides in
src/renderer/src/assets/main.css:

  • The generic .monaco-editor .find-widget .button rule forced
    height: 20px !important, which overrode Monaco's default height: 100% on
    the toggle button. Because the toggle is position: absolute; top: 0, a fixed
    20px height pinned the chevron to the top of the ~33px row.
  • The rule meant to handle this (.button.expand) targeted a class that does
    not exist — Monaco renders the toggle as button codicon toggle left, so the
    override was dead code and never applied.

The fix replaces the dead .button.expand rule with a .button.toggle rule
that restores Monaco's defaults (width: 18px, height: 100%, top: 0). The
chevron is then centered by the align-items/justify-content: center already
applied by the generic button rule — matching the stock find widget.

Screenshots

Before: chevron sits high / not vertically centered.
image
image

After: chevron centered to match the default Monaco find widget.
image
image

Testing

CSS-only visual fix; behavior is unchanged. Verified against the bundled
Monaco source (node_modules/monaco-editor/.../findWidget.{css,js}) to confirm
the toggle's real class (.button.toggle) and its default height: 100%
centering.

AI Review Report

Reviewed with an AI coding agent. Scope is a single CSS rule in
src/renderer/src/assets/main.css.

  • Cross-platform (macOS/Linux/Windows): No platform-specific code, shortcuts,
    labels, paths, or shell behavior touched. Monaco renders the find widget
    identically across platforms; the rule only adjusts CSS sizing/positioning.
  • SSH/remote/local: Pure renderer styling, no process/file/network/credential
    assumptions; behaves identically regardless of where the workspace lives.
  • Agent/integration/git-provider: Not applicable — no agent, integration, or
    provider logic involved.
  • Performance: Negligible — one additional static CSS rule; no new selectors
    in hot paths or runtime work.
  • UI quality: Restores parity with the stock Monaco/VS Code find widget;
    centering holds in both find-only and find+replace modes. Should be checked in
    both light and dark themes.
  • Result: No issues flagged; git diff confirms the change is limited to the
    single intended hunk.

Security Audit

No security-relevant surface touched. No input handling, command execution, path
handling, auth, secrets, dependency changes, or IPC involved — the change is a
single presentational CSS rule. No follow-up needed.

The generic `.button` height override was collapsing the expand/collapse
chevron to 20px, pinning it to the top instead of centering it vertically.
Switch to targeting `.button.toggle` and restore `height: 100%` so Monaco's
own layout centers the chevron over the find row.
@coderabbitai

coderabbitai Bot commented Jun 29, 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 40ee8a04-4d23-4c86-9a83-c37e76a3d01f

📥 Commits

Reviewing files that changed from the base of the PR and between 31d35b1 and 30c7bb5.

📒 Files selected for processing (1)
  • src/renderer/src/assets/main.css

📝 Walkthrough

Walkthrough

The CSS override for the Monaco editor find widget is updated in main.css. The previous rule targeting .button.expand (setting 16px width and height) is removed and replaced with a new rule for .button.toggle that sets height: 100%, width: 18px, and top: 0, restoring full-height centering for the expand/collapse chevron button in the find widget.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main UI fix and matches the CSS-only chevron centering change.
Description check ✅ Passed All required sections are present and the PR explains the fix, screenshots, review, and security; testing could be more explicit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@Jinwoo-H
Jinwoo-H self-requested a review June 29, 2026 05:51

@Jinwoo-H Jinwoo-H 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.

Thanks! Confirmed against the bundled Monaco source and validated live with Cmd+F — the toggle now fills the row and centers like stock Monaco. Other find toggles untouched, lint passes. Merging.

@Jinwoo-H
Jinwoo-H merged commit 2aeb026 into stablyai:main Jun 29, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
The generic `.button` height override was collapsing the expand/collapse
chevron to 20px, pinning it to the top instead of centering it vertically.
Switch to targeting `.button.toggle` and restore `height: 100%` so Monaco's
own layout centers the chevron over the find row.
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.

2 participants