Skip to content

feat(ui): every block package exports its componentInfo, and comark-ui/info collects them - #433

Merged
vite-hub[bot] merged 3 commits into
mainfrom
n8/component-info
Nov 15, 2026
Merged

vite-hub[bot] merged 3 commits into
mainfrom
n8/component-info

Conversation

@onmax

@onmax onmax commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

An app that edits comark-ui documents has to describe every block itself before an editor can show it. ComarkEditor takes a components map, and ViteHub's documents({ components }) takes the same shape for the Console's insert menu, but no package exports one. onmax.me writes its own for embed, carousel, compare, screenshot, and annotation in server/content.ts, and Drop, Finance, and the others would each write theirs.

This PR gives each package whose blocks a document writes a componentInfo export from a new ./info entry, such as comark-embed/info. Each block gets its kind (block or inline), a label, a one-sentence description, typed props (with default and options where the docs give them), and named slots, keyed by the name as written. It's plain data on one type in shared/component-info.ts, so a server can load it without the parse plugin.

componentInfo(options) from comark-ui/info collects them for the plugins those options turn on, so an app passes the same options it renders with:

import { componentInfo } from "comark-ui/info";

documents({ path: "content/posts/*.md", fields, components: componentInfo(options) });

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.ts parses 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 on embed. It also checks the names are the lowercase tags ViteHub's documents() accepts.

Two calls I made: ::chart's notes share annotation with comark-annotate, so that entry holds both sets of props, and a boolean that defaults to false gives no default, since ViteHub writes a default into each new block.

I built and typechecked onmax.me against this PR's build with its hand-written map in server/content.ts replaced by componentInfo(comarkUiOptions), the options its renderer already uses. ViteHub's documents() 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

…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.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T18:08:50.359695Z
We couldn’t complete this review. Comment @codex review to try again.
287aef6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@433

comark-badge

pnpm add https://pkg.pr.new/comark-badge@433

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@433

comark-cards

pnpm add https://pkg.pr.new/comark-cards@433

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@433

comark-cast

pnpm add https://pkg.pr.new/comark-cast@433

comark-charts

pnpm add https://pkg.pr.new/comark-charts@433

comark-chat

pnpm add https://pkg.pr.new/comark-chat@433

comark-chips

pnpm add https://pkg.pr.new/comark-chips@433

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@433

comark-code

pnpm add https://pkg.pr.new/comark-code@433

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@433

comark-colors

pnpm add https://pkg.pr.new/comark-colors@433

comark-comments

pnpm add https://pkg.pr.new/comark-comments@433

comark-critic

pnpm add https://pkg.pr.new/comark-critic@433

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@433

comark-details

pnpm add https://pkg.pr.new/comark-details@433

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@433

comark-diff

pnpm add https://pkg.pr.new/comark-diff@433

comark-embed

pnpm add https://pkg.pr.new/comark-embed@433

comark-fields

pnpm add https://pkg.pr.new/comark-fields@433

comark-figure

pnpm add https://pkg.pr.new/comark-figure@433

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@433

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@433

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@433

comark-github

pnpm add https://pkg.pr.new/comark-github@433

comark-icon

pnpm add https://pkg.pr.new/comark-icon@433

comark-include

pnpm add https://pkg.pr.new/comark-include@433

comark-keys

pnpm add https://pkg.pr.new/comark-keys@433

comark-links

pnpm add https://pkg.pr.new/comark-links@433

comark-linter

pnpm add https://pkg.pr.new/comark-linter@433

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@433

comark-mark

pnpm add https://pkg.pr.new/comark-mark@433

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@433

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@433

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@433

comark-media

pnpm add https://pkg.pr.new/comark-media@433

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@433

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@433

comark-outline

pnpm add https://pkg.pr.new/comark-outline@433

comark-properties

pnpm add https://pkg.pr.new/comark-properties@433

comark-qr

pnpm add https://pkg.pr.new/comark-qr@433

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@433

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@433

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@433

comark-sources

pnpm add https://pkg.pr.new/comark-sources@433

comark-steps

pnpm add https://pkg.pr.new/comark-steps@433

comark-table

pnpm add https://pkg.pr.new/comark-table@433

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@433

comark-tests

pnpm add https://pkg.pr.new/comark-tests@433

comark-time

pnpm add https://pkg.pr.new/comark-time@433

comark-ui

pnpm add https://pkg.pr.new/comark-ui@433

comark-xref

pnpm add https://pkg.pr.new/comark-xref@433

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@433

commit: deb2db8

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /info entry.
  • Preset collection: Added comark-ui/info, root exports, and renderer-filtered componentInfo on preset results.
  • Editor integration: Documented direct consumption by ComarkEditor and ViteHub’s documents({ 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread packages/annotate/src/info.ts Resolved
Comment thread packages/charts/src/info.ts Resolved
Comment thread packages/ui/src/info.ts Resolved
Comment thread packages/badge/src/info.ts Resolved
Comment thread packages/include/src/info.ts Resolved
@vite-hub

vite-hub Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed 2026-11-15T00:24:05.850Z 7s
View session Completed 2026-11-15T00:18:31.929Z 1m 9s
View session Cancelled 2026-11-15T00:01:00.414Z 7m 10s
View session Last seen running 2026-11-14T22:59:30.706Z 0s
View session Cancelled 2026-11-14T20:26:41.853Z 6s
View session Cancelled 2026-11-14T19:16:44.301Z 10m 16s

Latest result

Merged deb2db8 directly: required checks passed and review threads were resolved.

Final answers

Session

Merged deb2db8 directly: required checks passed and review threads were resolved.

View session

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.

onmax and others added 2 commits November 14, 2026 23:37

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot merged commit d1257f5 into main Nov 15, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the n8/component-info branch November 15, 2026 00:24
@github-actions github-actions Bot mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant