fix(chat): keep find stable across footnotes and pending chats, and match mention chips next to punctuation
Merged
WA
1mo ago+238+238+012345678901234567890123456789-17-17-01234567890123456789
Summary
- Chat find closed and cleared its query when a pending chat adopted its persisted id (undefined → id), although that's the same conversation. It now resets only when an existing scope changes
- Footnotes made the find index and the rendered DOM disagree on match counts and order: the index kept footnote definitions, while the DOM showed the marker, the moved definitions, a visually hidden heading, and back-links. Footnote definitions are now left out of the index, and
[data-footnote-ref]/[data-footnotes]are excluded from the DOM walk. The chat's link renderer now forwardsdata-footnote-refso the marker can be excluded - Mention chips:
slash_commandcontexts render with the/prefix- the token match accepts trailing punctuation via a lookahead, so
@Workflow,and back-to-back repeats (@A @A) now match, while@Workflow-2still doesn't match@Workflow - overlapping matches resolve to the longest chip (
@reportvs@report.pdf,WorkflowvsWorkflow 2)
- The
@/blocks/integration-matchertest mock moves to one central@sim/testingmock used by all four suites - Responds to review threads on #8356
Type of Change
- Bug fix
Testing
use-chat-find.test.tsxrenders realChatContentmarkup: find survives undefined → id but resets on a chat switch, and a footnoted message's match count equals its highlighted ranges. Each fails with its guard revertedutils.test.ts: punctuation, repeats, slash commands, the prefix boundary, and longest-overlap cases. The behavior cases fail on staging- Cleanup passes (effects, state, memo, callback, React Query, EMCN, URL state, comments, test audit) found nothing
- Home, chat, and composer suites (238 tests), type-check, lint, and
check:auditspass
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)