feat(devtools): high-fidelity seeded content for every node type - #272
Merged
Conversation
…e type Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add builders/dashboard-builder.ts: typed factories for metric.count, chart.*, view.saved, list.tasks, links.pages, heatmap.streak — each emitting a real SavedViewDescriptor query bound to seeded schemas — plus a responsive grid packer (lg + xs) and time-range/custom variables. Seed two populated dashboards (Team Overview analytics + Reliability team-hub) instead of empty shells.
Extend RichBlock with image/file/embed/databaseEmbed/taskViewEmbed/richLink/ toggle/mermaid/hr (+ callout caution) and an inline model (TextRun marks/link/ wikilink + hashtag/taskMention/databaseReference pills) built via exact editor attrs. Add a Feature Showcase page exercising every block + inline pattern, binding databaseEmbed to the seeded tracker DB. Add seed-render.test.ts: builds the real editor ProseMirror schema and parses every seeded page doc through yXmlFragmentToProseMirrorRootNode — a malformed fragment fails CI instead of rendering blank. (tiptap added as devtools devDeps.)
Extend the DatabaseSpec view/field model: list/gallery/timeline views, plus per-view filters (FilterGroup), sorts, columnSummaries, coverField/cardSize, rowHeight and hiddenFields (field keys translated to field ids). The Tasks Tracker now exercises every view type + dateRange/file/formula/created/createdBy fields, a filtered+sorted+summarised table view, and the CRM Accounts DB gains a rollup over its cross-database relation.
Add builders/canvas-builder.ts wrapping the real @xnetjs/canvas constructors: card() for page/database/dashboard/media/task cards (embedding seeded nodes), frame()/group() containers with memberIds, and styledEdge() across the relationship-kind vocabulary. Rebuild the flagship canvas to embed the tracker DB, overview dashboard, sample page, a media asset and a task inside a presentation frame + asset group, wired with solid/dashed/curved/colored connectors. Render test now also asserts the canvas scene is populated.
Add docs/page-builders.ts (task description, project brief, milestone notes, CRM org/contact/deal notes, experiment protocol) on the rich-page vocabulary, wired into work/crm/metrics so those nodes carry real Yjs documents instead of blank descriptions. Seed a Map node with a basemap, viewport and a GeoJSON markers layer. Render gate validates every new domain doc.
…ashboard card) CanvasObjectKind has no 'dashboard' card and createCanvasFrameVariantNode needs a viewport; model frames/groups as group nodes with containerRole and embed the dashboard via an external-reference card. Typecheck green.
Contributor
|
Preview removed for PR #272. |
| } | ||
|
|
||
| /** Render one block to a Y.XmlElement (recursive for toggles). */ | ||
| function renderBlock(block: RichBlock): Y.XmlElement { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the dev-tools seed bake real, contextually-rich content into every node type so each surface exercises its full UI-pattern set instead of rendering blank (exploration 0223). Builds on the relational seed from #266.
Researched via a multi-agent map of every seedable surface's exact content structures (Yjs element names + attrs, dashboard widget/query shapes, DB view configs, canvas node kinds).
Highlights (phased)
builders/dashboard-builder.ts: typed factories formetric.count,chart.bar/line,view.saved,list.tasks,links.pages,heatmap.streak— each a realSavedViewDescriptorquery bound to seeded schemas — plus a responsive grid packer and time-range/custom variables. Two populated dashboards.RichBlockgains image/file/embed/databaseEmbed/taskViewEmbed/richLink/toggle/mermaid/hr (+ callout caution) and an inline model (marks + hashtag/taskMention/databaseReference pills). A "Feature Showcase" page exercises every block.dateRange/file/rollup/formula/auto fields.builders/canvas-builder.ts: page/database/media/task/external-reference cards, a presentation frame + a group, and styled (dashed/curved/colored) connectors.docs/page-builders.tsfills Task descriptions, Project briefs, Milestone notes, CRM org/contact/deal notes and an Experiment protocol; a Map gets a basemap + GeoJSON markers.Safety net
New
seed-render.test.tsbuilds the real editor ProseMirror schema and parses every seeded page/doc viayXmlFragmentToProseMirrorRootNode(and decodes the canvas scene) — a malformed Yjs fragment fails CI instead of rendering blank. Hand-builtY.XmlElements (notprosemirrorJSONToYDoc) keep the seed deterministic and editor-schema-decoupled. (tiptap added as devtools devDeps.)Verification
@xnetjs/devtoolstypecheck (24/24) + lint + prettier clean. Private package → no changeset.615 created · 26 docs · 1.7s, zero console errors; idempotent re-run0 created · 616 updated. The Team Overview dashboard renders metric counters (32/9/4) + a Tasks-by-status bar chart + an Observations line chart with a working time-range; the Tasks Tracker database renders all 6 view tabs with advanced columns.🤖 Generated with Claude Code