Files
archie/ui/src/base/CodeView.vue
T
sam 94f79177a2
deploy / gate (push) Successful in 4m53s
Quality / check (push) Successful in 6m42s
deploy / archied-image (push) Successful in 3m20s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
fix(ui): adopt the type scale across components/ui and pages (#1758)
components/ui and the pages now use only the style.css scale:
text-[0.8rem]→text-label, text-[0.625rem]→text-micro, text-base/text-sm→
text-label (rows and controls), text-xs→text-caption (captions and
secondary text), text-lg/text-xl/text-2xl→text-title (panel and page
titles). Rendered markdown (ChatMarkdown/ChatInline/markdown.ts) keeps
Tailwind steps as the issue allows. 196 files, class-token swaps only.
2026-11-06 23:07:46 +11:00

39 lines
1.1 KiB
Vue

<script setup lang="ts">
import { cn } from "@/lib/utils";
import {
CodeBlock,
CodeBlockActions,
CodeBlockContent,
CodeBlockCopyButton,
CodeBlockLine,
CodeBlockToken,
useHighlightedCode,
} from "@/components/ui/code-block";
/**
* Code or a payload with a copy button that appears on hover or focus. The
* text is shown verbatim and wrapped: stored payloads are mostly long unbroken
* tokens (URLs, hashes, base64), which must not push the panel past its edge.
* A language the highlighter does not know renders plain.
*/
const props = defineProps<{ code: string; lang?: string; class?: string }>();
const lines = useHighlightedCode(
() => props.code,
() => props.lang || "text",
);
</script>
<template>
<CodeBlock :class="cn('bg-muted', props.class)">
<CodeBlockActions>
<CodeBlockCopyButton :value="code" />
</CodeBlockActions>
<CodeBlockContent wrap class="max-h-[60vh] pe-10 text-caption">
<CodeBlockLine v-for="(line, index) in lines" :key="index">
<CodeBlockToken v-for="(token, i) in line" :key="i" :token="token" />
</CodeBlockLine>
</CodeBlockContent>
</CodeBlock>
</template>