Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
docs(markdown): record the GfsMarkdownPreview renderer exception
Mfd74a1e83901
diff --git a/control-ui/components/GfsMarkdownPreview/index.tsx b/control-ui/components/GfsMarkdownPreview/index.tsxindex 7b2d6b923..d55fc4419 100644--- a/control-ui/components/GfsMarkdownPreview/index.tsx+++ b/control-ui/components/GfsMarkdownPreview/index.tsx@@ -1,5 +1,15 @@'use client'+// Renderer exception recorded in docs/agents/frontend-style-rules.md+// ("Markdown rendering and editing"): this read-only GFS markdown preview uses+// ReactMarkdown + remark-gfm instead of the standard @uiw/react-md-editor+// because the preview must render GFM tables inside a labelled, keyboard-+// focusable scrollable table region (here through the shared+// TableViewport/DataTable primitives), which `MDEditor.Markdown` cannot+// preserve without regressing that behavior. Guarantees: no rehype-raw, so raw+// HTML stays inert; urlTransform restricts `src` to https:/data:image URIs and+// link hrefs to http(s):/mailto:/# fragments; code blocks render as plain+// `pre` > `code`. Covered by components/__tests__/GfsMarkdownPreview.test.tsx.import { useEffect, useId, useRef, useState } from 'react'import { createPortal } from 'react-dom'import ReactMarkdown from 'react-markdown'diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 192a9a25e..403d31806 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 4c86f4438..32113f6cd 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.654",+ "version": "0.1.655","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/ui/src/components/GfsMarkdownPreview/Body.tsx b/desktop-app/ui/src/components/GfsMarkdownPreview/Body.tsxindex f53c44fc7..785f4bfb9 100644--- a/desktop-app/ui/src/components/GfsMarkdownPreview/Body.tsx+++ b/desktop-app/ui/src/components/GfsMarkdownPreview/Body.tsx@@ -1,3 +1,12 @@+// Renderer exception recorded in docs/agents/frontend-style-rules.md+// ("Markdown rendering and editing"): this read-only GFS markdown preview uses+// ReactMarkdown + remark-gfm instead of the standard @uiw/react-md-editor+// because the preview must render GFM tables inside a labelled, keyboard-+// focusable scrollable table region, which `MDEditor.Markdown` cannot preserve+// without regressing that behavior. Guarantees: no rehype-raw, so raw HTML+// stays inert; urlTransform restricts `src` to https:/data:image URIs and link+// hrefs to http(s):/mailto:/# fragments; code blocks render as plain `pre` >+// `code`. Covered by the GfsMarkdownPreview and GfsMarkdownPreviewBody suites.import { useEffect, useId, useRef, useState } from 'react'import ReactMarkdown from 'react-markdown'import type { Components } from 'react-markdown'diff --git a/docs/agents/frontend-style-rules.md b/docs/agents/frontend-style-rules.mdindex 1cbafbfcc..bb4531ef0 100644--- a/docs/agents/frontend-style-rules.md+++ b/docs/agents/frontend-style-rules.md@@ -64,6 +64,19 @@ application guidance that must be combined with this shared document.context, and cover that behavior with tests. Do not extend an exception toordinary document preview or editing surfaces.+Recorded exception — GFS file previews. `GfsMarkdownPreview` in Control UI+(`control-ui/components/GfsMarkdownPreview`) and the Desktop renderer+(`desktop-app/ui/src/components/GfsMarkdownPreview/Body.tsx`) renders read-only+GFS Markdown/text file previews with ReactMarkdown + remark-gfm instead of+`@uiw/react-md-editor`. The concrete limitation: the previews must render GFM+tables inside a labelled, keyboard-focusable scrollable table region, which+`MDEditor.Markdown` cannot preserve without regressing that behavior.+Guarantees: no rehype-raw, so raw HTML stays inert; `urlTransform` restricts+image `src` to `https:`/inline `data:image` URIs and link hrefs to+`http(s):`/`mailto:`/`#` fragments; code blocks render as plain `pre` > `code`.+The behavior is covered by the GfsMarkdownPreview test suites in both+applications. This exception is scoped to these preview components only.+## Types, constants, and imports- Do not declare exported or reusable `type` or `interface` definitions inside