Skip to content

feat: add GFM streaming support for tables and block math#270

Merged
hryhoriiK97 merged 12 commits intomainfrom
feat/ios-gfm-streaming-segments
Apr 28, 2026
Merged

feat: add GFM streaming support for tables and block math#270
hryhoriiK97 merged 12 commits intomainfrom
feat/ios-gfm-streaming-segments

Conversation

@hryhoriiK97
Copy link
Copy Markdown
Collaborator

@hryhoriiK97 hryhoriiK97 commented Apr 25, 2026

What/Why?

Fixes: #241

Adds iOS support for smoother streamingAnimation with GitHub-flavored markdown tables and block LaTeX.

Previously, GFM block views could be recreated repeatedly while markdown was streaming, causing visible jank and extra UI thread work. This PR splits parsed GFM content into native-renderable segments: text, table, and block math. Each segment gets a deterministic content signature, so iOS can reconcile new renders against existing native views instead of rebuilding completed blocks.

During reconciliation:

  • unchanged segments reuse their existing native views,
  • shifted unchanged segments can still be reused by signature,
  • changed segments of the same kind update in place,
  • new or different segment kinds create new views,
  • unused old views are removed.

When streamingAnimation is active, incomplete trailing tables and block math are hidden until their markdown is complete. This avoids repeatedly rendering expensive partially parsed block views while text continues to stream normally.

The PR also adjusts iOS measurement/layout for streaming GFM so height updates track rendered content more reliably, including newly completed block segments, and keeps table interactions working when layout catches up.

Static GFM behavior remains unchanged.

Testing

Screenshots

Nagranie.z.ekranu.2026-04-25.o.16.01.37.mov
Screen.Recording.2026-04-28.at.13.06.34.mov

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes

@hryhoriiK97 hryhoriiK97 changed the title feat(ios): improve GFM streaming for tables and math feat(ios): add GFM streaming support for tables and math Apr 26, 2026
@hryhoriiK97 hryhoriiK97 changed the title feat(ios): add GFM streaming support for tables and math feat(ios): add GFM streaming support for tables and block math Apr 26, 2026
)

* feat(android): add GFM streaming support for tables and block math

* feat(android): implement table streaming mode for GFM support in EnrichedMarkdown

* refactor(ios): streamline line offset calculations in StreamingMarkdownFilter
@hryhoriiK97 hryhoriiK97 changed the title feat(ios): add GFM streaming support for tables and block math feat: add GFM streaming support for tables and block math Apr 28, 2026
@hryhoriiK97 hryhoriiK97 marked this pull request as ready for review April 28, 2026 10:53
@hryhoriiK97 hryhoriiK97 merged commit 98d17a4 into main Apr 28, 2026
5 checks passed
@hryhoriiK97 hryhoriiK97 deleted the feat/ios-gfm-streaming-segments branch April 28, 2026 11:26
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.

Feature Request: Support Streaming Animation for GFM

1 participant