Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(mobile): parse markdown `---` as horizontal rule, dedupe block keys

4 months ago

d290f28
Authored
mweinbach5/25/2026, 10:25:26 PM
Multiple `---` separators in an assistant message all collided on the
React key `paragraph:---` because the block list keyed by truncated
content. The same applied to any repeated short paragraph. The result
was a flood of "Encountered two children with the same key" warnings
from MarkdownText.

Recognize `---`, `***`, and `___` (3+ chars, optional spaces) on their
own line as horizontal-rule blocks and render them as a thin separator,
matching how every other markdown renderer treats them.

Key the blocks loop by index so any future content collision can't
duplicate keys.

Move the pure parsing logic into markdownParser.ts so it can be
exercised by bun tests without dragging React Native imports through
the test runner. The view module re-exports the parser surface for any
existing imports.

Co-authored-by: Cursor <cursoragent@cursor.com>

Parent14b7e0a

3 files changed
  • apps/mobile/src/components/thread/markdown-text.tsx+30−152
  • apps/mobile/src/components/thread/markdownParser.ts+156−0
  • test/mobile.markdown-text.test.ts+86−0