Skip to content

fix(markdown): theme the table-of-contents scrollbar - #18328

Closed
CodeHourra wants to merge 2 commits into
stablyai:mainfrom
CodeHourra:feat/markdown-toc-scrollbar
Closed

CodeHourra wants to merge 2 commits into
stablyai:mainfrom
CodeHourra:feat/markdown-toc-scrollbar

Conversation

@CodeHourra

Copy link
Copy Markdown

ELI5

Long Markdown tables of contents currently show a bright native scrollbar track in dark mode. This change makes the heading list use Orca's existing thin, themed scrollbar, so it matches the surrounding navigation UI.

What Changed

  • Apply the existing scrollbar-sleek class to the shared table-of-contents scroll container.
  • Extend the existing component test to catch a missing scrollbar class.

The shared component covers both Markdown preview and rich-text editing. No new CSS, dependencies, or navigation logic is introduced.

Why

The list already scrolls correctly, but it does not opt into any of the scrollbar styles required by docs/STYLEGUIDE.md. Reusing the standard list scrollbar fixes its appearance and keeps theme and hover behavior in one place.

Linked Issue

Fixes #18327

Visual Proof

Before and after, at the same viewport size, using synthetic headings in an isolated Electron rendering of the real shared component with repository styles. These are component-level captures, not full-application screenshots. Click an image to inspect it at full size.

Before After
Before: bright native scrollbar track in dark mode After: thin themed scrollbar and transparent track

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Local checks on macOS arm64:

  • node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/components/editor/MarkdownTableOfContentsPanel.test.tsx — passed (1 test). The added assertion failed before the fix and passes afterward.
  • pnpm typecheck — passed on this feature branch.
  • oxlint and oxfmt --check on both changed files — passed.
  • Agent-driven Electron 43.4.1 / Playwright CDP component validation — reproduced the native scrollbar before the fix; checked thin themed scrollbars, transparent tracks, hover feedback, no horizontal overflow, and scrolling to the bottom of a long heading list in light and dark themes after the fix. Screenshots were also visually inspected by the agent; the manual checkbox is left unchecked because no human manual test is being claimed.
  • The fix was also included in a successful unsigned macOS arm64 app/DMG build on a separate local integration branch. That build is supporting evidence, not an upstream build of this exact PR branch; no integration-branch customization is included in this PR.

Reviewer reproduction: open a Markdown document with enough headings to overflow the table of contents; enable the table of contents in preview or rich-text editing mode, switch between light and dark themes, hover the list, and scroll to its last heading.

Full pnpm lint, the full pnpm test suite, and pnpm build on this feature branch have not been run locally and are left to repository CI. Windows, Linux, SSH sessions, and mobile were not runtime-tested locally.

AI Disclosure

OpenAI Codex assisted with diagnosis, implementation, regression checks, visual inspection, and this PR description. The exact model identifier is not exposed in this session.

Author

GitHub: @CodeHourra
X/Twitter: codeJump (@CodeGod9)

Review

AI self-review:

  • Cross-platform: reuses the app's existing Chromium/CSS scrollbar style; adds no OS checks, shortcuts, or path handling. macOS was validated; Windows/Linux remain for CI and reviewer validation.
  • SSH/remote/local: presentation-only change in the shared renderer component; no execution-host, filesystem, IPC, or remote-wire behavior changes. SSH was considered but not exercised locally.
  • Agents/integrations/providers: the class applies to the heading list regardless of document origin, CLI agent, integration, or Git provider.
  • Performance/security: no new rendering work, event handlers, dependencies, input processing, or trust-boundary changes.
  • UI quality: follows the documented scrollbar style; verified light/dark colors and hover feedback while preserving scrolling and list layout.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No mobile-specific code or shared protocol changes. PR file diff contains only the table-of-contents component and its test; screenshots are GitHub attachments, not committed assets.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36561, which fixes the built-in color defaults (WCAG AA pairs, light-mode active tab and the TOC scrollbar). Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
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]: Markdown table of contents uses a bright native scrollbar in dark mode

2 participants