Repository navigation
feat(macos): render native visualization blocks in chat - #2098
Merged
Merged
Conversation
10 tasks
Assistant replies draw rustcode-viz fences as SwiftUI widgets with the TUI's schema, limits and fallback: a Swift Charts bar chart with hover values, a table with sortable headers, and a collapsible tree. Streaming blocks show a placeholder; invalid or unfinished ones show their source. The app advertises _meta.rustcode.visualizations in its ACP initialize so the engine sends the prompt guidance.
LHagfoss
force-pushed
the
feat/macos-native-visualizations
branch
from
October 16, 2026 21:56
42fc594 to
3a03e16
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.
Closes #2097. Part of #2088. Stacked on #2094; the base is
feat/tui-native-visualizations.Summary
RustCodeKit/Visualization.swiftparsesrustcode-vizpayloads with the TUI's version 1 schema, limits and fallback reasons:…;MarkdownBlock.parse(_:visualizations:)produces.visualizationblocks only when asked to. The block keeps its full source fence, and its state is rendered, invalid (with a reason) or incomplete.RustCode/VisualizationView.swiftdraws the widgets in SwiftUI:bar_chartuses Swift Charts. Hovering a bar highlights it and shows its exact value, and every bar carries a value label.tableheaders sort it (ascending, then descending). Numeric columns sort by value and align right.sort_bysets the initial order, and the sort covers every row while at most 50 are shown.treebranches collapse and expand. The first two levels start open.AssistantMessagepassesvisualizations: true). Command output, user messages and tool output keep the fence as code. Nothing in a payload is executed.initializerequest advertisesclientCapabilities._meta.rustcode.visualizations = 1, so the engine (since feat(tui): render native visualization blocks in chat #2094) adds the prompt guidance for this app.docs/visualizations.mdgains a macOS section and a row for the app in the frontend table.Verification
swift build --package-path macosswift test --package-path macos: 57 tests, 0 failures, 11 of them new. They cover parsing, every fallback reason, the payload, item, row, column, node and depth limits, text truncation, control characters, table sorting, tree ids, partial fences, unchanged ordinary fences and tables, and the initialize capability.The widgets have not been checked by eye in a running app yet. Layout, hover and sorting are covered only by the build, so they need a manual look before merging.