Repository navigation
feat(ui): every block package exports its componentInfo, and comark-ui/info collects them - #433
Conversation
…i/info collects them
Each package whose blocks a document writes exports componentInfo from a new
./info entry: kind, label, description, typed props, and named slots, keyed by
the name as written. componentInfo(options) in comark-ui/info collects them
for the plugins those options turn on, and each preset returns the map as
componentInfo. It's plain data, so ComarkEditor's components and ViteHub's
documents({ components }) take it.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
Important
The metadata-driven editor can remove chart target annotations and fail to preserve boolean settings. There are also gaps in chart-only metadata and the documented ViteHub insertion path.
Reviewed changes — Reviewed the package metadata entries, their published exports, preset collection/filtering, and the documented editor integrations.
- Package metadata: Added authored-component descriptions, prop types/defaults/options, and named slots through each package’s
/infoentry. - Preset collection: Added
comark-ui/info, root exports, and renderer-filteredcomponentInfoon preset results. - Editor integration: Documented direct consumption by
ComarkEditorand ViteHub’sdocuments({ components }). - Coverage: Added documented-name/schema tests and option/renderer filtering checks.
Validation: pnpm build, the workspace TypeScript check, and all 416 UI package tests passed, with one skipped. Targeted mounted-editor and parse/render reproductions demonstrated the issues below.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Merged deb2db8 directly: required checks passed and review threads were resolved. Final answersSession Merged deb2db8 directly: required checks passed and review threads were resolved. Ready: verified the expected HEAD, existing fixes, resolved review threads, and green hosted checks. All 19 focused tests passed; lint passed with four warnings. Direct installed binaries bypassed a local pnpm SQLite-store error. No remaining actionable findings or source changes. Session CI reconciliation completed; the same-head repair budget is exhausted. Session CI reconciliation completed; conflict preparation is waiting for host capacity: sample-error: The operation was aborted. Session CI reconciliation completed; conflict preparation is waiting for host capacity: sample-error: The operation was aborted. |
# Conflicts: # AGENTS.md # packages/ui/package.json # packages/ui/tsdown.config.ts
There was a problem hiding this comment.
✅ No new issues found; no P0 or P1 findings remain.
Reviewed changes — Reviewed deb2db8, the metadata-editing and insertion fixes added since the previous review.
- Preserved metadata-driven edits: Changed annotation values to plain-text fields and chart labels/code-group magic to explicit true/false selects with an automatic state.
- Shared annotation metadata: Exported the annotation definition from both charts and annotate, retaining chart-only HTML support without exposing unsupported controls in framework presets.
- Corrected insertion behavior: Removed image-only badge defaults and excluded include from the generic insertion map, with its syntax limitation documented.
- Added regression coverage: Exercised mounted editor edits through Markdown serialization and rendering, badge insertion defaults, and metadata filtering.
Validation passed: pnpm build including publint, the workspace TypeScript check, and 596 tests across the UI, charts, tabs, and badge packages, with one skipped. Additional checks against the built public entries confirmed the repaired annotation, flag, and filtering paths.
gpt-6.1-sol(xhigh) | 𝕏

An app that edits comark-ui documents has to describe every block itself before an editor can show it.
ComarkEditortakes acomponentsmap, and ViteHub'sdocuments({ components })takes the same shape for the Console's insert menu, but no package exports one. onmax.me writes its own forembed,carousel,compare,screenshot, andannotationinserver/content.ts, and Drop, Finance, and the others would each write theirs.This PR gives each package whose blocks a document writes a
componentInfoexport from a new./infoentry, such ascomark-embed/info. Each block gets itskind(blockorinline), alabel, a one-sentencedescription, typedprops(withdefaultandoptionswhere the docs give them), and namedslots, keyed by the name as written. It's plain data on one type inshared/component-info.ts, so a server can load it without the parse plugin.componentInfo(options)fromcomark-ui/infocollects them for the plugins those options turn on, so an app passes the same options it renders with:Each preset also returns the map as
componentInfo, without the blocks its renderer doesn't draw (annotate, comments, diff, and quiz in Vue). The editor guide has a section on it.packages/ui/test/info.test.tsparses every Markdown example in the packages' docs with Comark alone, so it sees the names an editor reads, and checks each component has an entry and each entry is a name the preset reads. With comark-embed's map left out of the collector, it fails onembed. It also checks the names are the lowercase tags ViteHub'sdocuments()accepts.Two calls I made:
::chart's notes shareannotationwith comark-annotate, so that entry holds both sets of props, and a boolean that defaults tofalsegives nodefault, since ViteHub writes adefaultinto each new block.I built and typechecked onmax.me against this PR's build with its hand-written map in
server/content.tsreplaced bycomponentInfo(comarkUiOptions), the options its renderer already uses. ViteHub'sdocuments()accepts it, and the collection goes from 5 blocks to 54. The five it had keep their labels and gain props (embed.height,compare.mode,screenshot.ink, …). Before/after: https://drop.vitehub.dev/d/jkykj7vjcx57/onmax-me-comark-ui-n8