Repository navigation
feat(ai): render LaTeX through AIComponentBuilders.math - #47
Draft
VelikovPetar wants to merge 1 commit into
Draft
VelikovPetar wants to merge 1 commit into
VelikovPetar wants to merge 1 commit into
Conversation
VelikovPetar
marked this pull request as draft
October 30, 2026 13:23
AIMarkdownBody took a math engine only through its own mathBuilder, which nothing above StreamingMessageView passed on, so an AIConversationView's replies could not render LaTeX at all. AIComponentBuilders.math now renders it for any markdown body given no mathBuilder of its own, the same way code blocks and charts are customised. A body's own mathBuilder still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VelikovPetar
force-pushed
the
feat/conversation-view-math-and-highlighting
branch
from
October 30, 2026 13:25
4158c30 to
4e394a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
AIComponentBuilders.math, withAIMathProps(tex,style,inline). AnAIMarkdownBodywith nomathBuilderof its own now asks the nearestAIComponentFactoryto render its LaTeX. With neither, it still shows the TeX source, as before.Why
AIMarkdownBodyonly took a math engine through its ownmathBuilder, and nothing aboveStreamingMessageViewpassed one on. So anAIConversationView's replies couldn't render LaTeX without replacing the whole reply row. A builder fits how code blocks and charts are already customised (AIComponentBuilders.codeBlock,chart). It reaches every markdown body under the factory, with no new parameters threaded through the conversation, its rows or their props. Code highlighting needs nothing new:AIComponentBuilders.codeBlockalready covers it in a conversation.Notes
mathBuilderstill wins over the factory's.Testing
AIMarkdownBodyrenders inline and block LaTeX through the factory, and swapping the builders updates it.mathBuilderwins over the factory's.AIConversationViewrenders a reply's LaTeX throughAIComponentBuilders.math.copyWithandmergecarrymath.dart analyze --fatal-infosis clean.CI=true.🤖 Generated with Claude Code