From 7673e3a13517755de62af9bec9274bd67f6ee84a Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 19 Nov 2026 23:35:31 +1100 Subject: [PATCH] feat(ui/chat): render Markdown with remark and rehype; remove the React reference Chat replies, approvals, plans and agent transcripts now parse GitHub flavoured Markdown with unified (remark-parse, remark-gfm, remark-rehype) and render the HTML tree as Vue nodes. Raw HTML is dropped, links and images keep only safe URLs, and #N task references stay linked. The Astryx React prototype, its dependencies, scripts, theme file and agent notes are removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ui/AGENTS.md | 32 - ui/astryx-reference/AreaPage.tsx | 77 - ui/astryx-reference/DockedComposer.tsx | 258 --- ui/astryx-reference/ShellFrame.tsx | 235 --- ui/astryx-reference/index.html | 12 - ui/astryx-reference/main.tsx | 152 -- .../pages/ConversationPage.tsx | 422 ----- ui/astryx-reference/pages/LandingPage.tsx | 89 - ui/astryx-reference/pages/RunsPage.tsx | 586 ------- ui/astryx-reference/theme.ts | 39 - ui/astryx-reference/tsconfig.json | 14 - ui/astryx-reference/vite.config.ts | 12 - ui/package.json | 17 +- ui/pnpm-lock.yaml | 1559 ++++++----------- ui/pnpm-workspace.yaml | 2 - ui/src/astryx-themes.ts | 15 - ui/src/chat/ChatInline.vue | 37 - ui/src/chat/ChatMarkdown.vue | 148 +- ui/src/chat/markdown.ts | 250 +-- ui/test/chat-markdown.test.ts | 36 + ui/tsconfig.app.json | 2 +- 21 files changed, 679 insertions(+), 3315 deletions(-) delete mode 100644 ui/astryx-reference/AreaPage.tsx delete mode 100644 ui/astryx-reference/DockedComposer.tsx delete mode 100644 ui/astryx-reference/ShellFrame.tsx delete mode 100644 ui/astryx-reference/index.html delete mode 100644 ui/astryx-reference/main.tsx delete mode 100644 ui/astryx-reference/pages/ConversationPage.tsx delete mode 100644 ui/astryx-reference/pages/LandingPage.tsx delete mode 100644 ui/astryx-reference/pages/RunsPage.tsx delete mode 100644 ui/astryx-reference/theme.ts delete mode 100644 ui/astryx-reference/tsconfig.json delete mode 100644 ui/astryx-reference/vite.config.ts delete mode 100644 ui/src/astryx-themes.ts delete mode 100644 ui/src/chat/ChatInline.vue create mode 100644 ui/test/chat-markdown.test.ts diff --git a/ui/AGENTS.md b/ui/AGENTS.md index 43e6418e6..79d7d44bb 100644 --- a/ui/AGENTS.md +++ b/ui/AGENTS.md @@ -145,35 +145,3 @@ pnpm audit # after dependency changes - Delegate to pi workers when asked, and verify their output. Check for overlap before merging, rerun their checks on the combined result, and fix what they find. - - -Astryx v0.7.16 · 174 components -CLI: run every command as `pnpm exec astryx ` (shown below as `astryx ...`). - -SETUP (once, in app entry e.g. main.tsx) — without these, components render unstyled: - import "@astryxdesign/core/reset.css"; - import "@astryxdesign/core/astryx.css"; - -WORKFLOW — start every page from a template, never from scratch: -1. `astryx build ""` — names the template to scaffold from and the parts it lacks. -2. `astryx template ` — scaffold it; keep its frame, gap and padding; replace the content. -3. `astryx template ` for parts it lacks; `astryx component ` to read props before using one. -Changing an existing page? Keep it: skip step 2 and add blocks/components inside its sections. -Before you deliver a build, run `astryx doctor --built `; don't deliver it if it fails. - -RULES: -- No
— components handle all layout and spacing. -- Read `astryx docs layout` before changing a template's frame. -- Dense data = rows (Table, List/Item), not Card-wrapped lists. Badge = counts only. -- Style with component props first, then Tailwind utilities backed by tokens. No raw hex/px. -- THEMES: palettes and custom colors go through the theme, never :root overrides. To make or change a theme (colors, fonts, corners, spacing, a look from a picture), prefer the experimental theme editor over hand-written theme files: `astryx experimental theme editor new --like neutral`, then `editor set ` or `editor how ""`; wire it with `astryx theme add `; after each change look at it with `astryx experimental theme editor show --png` and open the PNGs it writes (changes nothing in the app); a theme change is not done until you have looked at the pictures. In code, extend an imported theme to customize it; `theme eject ` only forks source. See `astryx docs theme`. -- SELF-CHECK: re-read the file; replace any style={{…}}, raw
/, imported .css/@apply, or hardcoded/arbitrary value (bg-[#fff], p-[13px]) with the component or a token-backed utility. - -`astryx help` lists every command. Key ones beyond the workflow: - search "" find any component / hook / doc / template - discover integrations you could add - docs getting-started, principles, tokens, theme … (`astryx docs` lists all) - docs cli commands and API reference - docs authoring build an integration package, and every field it holds - upgrade --from --apply run after a dependency bump - diff --git a/ui/astryx-reference/AreaPage.tsx b/ui/astryx-reference/AreaPage.tsx deleted file mode 100644 index e7754ee69..000000000 --- a/ui/astryx-reference/AreaPage.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { Button } from "@astryxdesign/core/Button"; -import { Heading } from "@astryxdesign/core/Heading"; -import { Layout, LayoutContent, LayoutHeader } from "@astryxdesign/core/Layout"; -import { Section } from "@astryxdesign/core/Section"; -import { HStack, VStack } from "@astryxdesign/core/Stack"; -import { Text } from "@astryxdesign/core/Text"; -import type { Area } from "./ShellFrame"; - -type AreaPageProps = { - area: Exclude; - onOpenRun: () => void; -}; - -const copy = { - Events: { - heading: "What Archie heard", - subheading: "Incoming evidence and the work it started.", - title: "Checkout timeout rate exceeded 5%", - eyebrow: "Monitoring · 09:38 UTC", - body: "Checkout timeouts rose after the latest release. Archie authenticated the event, bound it to the production checkout target, and started an investigation run.", - action: "Open investigation", - }, - Governance: { - heading: "Governance", - subheading: "Policies, autonomy levels and action limits.", - title: "Production rollback requires approval", - eyebrow: "Production · Checkout · Rollback", - body: "The current autonomy level permits read-only investigation. The rollback is reversible, but it changes production. Hard rules and the Timing guard therefore require an operator decision.", - action: "Review decision", - }, - Reports: { - heading: "What Archie delivered", - subheading: "Outcomes, evidence and the remaining work.", - title: "Checkout investigation delivered", - eyebrow: "Operations · Waiting on approval", - body: "The investigation and evidence are in Operations. No production change has been made. The underlying release defect remains to be confirmed.", - action: "Open decision trail", - }, -} as const; - -export function AreaPage({ area, onOpenRun }: AreaPageProps) { - const content = copy[area]; - - return ( - - - {content.heading} - {content.subheading} - - - } - content={ - -
- - - - {content.eyebrow} - - - {content.title} - {content.body} - -
-
- } - /> - ); -} diff --git a/ui/astryx-reference/DockedComposer.tsx b/ui/astryx-reference/DockedComposer.tsx deleted file mode 100644 index 339c1b30a..000000000 --- a/ui/astryx-reference/DockedComposer.tsx +++ /dev/null @@ -1,258 +0,0 @@ -import { useLocalStorage, useWindowSize } from "@uidotdev/usehooks"; -import { Avatar } from "@astryxdesign/core/Avatar"; -import { BottomSheet } from "@astryxdesign/core/BottomSheet"; -import { Button } from "@astryxdesign/core/Button"; -import { - ChatComposer, - ChatLayout, - ChatMessage, - ChatMessageBubble, - ChatMessageList, -} from "@astryxdesign/core/Chat"; -import { Heading } from "@astryxdesign/core/Heading"; -import { useMediaQuery } from "@astryxdesign/core/hooks"; -import { Icon } from "@astryxdesign/core/Icon"; -import { IconButton } from "@astryxdesign/core/IconButton"; -import { Popover } from "@astryxdesign/core/Popover"; -import { HStack, StackItem, VStack } from "@astryxdesign/core/Stack"; -import { Text } from "@astryxdesign/core/Text"; -import { Toolbar } from "@astryxdesign/core/Toolbar"; -import mark from "../../assets/brand/archie-mark.svg?url"; - -export type DockedMessage = { - id: string; - sender: "user" | "assistant"; - text: string; -}; - -type DockedComposerProps = { - context: string; - messages: DockedMessage[]; - draft: string; - onDraftChange: (value: string) => void; - onSubmit: (value: string) => void; - onOpenConversation: () => void; -}; - -const suggestedPrompts = [ - "Why does this need approval?", - "What is the risk?", - "What happens if I decline?", -] as const; - -export function DockedComposer({ - context, - messages, - draft, - onDraftChange, - onSubmit, - onOpenConversation, -}: DockedComposerProps) { - const isNarrow = useMediaQuery("(max-width: 48rem)"); - const [isConversationOpen, setIsConversationOpen] = useLocalStorage( - "archie.astryx-reference.chat-open", - messages.length > 0, - ); - const { height: viewportHeight } = useWindowSize(); - const conversationHeight = Math.max( - 280, - Math.min(560, (viewportHeight ?? 656) - 96), - ); - - function submit(value: string) { - setIsConversationOpen(true); - onSubmit(value); - } - - const composer = ( - - ); - - const conversation = ( - - - - - Archie - - {context} - - - - } - endContent={ - -