fix(webapp): shared-page inline code reads as code in dark mode (BEA-90) - #134
Open
ssowonny wants to merge 1 commit into
Open
fix(webapp): shared-page inline code reads as code in dark mode (BEA-90)#134ssowonny wants to merge 1 commit into
ssowonny wants to merge 1 commit into
Conversation
BEA-71 fixed the ordering bug that made the dark block lose to the light `code` rule, but it stopped at the background: a dark chip still inherits the body's #eef0f3, so `bdrive init` mid-sentence looks exactly like the prose around it. That was the reporter's actual ask — "make the text more distinct". Inline code now carries the hub viewer's warm tint (#e4d9c4) plus an edge. The edge is an inset box-shadow, not a border, so the chip's box metrics don't move between modes and light mode stays byte-identical — verified by screenshotting the same share page in both schemes before and after. `pre code` resets both, so a fenced block stays one dark slab instead of a row of bordered chips. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
TL;DR
bdrive initmid-sentence looked exactly like the words around it — same white, faint slab. Now it's warm-tinted with a visible edge, so a chip reads as code.pre coderesets both new properties./s/*followsprefers-color-schemeonly. Both were out of scope in the spec.The change
Four lines inside the existing dark block of
sharedMarkdownShell(internal/webapp/shares.go). No light rule is touched.@media (prefers-color-scheme: dark){ body{background:#0a0b0d;color:#eef0f3} a{color:#ffcf85} h1,h2,h3{color:#eef0f3} pre,code{background:#15171b} +code{color:#e4d9c4;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07)} +pre code{color:inherit;box-shadow:none} blockquote{border-left-color:rgba(255,255,255,.07);color:#9aa0a9}#e4d9c4is the hub viewer's own inline-code colour (frontend/src/style.css), copied rather than linked —/s/*is a standalone sandboxed document and deliberately fetches no stylesheet.Deviation from the reviewed plan
The plan was written against
71e52d5, before BEA-71 landed. Three of its four steps were already merged by #122 — the dark block is one block at the end,blockquote/td,th/table.frontmatterall have dark values, andTestShareDarkThemeIsLastalready pins the ordering. Rebuilding them would have churned merged code for nothing, so this PR is only the residual delta.One more deliberate deviation inside that delta: the plan called for
border:1px solid rgba(...)in dark plusborder:1px solid transparentin light to keep the metrics aligned. A transparent border still grows the light chip by 2px, which contradicts the plan's own "light mode is pixel-unchanged" acceptance criterion. An insetbox-shadowgives the same edge with no box change and no light-mode edit at all — hence the byte-identical light screenshot below.Dark mode: before / after
Same page in light mode, before and after — pixel-identical,
cmpon the two PNGs returns clean:What was run
go build ./...,go vet ./...,go test ./...— all packages pass.npm run e2e— 153 passed, 1 skipped (pre-existing skip insec14fe.spec.ts)./s/<token>response bytes, rendered in Chromium atcolorScheme: darkandlight.TestShareDarkThemeIsLastextended: dark inline code must declare its own colour and edge, andpre codemust reset both. It fails onorigin/main.static/is untouched and no rebuild was needed.Content-Security-Policy: sandbox allow-scripts allow-popupsheader on/s/*is untouched — this change adds no fetch, no font, no external reference.One open question
BEA-90 is marked Duplicate of BEA-71 in Linear. It isn't quite — BEA-71's fix left the reporter's specific complaint standing, which is what this PR closes. Worth deciding whether the issue goes back to Duplicate after merge or stands on its own.
Build session
(only works on the machine this ran on)