Skip to content

fix(terminal): render the vertical scrollbar again while keeping the gutter transparent - #12806

Closed
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/12635-terminal-scrollbar-render
Closed

bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/12635-terminal-scrollbar-render

Conversation

@bbingz

@bbingz bbingz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The terminal vertical scrollbar no longer rendered on any theme after #7876 folded the xterm viewport into both standard scrollbar-* properties and ::-webkit-scrollbar* rules.
Fixes #12635.

Screenshots

No screenshot available. Reviewer will see: a visible vertical scrollbar thumb over a transparent gutter/track in the terminal; horizontal scrollbar unchanged; editor/Monaco .scrollbar-editor behavior unchanged.

Testing

  • pnpm lint — ran pnpm exec oxlint on terminal-scrollbar-style.test.ts (0 errors); CSS has no oxlint surface
  • pnpm typecheck — skipped (CSS + style unit test only; no TS production changes)
  • pnpm test — focused: pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/assets/terminal-scrollbar-style.test.ts (2/2 pass). Repository-wide suite not run.
  • pnpm build — not run (renderer CSS + test-only change; build would not exercise the regression)
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed — mutual-exclusion assertion: viewport must not set standard scrollbar-width/scrollbar-color when it also uses ::-webkit-scrollbar* (the hole fix(terminal): make xterm scrollbar gutter transparent #7876's greps missed). RED on origin/main before the CSS fix; GREEN after.

ELI5

Clicking around in a terminal, the thin grey bar on the right edge that shows scroll position disappeared. Browsers (and Electron's Chromium) ignore custom scrollbar paint rules when you also set the newer standard scrollbar properties on the same element. We keep the transparent track from the original fix, but stop setting those standard properties on the terminal viewport so the thumb can paint again.

AI Review Report

Self-review of a renderer-only CSS + unit-test change:

  • Mechanism: Chromium ≥121 disables ::-webkit-scrollbar* when scrollbar-width / scrollbar-color are present; Electron 43.1.0 ships Chromium ~140, so the conflict applies.
  • Scope: removed .xterm .xterm-viewport only from the standard-props rule; left it on all webkit track/thumb rules so fix(terminal): make xterm scrollbar gutter transparent #7876's transparent gutter remains.
  • Colors: reused existing rgba(121, 121, 121, 0.4|0.7) already defined for this scrollbar — no invented tokens (STYLEGUIDE).
  • Cross-platform: macOS / Linux / Windows all use Electron Chromium for the terminal DOM scrollbar; no shortcuts, paths, shell, or native scrollbars touched. Horizontal scrollbar lives on a different element and was never broken.
  • Risks checked: over-reverting fix(terminal): make xterm scrollbar gutter transparent #7876 (avoided); breaking .scrollbar-editor Firefox path (standard props kept there); test false positives on multi-selector blocks (selector parser excludes ::-webkit-scrollbar*).

Security Audit

No security surface. No IPC, command execution, filesystem, auth, secrets, network, or dependency changes — pure renderer CSS styling and a style-source unit test.

Notes

Mechanism: #7876 added .xterm .xterm-viewport to both the standard scrollbar-width/scrollbar-color block and the ::-webkit-scrollbar* blocks. In Chromium ≥121, standard scrollbar properties disable webkit pseudo styling, so the custom thumb never applied; with terminal.css making the viewport background transparent, the UA thin thumb over a transparent track was effectively invisible. Horizontal scrollbar is a different element, which is why it survived.

Supersedes nothing; #7876's transparent-gutter intent is preserved (webkit track remains background: transparent; only standard props were removed from the viewport selector).

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b4ce1c47-2c88-46d8-af60-98154d835a8b

📥 Commits

Reviewing files that changed from the base of the PR and between 6a5a97def56512c0d02b60725d7af2d78e189a06 and 44e01b9.

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

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


📝 Walkthrough

Walkthrough

The editor scrollbar CSS now applies standard scrollbar-width and scrollbar-color properties only to .scrollbar-editor. Terminal viewport styling continues to use WebKit scrollbar pseudo-elements. Tests now parse CSS rules, verify shared track and thumb styling, preserve the terminal variable assertion, and reject standard scrollbar properties on terminal viewport pseudo-element rules.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary fix: restoring the terminal vertical scrollbar while preserving a transparent gutter.
Description check ✅ Passed The description provides the problem, user impact, linked issue, technical cause, solution, testing, risk analysis, and security review. It does not follow every template heading and does not provide …
Linked Issues check ✅ Passed Issue #12635 requires a visible terminal vertical scrollbar without changing horizontal or editor scrollbar behavior. The PR removes scrollbar-width and scrollbar-color from `.xterm .xterm-viewpor…
Out of Scope Changes check ✅ Passed The diff changes only terminal/editor scrollbar CSS separation and its focused regression tests. These changes directly support issue #12635. No unrelated product behavior or files are changed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…

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.

🧹 Nitpick comments (1)
src/renderer/src/assets/terminal-scrollbar-style.test.ts (1)

26-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert scrollbar-width for .scrollbar-editor.

The test checks only scrollbar-color. If scrollbar-width: thin is removed, the test passes but editor scrollbar behavior changes. Add an assertion for the width declaration.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 634981f8-8781-4621-a0ad-aaa8288dff61

📥 Commits

Reviewing files that changed from the base of the PR and between 79896cb and 606507098374f9b608b214c0e8c5478aa21dfb8e.

📒 Files selected for processing (2)
  • src/renderer/src/assets/main.css
  • src/renderer/src/assets/terminal-scrollbar-style.test.ts

@bbingz

bbingz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

CI gate

@Jinwoo-H (or any maintainer with Actions approval) — could you Approve and run workflows on this head (606507098)?

Why this is P0

This undoes a regression from our own merged #7876: Chromium ≥121 disables ::-webkit-scrollbar* once standard scrollbar-width / scrollbar-color are set on the same element, so the vertical terminal scrollbar disappeared after the gutter-transparency change.

Evidence already on the PR

  • RED→GREEN mutual-exclusion test in terminal-scrollbar-style.test.ts (asserts the two styling systems do not co-exist on the live terminal class)
  • No platform-specific path; CSS-only + unit test

Fork PR Checks are stuck at action_required (same shape as other community PRs that only turn green after a maintainer click). Happy to rebase if anything else is blocking — please do not require a push solely to re-queue workflows if the approval click is available.

@bbingz

bbingz commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

CI readout (head 606507098)

Workflows ran after the earlier approve request:

Check Result
typecheck, git compatibility, shell contracts green
tests node 24 (16/16) + node 26 (16/16) green
package + package (windows) green
cross-version wire compatibility green
static analysis red — eslint(max-lines) on mobile/src/session/use-mobile-native-chat-controller.ts (303 lines on this base)
verify red only as cascade from static analysis

This PR does not touch that mobile file (diff is only main.css + terminal-scrollbar-style.test.ts). Current main already fixed it via #12826 (file is 288 lines on tip). A rebase onto latest main should clear the only red check without changing the scrollbar fix.

Holding the head until a maintainer prefers rebase-or-merge-as-is — not force-pushing on my own.

@bbingz
bbingz force-pushed the fix/12635-terminal-scrollbar-render branch from 6065070 to 98f109c Compare August 11, 2026 05:02
@coderabbitai

coderabbitai Bot commented Aug 11, 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.

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d0d99f7-e6a6-49e6-a05d-dc07db370172

📥 Commits

Reviewing files that changed from the base of the PR and between 93e0811 and 98f109c1681e80fb153536c90fa3c59934222221.

📒 Files selected for processing (2)
  • src/renderer/src/assets/main.css
  • src/renderer/src/assets/terminal-scrollbar-style.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/assets/main.css

@bbingz
bbingz force-pushed the fix/12635-terminal-scrollbar-render branch from 98f109c to 6a5a97d Compare August 11, 2026 19:25
@coderabbitai

coderabbitai Bot commented Aug 11, 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.

@nwparker nwparker removed the P1 label Aug 19, 2026
Chromium disables ::-webkit-scrollbar* when scrollbar-width/color are set.
Keep standard props on .scrollbar-editor only; style xterm viewport with
webkit pseudos so the thumb paints again while the track stays transparent.
@bbingz
bbingz force-pushed the fix/12635-terminal-scrollbar-render branch from 6a5a97d to 44e01b9 Compare September 20, 2026 11:03
@bbingz

bbingz commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing: on xterm 6 .xterm-viewport is an empty element, so this CSS can't change the scrollbar users see, which is xterm's own .xterm-slider. A headless A/B with and without this change rendered the same slider. #12635 more likely needs a look at that slider's auto-hide and its width and colors.

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.

[Bug]: Terminal vertical scrollbar does not render on any theme (regression, xterm viewport)

4 participants