Repository navigation
fix(app-shell): a cited heading is read as its face draws it, so links and entities open their section - #37756
Conversation
…escapes Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Final head for review: |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. Fixes is right. The card asks for one comparison form on the page side, with no change to the anchor or the outline wire shape. Red first. Four cases fail on base: link, markdown entity, html entity, and the link-titled listed heading. Bold, code and escape already passed, because a reading keeps letters and digits only, so they are controls. That is the expected split. The code, read.
Deviations, judged. The tests sit in the existing Changeset, sentence by sentence. A cited section whose heading carries a link or an entity opens at that heading: true, pinned. The page reads the outline's heading and the drawn heading the same way: true, Contract review. None owed. Out of scope. Nothing filed. Landing: not governed, ≤3000 lines, no narrowing. The area lands it. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Landing by area o1-B · 2026-11-27T02:00Z · head
State: ready + auto-merge now; #37664 closes on merge via |
Requested by Elon · project thread
Fixes #37664
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/app-shell/src/views/recordSectionAnchor.ts(page side only; the anchor and the outline wire shape are untouched,packages/specis not in the diff).The card's comparison-form choice: derive the page's reading of each listed heading from the same parse the field draws with, rather than normalising the source text.
drawnMarkdownHeadings, loaded throughloadSectionHeadingReader) that starts at the same offset, and its drawn text is read. So[Data](url) scopereadsdatascope(wasdatahttps...scope) andData © 2026reads as drawn. A listed heading with no drawn counterpart keeps its source reading (the existing "listed but not drawn" rule then opens the field, as before).Café ©matches its drawn text; the outline decodes only six entities.reading,ordinal,countandunlistedare all computed from those drawn readings in one place (candidateOf); a markdown candidate counted before the parse loads is recounted in full once it has (it was only its unlisted count before). Before the load, a source reading of nothing still means a drawn reading of nothing (the parse adds no letter or digit), so the early field-only answer is unchanged.# [Scope](url)beside a cited## Scopewas counted as an unlisted same-titled heading (field opened); it now counts as listed and the cited heading opens.Tests
New top-level
describeinrecordSectionAnchor.test.tsx(the existing harness file for this module): bold, inline code, a link, an entity, an escape and a plain-text CONTROL each open their section on a markdown body; an html entity the outline leaves encoded opens its section, with a CONTROL on one it decodes; the link-titled listed heading counts as listed, with a setext CONTROL that still counts unlisted.Red-first on the base implementation (
579b8577's file restored, same tests): 4 failed / 43 passed: link, entity (markdown), html entity, link-counted-as-listed. Bold, inline code and escape already passed on main (the letters-and-digits reading neutralises them), so they stand as controls.Readings (head 93394e3)
vitest run recordSectionAnchor.test.tsx RecordDetailView.citedSection-37365.test.tsx: Test Files 2 passed (2), Tests 55 passed (55), lock VERDICT command-exit 0.pnpm --filter @object-ui/app-shell type-check(both tsc programs, the test one included): VERDICT command-exit 0.Acceptance notes
Verification
cd ui && npx vitest run packages/app-shell/src/views/recordSectionAnchor.test.tsx- expect 47 passed, including the sixobjectstack#37664markdown cases.Read first:
candidateOfinrecordSectionAnchor.ts(the reading/count change), thendrawnHtmlHeadings, then the new describe.Generated by Claude Code