Skip to content

Reveal Caret in Preview (⌘⇧J) reads the display list - #688

Merged
GoKubar merged 2 commits into
mainfrom
reveal-caret-v2
Sep 16, 2026
Merged

GoKubar merged 2 commits into
mainfrom
reveal-caret-v2

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

⌘⇧J has been broken in the shipped default since 2026-09-13

revealCaretInPreview() mapped the caret through CaretSync onto
compile_result.pages — which is exactly what the v2 route asks the producer to
stop sending:

DisplayListDelta.v2OnlyEnabled defaults on (FLASHTEX_DISPLAY_V2_ONLY != "0")
  -> compile() appends v2OnlyCapability whenever the v2 live route is negotiated
  -> result.pages comes back empty
  -> hits is empty
  -> "Caret byte N is inside no preview item"

The v2 pane became the default in 118b00d1 (09-12) and the shell began
requesting display-list-v2-only in 1db001b7 (09-13). Between those two
commits the command degraded to a no-op on every live compile, while continuing
to work in the FLASHTEX_PREVIEW_V2=0 path nobody runs.

MathCaretHighlightTests had even pinned the broken answer as expected
behaviour, with a comment acknowledging it:

// ⌘⇧J on the v1 side is unchanged in contract: the v2 frame has no v1 result here.
model.revealCaretInPreview()
XCTAssertEqual(model.navigationNote, "No compile result loaded; the caret maps to no preview item.")

This is a port, not a design

CaretFollow.caretTarget(byte:path:in frame:) already located the caret in a v2
frame for automatic follow. ⌘⇧J simply never got the same treatment.

caretV2Hit shapes the caret's highlight as the same V2Geometry.Hit a click
produces, so ⌘⇧J goes through navigateV2Now — one navigation path, reusing the
digest attestation, rebase-onto-an-edited-buffer and multi-span notes already
proven there.

  • A caret inside math selects the enclosing formula span ($…$ including
    delimiters) with no expected text to verify, because no single cluster's text
    equals that span.
  • Ordinary text selects the cluster, with its text verified as before.
  • Non-resident pages of a windowed frame are skipped.

The v1 branch is untouched and still serves FLASHTEX_PREVIEW_V2=0; it runs only
when there is no v2 frame, so the existing v1 fixture tests are unaffected.

One behaviour change, and it is the point

NavigationMultiFileV2Tests asserted that a caret inside the ffl ligature of
"shuffle" selects "shuffle", because a v1 text item is a whole run. On the
display list it selects "ffl" — and the assertions three lines above it in the
same test already establish that contract (the caret resolves to the ffl
cluster with no exact caret, the documented whole-cluster fallback).

Clicking that ligature always selected ffl. So ⌘⇧J and a click on the same
caret
used to disagree; they no longer do. Assertion updated with that reason
rather than quietly relaxed.

Verification

Targeted, fleet lock held, real Rust release binaries:
MathCaretHighlightTests | NavigationTests | NavigationMultiFileV2Tests | CaretFollowTests | CaretSyncTests — 22 tests, 1 skipped, 0 failures.

A complete full-suite number is unavailable to anyone right now: IMECompositionTests
aborts the Mac suite nondeterministically at test 668 of ~1400 (#681), and it
predates this work — it reproduces at commits from 18:48 on 09-15, hours before
this branch existed. #680 tracks the false-green that abort produces.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

⌘⇧J has been broken in the shipped default since 1db001b (2026-09-13), when
the shell began requesting `display-list-v2-only`. `revealCaretInPreview()`
mapped the caret through `CaretSync` onto `compile_result.pages`, and that is
exactly what the v2 route asks the producer to stop sending:

  DisplayListDelta.v2OnlyEnabled defaults on (FLASHTEX_DISPLAY_V2_ONLY != "0")
  → compile() appends v2OnlyCapability whenever the v2 live route is negotiated
  → result.pages comes back empty
  → hits is empty
  → "Caret byte N is inside no preview item"

The v2 pane became the default the day before (118b00d), so between those two
commits the command degraded to a no-op on every live compile, while continuing
to work in the FLASHTEX_PREVIEW_V2=0 path nobody runs. `MathCaretHighlightTests`
had even pinned the broken answer ("No compile result loaded; the caret maps to
no preview item") as expected behaviour.

This is a port, not a design: `CaretFollow.caretTarget(byte:path:in frame:)`
already located the caret in a v2 frame for automatic follow — ⌘⇧J simply never
got the same treatment.

`caretV2Hit` shapes the caret's highlight as the same `V2Geometry.Hit` a click
produces, so ⌘⇧J goes through `navigateV2Now` — one navigation path, with the
digest attestation, rebase-onto-an-edited-buffer and multi-span notes already
proven there. A caret inside math selects the enclosing formula span (`$…$`
including delimiters) with no expected text to verify, because no single
cluster's text equals that span; ordinary text selects the cluster, with its
text verified as before. Non-resident pages of a windowed frame are skipped.

The v1 branch is untouched and still serves FLASHTEX_PREVIEW_V2=0; it runs only
when there is no v2 frame, so the existing v1 fixture tests are unaffected.

Implementation-Agent: claude-opus-5 (export-consolidation lane)
Commit-Executor: claude-opus-5 direct git (Cursor usage limit)
Co-authored-by: GoKubar <[email protected]>
NavigationMultiFileV2Tests pinned the coarser runtime-v1 answer: a caret inside
the `ffl` ligature of "shuffle" selected the whole word, because a v1 text item
is a whole run. The assertions immediately above it establish the v2 contract
for the same caret — it resolves to the `ffl` cluster with no exact caret, the
documented whole-cluster fallback — so with ⌘⇧J on the display list the
selection is `ffl`.

That is the point rather than a casualty: clicking that ligature in the pane
already selected `ffl` (both now go through `navigateV2Now`), so ⌘⇧J and a click
on the very same caret used to disagree. They no longer do.

Implementation-Agent: claude-opus-5 (export-consolidation lane)
Commit-Executor: claude-opus-5 direct git (Cursor usage limit)
Co-authored-by: GoKubar <[email protected]>
GoKubar added a commit that referenced this pull request Sep 16, 2026
…#692)

The successor Commander needs this and it existed only in a scratchpad.

Records: what landed (119 commits, 33 PRs, backlog 219 -> 66, branches 540 ->
182), what is NOT released (v0.1.5 = `fe9bc430`, 36 commits behind main, none of
this session in it), the two live user-facing bugs with fixes in flight (#688
the caret reveal, #689 the page readout), the four items blocked on the owner
(`workflow` token scope, the Mac GitHub SSH key, #681, #687), and the landmines
worth inheriting -- one worktree per test run, `cargo test --no-run` first,
`--release` not debug (#667), apply a diff rather than copying files when
splitting a PR, and retarget stacked children before merging a parent.

No live Commander successor exists: Jaysen is dead per the owner, Daniel has
been silent since 2026-09-15T13:01Z, and every Remote Control peer is offline.
The seat is published as OPEN.

Implementation-Agent: Claude Opus 5 (orchestrator-astra, linux-primary)
Commit-Executor: Claude Opus 5 via Claude Code

Co-authored-by: Claude Opus 5 <[email protected]>
@GoKubar
GoKubar merged commit 5ab8e96 into main Sep 16, 2026
18 of 21 checks passed
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