Skip to content

fix(chat): keep find stable across footnotes and pending chats, and match mention chips next to punctuation - #8361

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/chat-find-and-mention-edges
Sep 28, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/chat-find-and-mention-edges

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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 forwards data-footnote-ref so the marker can be excluded
  • Mention chips:
    • slash_command contexts 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-2 still doesn't match @Workflow
    • overlapping matches resolve to the longest chip (@report vs @report.pdf, Workflow vs Workflow 2)
  • The @/blocks/integration-matcher test mock moves to one central @sim/testing mock used by all four suites
  • Responds to review threads on v0.9.4: db contention fixes, databricks genie, snowflake cortex, additional search connectors #8356

Type of Change

  • Bug fix

Testing

  • use-chat-find.test.tsx renders real ChatContent markup: 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 reverted
  • utils.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:audits pass

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)

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 28, 2026 1:29am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adjusts chat search and mention matching logic.

The PR appears safe to merge; no new actionable issue was identified in the changes since the previous review.

Summary

The PR keeps chat find open when a pending conversation receives its persisted ID, aligns footnote search results with rendered text, and improves mention-chip matching around punctuation and overlapping names. It also centralizes the integration matcher test mock and adds regression tests.

Reviews (2) · Last reviewed commit: "fix(chat): only treat a period as a ment..."

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 635d275 into staging Sep 28, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/chat-find-and-mention-edges branch September 28, 2026 02:06

This branch was previously deployed

1 inactive deployment
Preview — f884d831 Deployed Sep 28, 2026 by vercel[bot]
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