Either side of the diff, onto the clipboard — and the .har that crashed it - #59
Merged
Merged
Conversation
…ed it
Copying a SIDE is not copying the diff: each slot now carries a copy control
that puts that file's own text on the clipboard verbatim, reachable from the
slot, Edit ▸ Copy Left/Right Side, the palette and CmdOrCtrl+Shift+1/2 —
Shift over the digit that OPENS that side.
A side with no text to give — a spreadsheet carries sheets, a streamed file
only a path — shows no control at all rather than one that refuses. utils/
sideText.js answers that once for both the button and the action, so no
surface can offer what another declines.
Two files sat at their exact ratchets and forced the extraction rather than a
raised cap: diffStore (747/747) hands its copy actions to stores/diffCopy.js,
the way snippetStore already hands off tags, colour and history; buildMenus
(87/87) hands its Edit section to editSection(). Both ratchets TIGHTEN —
747→710 and 87→67.
The crash a .har produced took three faults, and all three are fixed:
- .har was in no extension map, so it fell through to content sniffing.
- Sniffing sees a 50k prefix, which cuts a multi-MB capture into JSON that
no longer parses; HTML_RE then matched the <div>/<script> inside the
captured response bodies and named the whole file HTML.
- Monaco's HTML worker walks document symbols by plain recursion with no
depth guard, and every tag inside a JSON string is unclosed to an HTML
parser, so the nesting accumulated until the stack went.
har/map/webmanifest now resolve to json outright; the two sniffers that scan
anywhere skip JSON-shaped text; and documentSymbols is off for HTML, which
removes the crash surface for ANY deeply nested HTML rather than this one
route. Nothing here consumes symbols — no outline, no breadcrumbs, and the
palette that would offer Go to Symbol is already unbound.
detectLanguage.js was itself at 250/250, so the claude.ai link helpers — never
language detection — moved to utils/claudeLink.js.
The all-20 theme check for the new control lives in e2e, not theme-sweep:
every surface there opens through paste mode, which replaces the slots row,
and the control exists only once a real file is loaded. It caught .btn-icon's
--text-dim falling under the 3:1 mark floor on five light grounds (sepia 2.09,
solar 2.37, bloom 2.58, linen 2.72, meridian 2.91), so the revealed state
takes full ink. The first run of that probe was itself wrong — .btn transitions
colour over 120ms and getComputedStyle reports the interpolated value — so it
settles before measuring and carries a control probe that fails the
INSTRUMENT, not the theme, when the reading is impossible.
Co-Authored-By: Claude Opus 5 <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.
Copy either side
Copying a side is not copying the diff. Each file slot now carries a copy control that puts that file's own text on the clipboard verbatim — reachable from the slot, Edit ▸ Copy Left/Right Side, the palette, and Cmd/Ctrl+Shift+1 / +2 (Shift over the digit that opens that side). Paste mode reads the typed buffers.
A side with no text to give — a spreadsheet carries
sheets, a streamed file only a path — shows no control at all rather than one that refuses.utils/sideText.jsanswers that once for both the button and the action, so no surface can offer what another declines.Two files sat at their exact ratchets and forced the extraction rather than a raised cap:
diffStore.jsstores/diffCopy.jsbuildMenuseditSection()The
.harcrash — three faultsReproduced in
e2e/deep-html.spec.mjs(red → green):.harwas in no extension map, so it fell through to content sniffing.HTML_REthen matched the<div>/<script>inside the captured response bodies and named the whole file HTML.Fixed:
har/map/webmanifestresolve tojsonoutright; the two sniffers that scan anywhere skip JSON-shaped text;documentSymbolsis off for HTML, which removes the crash surface for any deeply nested HTML rather than this one route. Nothing here consumes symbols.detectLanguage.jswas itself at 250/250, so the claude.ai link helpers — never language detection — moved toutils/claudeLink.js.The theme check, and the instrument that was wrong
The all-20 check for the new control lives in e2e, not
theme-sweep: every surface there opens through paste mode, which replaces the slots row, and the control exists only once a real file is loaded.It caught
.btn-icon's--text-dimfalling under the 3:1 mark floor on five light grounds — sepia 2.09, solar 2.37, bloom 2.58, linen 2.72, meridian 2.91 — so the revealed state takes full ink.The first run of that probe was itself wrong:
.btntransitions colour over 120ms andgetComputedStylereports the interpolated value, so it measured a colour no one ever sees and named the wrong themes. It now settles before measuring and carries a control probe that fails the instrument, not the theme, when a reading is impossible.Verified
npm run checkexit 0 — 3498 tests, re-run after rebasing ontomainmake theme-sweep— 1480 measurements across 20 themesNot verified: the raw
Cmd+Shift+1/2keypress — CDP-injected keys never reach a native accelerator, so the spec drives the menu item and the binding rests on the unit-level shortcut guard.🤖 Generated with Claude Code