Repository navigation
fix(app-shell): cited-section locator tells an unlisted same-titled heading from an undrawn one, and opens a heading that reads as nothing at once - #37646
Conversation
…eading from an undrawn one, and opens a heading that reads as nothing at once Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head c41e276 · 2026-11-26T18:18Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Read: card #37562 (body, triage, claim, os-dev-report), PR #37646 (body, 3 files), the net diff ① Derived judgments
Findings:
Seat questions:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
… the field's own parse Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
…r loads; changesets for the parse-based count Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
…arkdown chunk stays lazy Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Delta review over the earlier record on What I read:
Every check-run on the new head has concluded, with none failed. The ① Derived judgments
Prior findings:
New findings:
Coordinator's checks:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对 (delta)Head-sha:
|
K was 28 >= 15 and main moved ui/packages/i18n/src/locales/en.ts (eager-closure budget input) since PRBASE. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
|
repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc Landing: ACCEPT 7201860982 (delta contract record 7201851923, PASS) at head
Status: ready + auto-merge (merge queue). On MERGED, #37562 closes by |
Fixes #37562
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Governing text: scope note 7190147175 on #37487 (N6, N7); seat REWORK 7200445298 on this PR (S1 route ruling, N1, N3) over contract record 7200419777; claim amendment 7200539429 on #37562 (surface widened to
ui/packages/fields, option A of blocked report 7200523842).ui/packages/fields(additive):widgets/markdownHeadings.ts(new):MARKDOWN_REMARK_PLUGINS(remark-gfm) andMARKDOWN_REHYPE_PLUGINS(rehype-sanitize withRICH_TEXT_SANITIZE_SCHEMA) are declared here once.drawnMarkdownHeadings(value)runs react-markdown with those lists (called as a function, it holds no hooks), reads the tree after the last rehype plugin, and returns each drawn h1-h6 as{ text, start }.startis the heading's source offset, and it is undefined for the footnote section'sFootnoteslabel, which the pipeline adds.widgets/MarkdownContent.tsx: draws with those same constants and re-exports them withdrawnMarkdownHeadings. Behaviour is unchanged: the same plugin lists, now identity-stable.index.tsx:loadDrawnMarkdownHeadings()loads the reader throughMarkdownContent.js, the module the face already loads on demand. It also exports theDrawnMarkdownHeadingtype.markdownHeadingsfrom the index directly. That madeMarkdownContentboth statically and dynamically imported, andBuild & E2E UIcaught it as an INEFFECTIVE_DYNAMIC_IMPORT on head 6ef69f4.ui/packages/app-shell/src/views/recordSectionAnchor.ts:unlisted= drawn headings of the cited reading whosestartis not the start of a listed heading of that reading. So it counts what the face draws by construction:Footnoteslabel.loadSectionHeadingReader, once; a failed load is retried on the next call). A markdown candidate counted before the load hasunlisted: undefined, and its count is not trusted.focusRecordSectionloads the reader, re-counts and tries again. Until then, no heading is marked.unlisted > 0returnsfieldOnlyinlocateSection's first condition (one line). The field is then scrolled to as soon as it is drawn, not after the 4 s settle.counted = unlisted === 0 && drawn.length === count, and an empty reading isfieldOnly.mayScrollis unchanged; every scroll still goes through it.RecordDetailView.citedSection-37365.test.tsx: one comment updated (the setext case now scrolls at once). No assertion changed.Tests
fields/src/__tests__/markdownHeadings-37562.test.tsx(new). Every shape is pinned twice: against the reader and against the face's own DOM (MarkdownContentrendered).Footnotesh2; ATX behind a quote or a list marker.startoffsets, theFootnoteslabel's undefinedstart, and that the index loader resolves the same function.app-shell/src/views/recordSectionAnchor.test.tsx:unlisted: 1, plus theFootnoteslabel against a citedFootnotes(CONTROL: no footnote, 0).scripts/ablation-replace.mjs, anchorreturn readDrawnMarkdown(value).filter(->return 0 * readDrawnMarkdown(value).filter(, blob c5fa5fb7134b -> f483a359da34). Result: Tests 14 failed | 25 passed, red on the N6 pair case, the old setext case, all ten S1 rows, theFootnotesrow and N3; the N1 rows stay green as expected. Restored: blob == HEAD andgit diff HEADempty.fieldOnly): see the first round, unchanged code paths.Acceptance notes
MarkdownContent.tsxgains two react-refreshonly-export-componentswarnings for the re-exported constants (warn level; the index already carries many).Verification
Two-minute check:
cd ui && pnpm exec vitest run packages/fields/src/__tests__/markdownHeadings-37562.test.tsx packages/app-shell/src/views/recordSectionAnchor.test.tsx. Expect all passed.Read first, in order:
fields/src/widgets/markdownHeadings.ts(the risk: a tree read that differs from what is drawn).recordSectionAnchor.tsunlistedMarkdownCount/withUnlistedCountand the load path infocusRecordSection.fields/src/index.tsxloadDrawnMarkdownHeadings(lazy-chunk shape).Readings, head c3f7728 (tree objectstack-ai/objectstack)
vitest runrecordSectionAnchor.test.tsx + RecordDetailView.citedSection-37365.test.tsx + markdownHeadings-37562.test.tsx + markdownCellHeading-36344.test.tsx: Test Files 4 passed (4), Tests 69 passed (69); lock VERDICT command-exit 0.@object-ui/fieldssuite (taken at 6ef69f4; the head commit after it moves the plugin lists between two fields modules, and the four files above were rerun on it): Test Files 333 passed | 1 skipped (334), Tests 5085 passed | 7 skipped; VERDICT command-exit 0.@object-ui/app-shellsuite: not run locally (2452 files, over an hour on the shared lock last round). CITest UIcovers it: every shard green on this head.type-checkof@object-ui/fieldsand@object-ui/app-shell(both programs each): VERDICT command-exit 0.vite build, local: ineffective-dynamic-import ledger: 40 ineffective dynamic imports, all pinned, none new. Eager closure 120/2610 chunks, 1992997 bytes gzipped. The same build on base b1c41e5 (fields and anchor sources restored from it) gives 120/2610 chunks, 1992700 bytes: +297 bytes, no new eager chunk.vendor-react-markdownis eager on both.pnpm check:eager-closure: 1946.3 KB of 2431.6 KB budget.dispatch-gates --commands: 39 derived (9 paths); 38 run on this head pluscheck:changeset-fixed, all exit 0.pnpm --dir ui exec vitest run scripts/(at 6ef69f4): 172 passed | 2 skipped.--ranverdict: 39 derived families accounted for, 39 run, 0 NOT-MEASURED.overlap-check --branch=HEAD: VERDICT clean exit 0.Generated by Claude Code