Repository navigation
fix(platform): give code and text previews an editor's line rhythm - #3524
Merged
Merged
Conversation
The document text preview and the skill asset viewer set their type on the inline `code` with leading-relaxed: the highlighted path drew 12px text on 19.5px rows, the document preview's plain path 14px text, and the skill viewer's plain path 12px text on the block's own 24px rows. Worse, `.code-line-numbers` made each Shiki `.line` a block while Shiki joins them with a literal newline, so every source line was followed by an empty line box and a highlighted file read double-spaced (about 40px per row); with wrap on, a long line continued under the numbers. Both viewers, their highlighted and plain paths and the text skeleton now share one `previewCodeTextClasses` (mono text-xs, leading-5) set on the block. A `.line` is an inline-block row that ends at Shiki's newline and hangs its wrapped continuation 3rem in, past the gutter. The highlighter is asked for `min-light` / `min-dark` by name in both viewers and the chat code block instead of the github aliases. Browser specs pin the 20px row, one row per line, the hanging indent with wrap on and off, the skeleton's row height and the theme names; KNOW-F30 and SKILL-F14 keep the light/dark look manual.
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.
Problem
Backlog TALE-6 (triage 2026-09-27, T19): the document text preview and the skill asset viewer did not read like an editor.
leading-relaxedon the inlinecode, so the row height came out of the surrounding block instead. The highlighted path drew 12px text on 19.5px rows. The document preview's plain path (a.txt, or a code file over the highlight cap) drew 14px text, and the skill viewer's plain path drew 12px text on 24px rows. When the highlight landed, the file changed size. Thepreview-pane.tsxtext skeleton used a third size..code-line-numbersgutter itself. It made every Shiki.linea block, but Shiki joins its lines with a literal newline. That newline became an empty line box after every source line, so a highlighted file was double-spaced: about 40px per row, measured in Chromium. With wrap on, a long line continued under the line numbers.github-dark/github-lightaliases to the highlighter.Change
preview-pane.tsxexportspreviewCodeTextClasses(font-mono text-xs leading-5). It is set on the block, never on the inlinecode, in:document-preview-text.tsxskill-asset-viewer.tsxkind="text"skeletonpackages/ui/src/globals.css: a.code-line-numbers .lineis now an inline-block row as wide as the pane (display: inline-block; width: 100%). The row ends at Shiki's newline, so there is no empty line box between rows. It carries a 3rem hanging indent (2rem gutter plus a 1rem gap), so a wrapped line continues under its own text. The only users of.code-line-numbersare these two viewers.shared/markdown/code-block.tsx, which renders the fences of a.mdasset or document) now passmin-light/min-dark. The resolved theme does not change.Verification
document-preview-text.browser.test.tsxandskill-asset-viewer.browser.test.tsx(vitest browser, Chromium, real Tailwind CSS). All 11 tests fail onorigin/mainwith, for example:expected '19.5px' to be '20px'expected '14px' to be '12px'expected 22.75 to be 20(skeleton)expected 72 to be 60(3 plain rows)expected +0 to be 48(the wrapped continuation sits under the numbers)expected 40 to be 20,expected +0 to be 48), so the CSS change is load-bearing on its own..ts,.json,.mdand.txtin light and dark, with wrap on and off.oxlint --type-awareon the changed files: cleantsc --noEmitfor@tale/platform: clean@tale/uiglobals.test.tsand markdown tests: passbun run lint:manualandcheck-guide.tson both suites: OKManual layer
KNOW-F30(knowledge) andSKILL-F14(skills) cover how both viewers look in light and dark.reference/automation.mdhas a row naming the two specs that own the geometry.Open
muted-foregroundat 50% opacity. That contrast is low, and whether to raise it is a design decision this change does not take.@tale/ui'shighlightCodestill accepts thegithub-*aliases for other consumers. No caller in this repo passes them any more.