Render Markdown in AI panels + ordered game-plan summaries - #74
Merged
Conversation
Two beta-test follow-ups:
1. AI replies are Markdown but the Explain/Summary panels printed them raw, so
operators saw literal **bold**, ### headings and - bullets. Add a tiny,
dependency-free, XSS-safe renderer (React nodes only — no
dangerouslySetInnerHTML, no anchors built from model output) for the subset
the model uses: headings, **bold**, *italic*, `code`, and bullet/numbered
lists. Wired into ExplainButton + SummarizeEngagementButton. Pure block
parser split into markdown-parse.ts with unit tests.
2. Summaries now produce an ordered GAME PLAN. Both the single-host and
cross-host summary prompts ask for a numbered, sequential list of moves
("do this first, then this, then pivot") with the target in bold, the
action, and a short why — plus a one-line best-first-move call-out. Renders
as a real ordered list via the new Markdown component.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDoCrduJx7h9Dv8XaTqrSr
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.
Summary
Two UX follow-ups from a fresh beta test of
v2.5.0-beta.17, both requested after seeing the AI panels in action.1. Render Markdown in AI panels
The co-pilot replies in Markdown, but the Explain and Summary panels printed it raw — operators saw literal
**bold**,### headings, and-bullets instead of formatting. Adds a tiny, dependency-free renderer (Markdown.tsx) for the subset the model actually uses: headings,**bold**,*italic*,`code`, and bullet / numbered lists.dangerouslySetInnerHTML, and links are deliberately not turned into anchors (no clickable surface from model output).ExplainButtonandSummarizeEngagementButton.markdown-parse.tswith unit tests (the.tsxisn't importable under the current vitest config).2. Ordered "game plan" summaries
Both the single-host and cross-host summary prompts now ask for a numbered, sequential game plan — the order of moves to work the target ("do this first, then this, then pivot"), each step naming the target service in bold, the concrete action, and a short why, ending with a one-line best-first-move call-out. With the new Markdown renderer these display as a real ordered list.
Testing
npm test→ 612 passing (addsmarkdown-parseunit tests).npm run typecheck,npm run lint:kb,npm run build— all clean.**/###remain in the panels.🤖 Generated with Claude Code