Build App / compute-version (push) Successful in 7s
Secret Scan / scan (push) Successful in 8s
Build App / build-macos (push) Successful in 2m53s
Build App / build-linux (push) Successful in 5m12s
Build App / build-windows (push) Successful in 5m15s
Build App / create-tag (push) Successful in 3s
Build App / sync-to-github (push) Successful in 1m5s
Clicking a file path in Claude's terminal output now opens the file in its own window with a CodeMirror 6 editor. The editor highlights the target line, live-reloads while the file changes, and saves explicitly with hash-based conflict detection. The viewer commands are gated by window label. Every app command is now ACL-gated per window through a Tauri AppManifest. build.rs checks the handler list against the capability files and fails the build on any mismatch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
43 lines
2.6 KiB
TypeScript
43 lines
2.6 KiB
TypeScript
import { EditorView } from "@codemirror/view";
|
|
import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
import { tags as t } from "@lezer/highlight";
|
|
import type { Extension } from "@codemirror/state";
|
|
|
|
// Syntax colours come from the `--syntax-*` tokens in index.css (P12), not
|
|
// hard-coded hex, even though the values match the GitHub-dark ANSI palette
|
|
// TerminalView.tsx already uses.
|
|
export const viewerTheme: Extension = [
|
|
EditorView.theme(
|
|
{
|
|
"&": { backgroundColor: "var(--bg-primary)", color: "var(--text-primary)", height: "100%", fontSize: "13px" },
|
|
".cm-content": { fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, Monaco, monospace", caretColor: "var(--accent)" },
|
|
".cm-scroller": { overflow: "auto" },
|
|
".cm-gutters": { backgroundColor: "var(--bg-secondary)", color: "var(--text-secondary)", borderRight: "1px solid var(--border-color)" },
|
|
".cm-activeLine": { backgroundColor: "var(--accent-muted)" },
|
|
".cm-activeLineGutter": { backgroundColor: "var(--accent-muted)" },
|
|
".cm-triple-c-target": { backgroundColor: "var(--warning-muted)", outline: "1px solid var(--warning)" },
|
|
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { backgroundColor: "var(--accent-muted)" },
|
|
".cm-panels": { backgroundColor: "var(--bg-secondary)", color: "var(--text-primary)", borderBottom: "1px solid var(--border-color)" },
|
|
".cm-searchMatch": { backgroundColor: "var(--warning-muted)", outline: "1px solid var(--warning)" },
|
|
".cm-searchMatch.cm-searchMatch-selected": { backgroundColor: "var(--success-muted)" },
|
|
},
|
|
{ dark: true },
|
|
),
|
|
syntaxHighlighting(
|
|
HighlightStyle.define([
|
|
{ tag: [t.keyword, t.modifier, t.operatorKeyword], color: "var(--syntax-keyword)" },
|
|
{ tag: [t.string, t.special(t.string)], color: "var(--syntax-string)" },
|
|
{ tag: [t.comment, t.lineComment, t.blockComment], color: "var(--text-secondary)", fontStyle: "italic" },
|
|
{ tag: [t.number, t.bool, t.null, t.atom], color: "var(--syntax-number)" },
|
|
{ tag: [t.function(t.variableName), t.function(t.propertyName)], color: "var(--syntax-function)" },
|
|
{ tag: [t.typeName, t.className, t.namespace], color: "var(--syntax-type)" },
|
|
{ tag: [t.propertyName, t.attributeName], color: "var(--syntax-property)" },
|
|
{ tag: t.heading, fontWeight: "bold", color: "var(--accent)" },
|
|
{ tag: t.emphasis, fontStyle: "italic" },
|
|
{ tag: t.strong, fontWeight: "bold" },
|
|
{ tag: t.link, color: "var(--accent)", textDecoration: "underline" },
|
|
{ tag: t.invalid, color: "var(--syntax-keyword)", textDecoration: "underline wavy" },
|
|
]),
|
|
),
|
|
];
|