Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
What is wrong
ADR 0050 moved StreamMark, Markdig and TextMate out of TKCode.Arc so that apps which do not render Markdown or highlight code do not carry them. TKCode.Arc.Blocks and TKCode.Arc.Special bring them back for everyone:
- Both reference
TKCode.Arc.MarkdownandTKCode.Arc.Highlighting(TKCode.Arc.Blocks.csproj:15-16,TKCode.Arc.Special.csproj:15-16). UseArcBlocks()andUseArcSpecial()depend onUseArcControls().UseArcMarkdown().UseArcHighlighting()(BlocksBuilderExtensions.cs:14,SpecialBuilderExtensions.cs:14).
So an app that uses one block, or one Special component, gets all three libraries. What actually needs them:
- Special: four of its components, and only to colour code: AskYourData, CodeSuggestion, DesignToCode and InstallSnippet use
new MarkdownHighlightPlugin().Highlighter(StreamMark'sISyntaxHighlighter), e.g.Ai/CodeSuggestion/CodeSuggestionHighlighter.cs:16. No Special component renders Markdown. - Blocks: the AI chat and answer blocks (through
Blocks/Ai/_Shared: AiReplyText, ArenaAnswerView, AiAnswerDocument;Ai/AiChat) and the support blocks (Support/SupportWidget,Screens/InboxSupport/HelpCenter,Screens/InboxSupport/SupportConversation). - Highlighting: neither package uses one of its types; the project reference exists only for
UseArcHighlighting()inDependsOn.
Also:
Blocks/Ai/_Shared/AiAnswerDocument/AiAnswerMarkdown.cs(1319 lines) is a separate Markdown-subset parser, next toTKCode.Arc.Markdown.- Blocks references
TKCode.Arc.Audiofor one block (Media/MediaPlayer). Audio has no dependencies of its own, so this one is cheap and can stay.
Proposal
- Code highlighting without Markdown (1.x).
- Make the highlighting hook in
TKCode.Arcpublic. TodayICodeSyntaxHighlighterandCodeBlockHighlighter(Tables/CodeBlock/CodeBlockSyntax.cs:35,61) are internal. Alternatively, have the four Special components useCodeBlock. - Special then drops the Markdown reference. Highlighting becomes optional: code is plain until the app calls
UseArcHighlighting(), as it already is forCodeBlock.
- Make the highlighting hook in
- Markdown-dependent blocks in their own package (needs decision, 2.0).
- Move the blocks above into a package such as
TKCode.Arc.Blocks.Ai. Blocks then drops Markdown and Highlighting. - Moving public types to another assembly is breaking here: Blocks cannot type-forward to a package that depends on it. So this waits for 2.0, unless we decide otherwise.
- Move the blocks above into a package such as
- Migration note. Apps that relied on
UseArcSpecial()/UseArcBlocks()to enable Markdown or Highlighting must call those themselves. This goes in the CHANGELOG. - Pin allowed references. Add an architecture test that lists each package's allowed
ProjectReferences, so a new one is a deliberate change.
How to check it
- An app that only calls
UseArcSpecial()has no StreamMark, Markdig or TextMate assembly in its publish output (after step 1). The same holds forUseArcBlocks()after step 2. - The four Special components highlight code when
UseArcHighlighting()is enabled and show plain code otherwise.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
docs(Special): colored code in AskYourData, CodeSuggestion, DesignToC…
239573049 commentedon Nov 17, 2026
Done in 1036b9c (#159).
TKCode.Arc.Specialno longer referencesTKCode.Arc.MarkdownorTKCode.Arc.Highlighting. AskYourData, CodeSuggestion, DesignToCode and InstallSnippet color code through a new internalCodeTokens.CodeTokenHighlighterinTKCode.Arc, which uses CodeBlock's roles and colors.TKCode.Arc.Blocksno longer referencesTKCode.Arc.Highlighting. It keeps Markdown, which the AI and support blocks render.UseArcSpecial()/UseArcBlocks()no longer enable highlighting. CallUseArcHighlighting()to keep colored code. The four Special docs pages say so (Docs for TKCode.Arc 1.2 architecture work: test links, customization line, Special and Mobile notes ArcGallery#12).PackageReferenceTestspins everysrcproject's project and package references.AiAnswerMarkdown.