Skip to content

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

Closed
nwparker wants to merge 2 commits into
nwparker/editor-mobile-import-cycle-lintfrom
nwparker/editor-markdown-toc-scrollbar
Closed

nwparker wants to merge 2 commits into
nwparker/editor-mobile-import-cycle-lintfrom
nwparker/editor-markdown-toc-scrollbar

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 0

ELI5

A long Markdown table of contents now uses Orca’s themed scrollbar instead of the operating system’s default appearance.

What Changed

Adopt @CodeHourra’s #18328: add the existing scrollbar-sleek class to the ordinary heading list and retain the contributor’s regression assertion. Both stevelliu author commits are preserved. The first commit’s Finder metadata is removed by the author’s second commit, so the final diff contains only the component and its test (+2/−1; production +1/−1, net zero).

The conflict with today’s virtualized branch was resolved by retaining the current component and applying the class only to its ordinary list. Large-document Preview already uses scrollbar-editor and keeps that behavior.

Why

The style guide requires an existing scrollbar theme on overflow containers. This reuses the canonical list theme, including transparent track and hover feedback. No new CSS, library changes, sizing rules, or navigation logic are needed.

Linked Issue

Addresses #18327. Keep the issue open until the reporter’s original native-scrollbar appearance is confirmed.

Visual Proof

Full-app hidden macOS captures with the same synthetic heading list. The current baseline has an unthemed, dark native thumb rather than the bright track shown in the contributor’s older isolated-component capture; it computes auto for width and color. The fix computes thin with Orca’s neutral thumb and transparent track.

Git rich editor before / after:

Git rich baseline native scrollbar

Git rich themed scrollbar

Earlier folder-file Preview renderer control before / after (not a registered folder workspace):

Earlier folder-file Preview renderer baseline native scrollbar

Earlier folder-file Preview renderer themed scrollbar

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

The contributor’s assertion failed on the baseline and passes after adoption. All 39 tests in six suites pass, covering the shared panel, collapse state, visibility, heading navigation, and stored Markdown view state. Full typecheck, full lint, changed-code quality, pinned standalone React Doctor changed-lines gate, and a fresh Electron build pass.

Actual compiled macOS controls run before and after: 14 cases each, covering Git workspaces and folder-file renderer controls, rich editor and Preview, dark/light themes, short lists, and the existing large-document virtual list. The earlier folder cases used incomplete project-group metadata and do not establish normal-folder acceptance. Hover feedback, list scrolling, last-heading navigation, panel width, horizontal overflow, clean state, and unchanged authored disk bytes are checked. Screenshots were inspected and owned apps closed.

Reviewer check: open a Markdown file with many headings, show Table of Contents, and scroll its list in dark/light themes. Navigate to its last heading and repeat in rich editing and Preview.

Corrected folder acceptance

The earlier folder-file captures and receipts remain as renderer controls. A separate hidden Linux Electron 43.7.5 run creates a real folder group with its parent path supplied at creation, then verifies the renderer catalog, local execution host, active workspace, file owner, and a unique mounted document marker before and after every case.

All 14 Git/ordinary-folder cases pass: rich editing and Preview under both themes, short lists, and the existing large-document virtual list. Eight trusted native wheel checks scroll the long list from 0 to 400 and then navigate to Chapter 080. Ordinary lists use the themed thin scrollbar and hover feedback; short lists do not overflow, and the virtual list retains its existing theme. All cases keep the panel width at 240 px, have no horizontal overflow, and leave clean state and authored disk bytes intact. There are no page errors, and the owned app is closed.

This is fixed acceptance on the read-only combined build at b7ac4927068c6074acda61334b097881551857d6, which includes this PR. Main and renderer build hashes match before and after; this PR's source and head are unchanged. It does not establish a genuine ordinary-folder baseline or the reporter's exact scrollbar preference.

Registered folder rich editor, dark theme

Registered folder Preview, light theme

Review

Independent review checked the source, regression tests, and rendered before/after proof.

Agent skill upstream boundary

  • Not applicable; no agent skill source is copied or translated.

Notes

Low risk: one existing presentation class on an existing overflow container. Scrollbar rendering varies by OS and scrollbar preference. Windows, live SSH, and physical mobile devices were not runtime-tested; corrected ordinary-folder acceptance uses the separate Linux run below, and this changes no host, filesystem, IPC, or remote-wire behavior. The macOS reporter’s exact older bright-track configuration remains unverified.

Stacked on #25540’s shared lint repair to keep the two-file diff focused.

Checklist

  • Small, focused change with contributor credit preserved
  • Before/after, mechanism, and approach explained
  • Before/after captures attached
  • Source and neighboring behavior reviewed
  • Platform and remote scope considered
  • Typecheck, full lint, scoped tests, quality gates, and fresh build pass

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Theme the TOC scrollbar — MarkdownTableOfContentsPanel.tsx:182 adds the existing scrollbar-sleek class to the non-virtualized markdown-toc-list div, the style-guide default for sidebar/list scrollbars (STYLEGUIDE.md L226, main.css L545). The container already sets overflow-y: auto (markdown-preview.css L155), so the theme applies.
  • Regression assertion — the panel test pins the exact rendered class string (MarkdownTableOfContentsPanel.test.tsx:62). Confirmed non-vacuous: removing the class makes the assertion fail.

The virtualized list keeps its pre-existing scrollbar-editor (VirtualMarkdownTableOfContents.tsx:37); this PR does not touch that path and the body documents the intent. No actionable findings.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

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.

1 participant