Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(app-shell): Markdown editor with live preview for doc items in Studio (objectui#10188) - #11241

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-10188-doc-markdown-editor
Sep 30, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-10188-doc-markdown-editor

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Part of #10188 — the editor half. The menu half (body scope item 2, the addendum) and the acceptance checklist item stay with the card.

Clause-②: no

What this does

Studio's metadata admin can now author a doc (ADR-0046) the way the maintainer asked for: an admin writes Markdown in the UI, sees it rendered live, and places it in a book. It is built INTO the existing edit flow, not beside it: MetadataResourceEditPage loads and saves the doc through the standard metadata write door (PUT /meta/doc/:name, mode=draft, then Publish), and a new doc Preview (previews/DocPreview.tsx) is the type's canvas, the way the object designer is the canvas for fields.

  • Source pane + live preview. The preview renders through SchemaRenderer as { type: 'markdown' }, the registry entry @object-ui/plugin-markdown provides and the docs portal (DocPage) renders with. @object-ui/app-shell takes no new dependency.
  • Only keys DocSchema declares. The installed spec (17.5.0) has no title and no locale key on a doc: the title is label (title is a refused alias of it) and a locale variant is an entry of translations ({ label?, description?, content }). The locale switcher edits translations[tag]; a new variant is seeded from the default body, because an empty variant is served to that locale's readers as an empty page.
  • Book placement is a doc-side write. A book stores no members (ADR-0046 §6.2.1): a doc joins a book group through its own group key, or a group's name/tag rule claims it. The picker lists every listed book's groups and writes doc.group; the readout under it ("Appears in: BOOK › GROUP") is computed with the spec's own resolveBookTree over this one doc, so it also reports a placement a rule makes with no explicit group, lists every book a shared group key lands in, and marks a public book.
  • The canvas owns content, translations and group (CANVAS_OWNED_KEYS), so the properties form shows the header keys only; doc joins CREATE_MODE_CANVAS_TYPES, so the editor is up during create too. The create form asks for label / name / description, suggests name from the title, and seeds content: '' (the one other key the spec requires).
  • New strings live in the designer's own en / zh tables (metadata-admin/i18n.ts, the engine.* carve-out), plus a doc type label ("Documentation" / "文档"). No locale pack under packages/i18n changes.

Premise readings (dispatch zone 2)

  1. What an admin sees for doc today — measured on the published 17.5.0 console (/_console) against a 17.5.0 backend: the Documentation tile exists (the probe package ships a doc) and create is the generic SchemaForm (Name*, Content*, Label, Description) with Content a one-line text input (zero textareas) and no preview; the edit form of a packaged doc shows every key incl. the _lock* envelope and Translations as a JSON fallback. Holds as the PM guessed.
  2. Server contract — GET /meta/types serves the doc row with allowRuntimeCreate: true, allowOrgOverride: false and DocSchema's JSON Schema (name, label, description, content, order, group, tags, translations + the envelope; required name, content). PUT /meta/doc/:name?mode=draft answered 200 (state=draft), publish 200, and GET /meta/doc/:name served the doc afterwards. Falsified in part: the card's key list names title and locale, which the spec does not declare (see above); the editor writes label and translations.
  3. Preview through the registry — holds. The console registers markdown lazily (register-plugins.ts); the live run below rendered a heading, a list and a link through it.
  4. Book overlay — the premise's framing is falsified: assigning a doc to a book needs no book write at all. In the spec's model membership is derived, and the doc's own group key is the explicit placement; the server's tree endpoint honours it (measured: a doc saved with group: reference is listed under that group by GET /meta/book/docprobe_manual/tree). No book-write path was added. (For the record: book is allowRuntimeCreate: true, allowOrgOverride: false on 17.5.0, so runtime books are creatable and packaged ones are read-only.)
  5. Portal renders the saved doc — holds for the page (see the live reading); the portal's book sidebar does not list it — see Acceptance notes.

Live reading (reach)

A published @objectstack/cli@17.5.0 backend (os dev --fresh --seed-admin, a probe package with book docprobe_manual = groups getting_started (rule docprobe_gs_*) and reference), this branch's console on vite, driven with Playwright:

  • create at /apps/setup/metadata/doc/new: title "Live Guide" suggested name = live_guide; the picker offered "Not placed in a section, Getting started, Reference"; choosing Reference read back "Appears in: Probe Manual › Reference"; the live preview drew h1 "Live Guide", li "first item" / "second item" and a[href="https://example.com/docs"] "the portal".
  • Save navigated to /apps/setup/metadata/doc/live_guide with the same body and section; Publish cleared the pending draft; a full page reload showed the same body and section again.
  • /docs/docprobe_manual/live_guide rendered the same heading, list and link.
  • The server's refusal envelope was measured too: a doc carrying title answers 422 INVALID_METADATA with issues[0].message "Unrecognized key(s) on this doc: title. Did you mean title → label? …"; the page test replays that envelope verbatim.

Tests

All at HEAD 49a07a8a96 (this branch after merging origin/main dded788ada), run from the worktree root through the shared verify lock, exit codes captured before any pipe:

  • pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build — exit 0 (re-run after the merge).
  • pnpm --filter @object-ui/app-shell type-check — exit 0 (tsc --noEmit && tsc -p tsconfig.test.json; the test project compiles both new suites).
  • pnpm exec vitest run --maxWorkers=3 --shard=K/6 packages/app-shell/, K = 1 to 6 — all six exit 0: 932 test files (931 passed, 1 skipped), which is every tracked app-shell test file; 9301 tests passed, 9 skipped.
  • New suites: previews/DocPreview.test.tsx (13 tests: source to content and the live preview, read-only mode, locale variants as translations entries and the refused tags, book placement written as doc.group with the resolver's readout incl. a rule placement, a shared key and a public book, an unknown key kept visible, a failed book list reported, a full-parse DocSchema.safeParse of a draft edited through every control, and no untranslated key in zh-CN) and ResourceEditPage.docEditor-10188.test.tsx (3 tests: create sends one spec-clean PUT through the standard door; reload shows the same body and section; the server's refusal message reaches the author).
  • Found on the way: the full metadata-admin run reddened ConditionWidget.conditionScope.test.tsx ("every registered metadata resource has a ruled row") once doc became a registered resource; with the doc: 'none' row it is green.
  • Gate scripts, all exit 0: node scripts/check-changeset-presence.mjs, check:control-bytes, check:i18n-designer-parity, check:i18n-keys, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:test-path-roots, check:new-line-citations (0 new citations), check:phantom-deps, check:unused-deps, check:registry-bare-names, check:unreferenced-sources, check:changeset-claims, check:pending-changeset-literals. No locale pack under packages/i18n changed, so the pack-parity suites are not owed.
  • ESLint (the package script is eslint .), narrowed to the 9 changed source files with --format json: 0 errors; ResourceEditPage.tsx reports 53 warnings, the same 53 its base version reports (linted from git show through --stdin), and every other changed file 0. The narrowing excludes nothing: the config sets no type-aware parser options and its local rules read no files, so this diff cannot move a verdict on an untouched file.
  • NOT MEASURED locally, because each needs a full console or all-package build that CI runs: check:eager-closure, check:sdui-registration-pins (exit 2, "No console build to weigh"), check:published-dist, and check:readme-exports as a whole (it cannot judge other unbuilt packages; with app-shell built, no app-shell README line was left unjudged). The editor's one value import from @objectstack/spec/system names a module the package entry already reaches through a static chain (register-builtins → DashboardDefaultInspector → dashboard-schema → metadata-form-i18n, which imports it); the eager-closure figure itself is CI's to read.

Acceptance notes

  • Portal sidebar vs the tree endpoint (reported to the seat, not fixed here — apps/console is outside this card). After the live run, GET /meta/book/docprobe_manual/tree lists live_guide under Reference, but the portal page /docs/docprobe_manual/live_guide renders a sidebar with Reference empty — on this branch's console and on the published 17.5.0 console alike. The console resolves the tree client-side and scopeDocsToBook (apps/console/src/pages/book-nav.ts) first drops docs outside the book's package, while the spec's resolveBookTree places a doc by its explicit group with no package scope. So a doc placed from this editor opens fine but is missing from the book's navigation.
  • The directory tile for Documentation appears only once the active package holds a doc (the directory lists the types the active package contributes); the /metadata/doc list and its New button do not depend on it.
  • Authoring into a code (read-only) package is refused by the server with WRITABLE_PACKAGE_REQUIRED (measured with ?package=com.example.docprobe); the live run authored env-wide, which the server accepted.
  • No client-side Zod validator is wired for doc (clientValidation.ts has no doc loader), so a malformed doc is refused on Save by the server, not while typing.

Deviations

  • packages/app-shell/README.md gains a short "Documentation pages (doc)" section (AGENTS.md's docs-driven commandment: a feature is not done until the package README reflects it); the claim's file surface did not list it.
  • metadata-admin/conditionScope.ts gains the row doc: 'none': registering doc's create hints made it a served type, and ConditionWidget.conditionScope.test.tsx requires every served type to carry a ruled row. none is the ruling's own last row (a type with no condition key; DocSchema declares none).
  • origin/main was merged in after PR objectui#11207 landed (the menu half's navigation entry); none of its files is edited here.

Generated by Claude Code

Studio's metadata admin edits a `doc` (ADR-0046) through the one generic
edit flow, with `previews/DocPreview` as the type's canvas: a Markdown
source pane beside a live preview rendered through the registry's
`markdown` component (the docs portal's renderer), the doc's locale
variants as entries of `translations`, and its placement in a book as the
doc-side `group` key, read back through the spec's `resolveBookTree`.

`doc` joins the create-mode canvas types and owns `content`,
`translations` and `group` on the canvas; the create form asks for the
header keys and suggests `name` from the title.

Part of objectui#10188.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
…lus changeset

`previews/doc-draft.ts` holds the pure patch/placement functions so
`DocPreview.tsx` exports only its component; the book list no longer
resets its own state synchronously inside the effect. Adds the
`@object-ui/app-shell` minor changeset for the doc editor.

Part of objectui#10188.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
… `doc`

`ConditionWidget.conditionScope.test.tsx` enumerates the registered
metadata resources against `CONDITION_SCOPE_BY_METADATA_TYPE`; `doc` is
now registered (its create hints), so it takes the ruling's own last
row, `none`: `DocSchema` declares no condition key.

Part of objectui#10188.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
Describes the doc canvas (Markdown source + live preview through the
registry's `markdown` renderer, locale variants as `translations`
entries, book placement as the doc's own `group` key) under
"Metadata designers", per AGENTS.md rule #2.

Part of objectui#10188.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
Brings in PR objectui#11207 (the doc navigation entry) and the other
main commits since this branch's base; no file of that PR is edited here.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests package: app-shell labels Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 4 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/6310-designer-formula-key-retired.md

  • names packages/app-shell/src/views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Not touched: designer.field.formula ('Formula (CEL)') in packages/app-shell/src/views/metadata-admin/i18n.ts, a different and live key belonging to metadata-admin's ObjectFieldInspector — the surface that still authors formula expressions.

.changeset/7125-dashboard-empty-state-keys-retired.md

  • names packages/app-shell/src/views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Not touched: table.noRows ('No rows to display') and engine.form.noRows (packages/app-shell/src/views/metadata-admin/i18n.ts, read at widgets.tsx) — two different, same-named keys in different namespaces. Nor the comments in WidgetEmptyState.tsx, DatasetWidget.tsx, ObjectDataTable.tsx and PivotTable.tsx that record WHY three widgets with three strings became one shared empty state; the packs' own comment keeps that rationale and now names the retirement instead of a row that is gone.

.changeset/8632-malformed-picklist-option-loud.md

  • names views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Two new strings land in the designer's own en / zh tables — the metadata-admin console owns its strings in views/metadata-admin/i18n.ts and is deliberately outside the ten locale packs (packages/i18n/README.md, "Scope — the engine.* carve-out").

.changeset/9952-condition-placeholder-derives-from-offered-roots.md

  • names conditionScope.ts → packages/app-shell/src/views/metadata-admin/conditionScope.ts — edited by this change

    The placeholder was a string literal — record.status != 'done' && user.isAdmin — handed to CelPredicateField at every mount, scope or no scope. The same component had already narrowed a record-scoped mount's autocomplete to RECORD_CONDITION_ROOTS (objectui#9645), which carries no user, and narrowed that mount's subject dropdown the same way (objectui#9855). At such a mount user is not merely unadvertised: conditionScope.ts states that a hook condition and a validation rule's guard are evaluated with { record, previous } and only those, fail-CLOSED at the validation host, and objectstack's wrapDeclarativeHook docblock says the condition formula is evaluated against two bindings, record and previous. So the one line an author reads before typing anything taught a root the evaluator never binds, and copying it cost the author the write.

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with cb2f6fb5b (merge-base with origin/main): 10 file(s) changed outside .changeset/, read against 1824 pending declaration(s) that publish a body (2434 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 330 chunks) 3580.5 KB 3607.4 KB
Main entry chunk (gzip) 149.8 KB 350 KB
Entry file index-BCRw9LhR.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.88KB 6.25KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.17KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.13KB 7.95KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 569.02KB 136.04KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 228.91KB 63.54KB
fields (index.js) 261.19KB 66.27KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.40KB 12.91KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.35KB 9.18KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 40.88KB 11.46KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.01KB 3.93KB
plugin-calendar (index.js) 52.17KB 15.06KB
plugin-charts (index.js) 84.09KB 22.93KB
plugin-chatbot (index.js) 198.22KB 46.97KB
plugin-dashboard (index.js) 138.73KB 37.05KB
plugin-designer (index.js) 216.32KB 44.56KB
plugin-detail (index.js) 242.01KB 63.55KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 172.30KB 44.19KB
plugin-gantt (index.js) 172.43KB 42.85KB
plugin-grid (index.js) 230.79KB 63.39KB
plugin-kanban (index.js) 48.46KB 15.12KB
plugin-list (index.js) 116.28KB 28.88KB
plugin-map (index.js) 22.90KB 7.62KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.04KB 12.21KB
plugin-timeline (index.js) 32.26KB 9.42KB
plugin-tree (index.js) 11.20KB 3.89KB
plugin-view (index.js) 90.32KB 22.76KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 119.55KB 39.23KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 6.06KB 2.68KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 21.42KB 7.05KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 3.19KB 1.62KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.26KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.82KB 7.15KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 49a07a8a961f8fedf24ad590988d2d2c0e93607a
Local-runs: none

Inputs read: card #10188 (body and all six comments — the director's addendum 5754645580, the claim 5912572371, the dev report 5915968413), PR #11241 (body, the 11-file list, the net diff against main at the merge-base dded788ada: +1200/−1 over those 11 files and nothing else), the head's 42 check-runs, and the installed spec at the @objectstack/spec@17.5.0 tag commit (packages/spec/src/system/doc.zod.ts, book.zod.ts, system/index.ts, package.json) for every spec claim.

① Derived judgments

Accept-set — what the editor writes, against DocSchema at 17.5.0, a strictObject declaring name, label, description, content, order, group, tags, translations plus the protection envelope, with title a refused alias of label and locale/locales of translations:

  • previews/doc-draft.ts patches write content (the base body), translations[tag] as { label?, description?, content } (variant body, title, summary; add; remove) and group (the picker) — nothing else. Removing the last variant yields translations: undefined, a declared optional key; an emptied variant label/description is deleted, not stored as an empty string. Right, and the entry shape is the spec's DocTranslation exactly.
  • Create form (default-schemas.ts): createFields: ['label','name','description'], createDerive slugify from label to name, createDefaults: { content: '' } — content is the one required key besides name, and '' parses. The card's "title" / "locale" mapped to label / translations: right — the card's words are not spec keys, the alias table refuses them, and the page suite replays the measured 17.5.0 422 INVALID_METADATA refusal of title.
  • No second metadata-editing path: DocPreview is registered through registerMetadataPreview('doc', …) in previews/index.ts; ResourceEditPage.tsx changes by two lines — doc joins CREATE_MODE_CANVAS_TYPES, and CANVAS_OWNED_KEYS.doc = ['content','translations','group'] — so the canvas patches the same draft the Save button sends (onPatch merges into handleDraftChange), the properties form hides those three keys, and the one write is client.save('doc', name, body, { mode: 'draft' }). No new route, page, client or write door. Right; ResourceEditPage.docEditor-10188.test.tsx pins the body { name, label, content, group } and DocSchema.safeParse on it.
  • Book placement: BookSchema at the tag stores groups only — no members — and resolveBookTree places a doc in the first group whose include matches OR whose key equals doc.group. Placement is therefore the doc-side group write, and the claim's "book overlay" premise is falsified as the dev reports: no book write exists or is added. Right.
  • Read-back: resolvePlacements runs the spec's own resolveBookTree(spine, [doc], packageId) per listed book and keeps the first spine.groups.length groups. The resolver emits exactly one group per spine group and appends uncategorized only after them, so cutting by position is exact and mirrors resolveBookClaimedDocs' exclusion. It reports a rule placement with no group, every book sharing the key, a public audience, an unknown key kept visible, and a list failure as a failure rather than "no books". Right and honest about what it computes: the spec's own docblock says GET /meta/book/:name/tree answers resolveBookTree() verbatim, and the README ties the readout to that endpoint.
  • What the portal does NOT do: the dev measured the portal sidebar not listing the placed env-wide doc; the seam is apps/console/src/pages/book-nav.ts scopeDocsToBook, which drops docs outside the book's packages before resolving (read at the head; consistent with the finding). Nothing in this diff claims the sidebar: the PR body discloses the gap, the README names the tree endpoint, and the engine.docPreview.unplaced string ("book trees list it under Uncategorized") is the resolver's documented orphan rule. The changeset's "shows where the doc will appear, computed with the spec's resolveBookTree" is true of the resolver and the tree endpoint and not yet of the portal sidebar for an env-wide doc; it is qualified in the same sentence — right, residual noted in ③ B.
  • Preview: SchemaRenderer schema={{ type: 'markdown', content }} from @object-ui/react, an existing dependency. apps/console/src/pages/DocPage.tsx:225 renders the portal page with the same { type: 'markdown', content }, and register-plugins.ts:116 registers markdown lazily from @object-ui/plugin-markdown. packages/app-shell/package.json is not in the diff: no new dependency, not even a dev one. The README's "unknown-component notice" is SchemaRenderer.tsx's "Unknown component type" panel. Right.
  • conditionScope.ts row doc: 'none': ConditionWidget.conditionScope.test.tsx enumerates listMetadataResources() and reddens on a registered type without a row; default-schemas.ts newly registers doc, and DocSchema declares no visible / hidden / disabled / condition / *When key, so none is the ruling's own last row (a type without a row of its own), not a re-opened verdict. Right.
  • default-schemas.ts registers create hints only and no fallback schema — the server serves DocSchema's JSON Schema on /meta/types, and a copy here could only drift. MetadataResourceConfig makes schema, label and domain optional, and createConformance.test.ts covers a type without a client schema as "shape only". Right.
  • i18n: 26 engine.docPreview.* keys and the doc type label ("Documentation" / "文档") in both the en and zh tables of metadata-admin/i18n.ts, beside the engine.bookPreview.* keys already there; no packages/i18n pack touched. Right (Zone 3 route, ③ item 2).
  • Public surface: packages/app-shell/src/index.ts is untouched and re-exports nothing from previews/, conditionScope.ts, default-schemas.ts or metadata-admin/i18n.ts (grep at the head: no hit). The only observable additions are runtime registry entries — getMetadataPreview('doc'), listMetadataPreviewTypes() and listMetadataResources() now include doc — additive behaviour with no exported symbol, type or schema change. Right.

Check-runs on the head (read 2026-09-30T17:11Z): 32 success (among them Type Check, Lint, Build & E2E, Bundle Analysis, README Export Check, Changeset Declaration / Bump Policy / Fixed Group Check / Claim Re-read, Test (dist pins), Test shards 4/8 and 8/8, Docs Route Eager Closure Check, Governed Surface Queue Guard), 3 skipped (Test (coverage), Test (coverage shard), dependabot), and 7 in_progress, each NOT yet concluded and read as neither pass nor fail: Spec Main Shape Gate, Test (shard 1/8), Test (shard 2/8), Test (shard 3/8), Test (shard 5/8), Test (shard 6/8), Test (shard 7/8).

② Semver level

.changeset/10188-doc-markdown-editor.md declares '@object-ui/app-shell': minor. The diff touches one released package (check-changeset-presence: 9 source files of 1 released package, 1 changeset; Changeset Declaration, Bump Policy and Fixed Group Check green on the head). A new feature — a registered doc preview and resource row, new strings — with no removed or changed export, prop type or schema: minor is right.

Changeset body against the diff, line by line: the title line — delivered; "a Markdown source pane beside a live preview, rendered by the same markdown renderer the docs portal uses" — delivered (DocPage.tsx:225); "Before, the generic form offered the body as a one-line text input with no preview" — the dev's measured premise 1, not contradicted by anything in the diff; "writes only keys DocSchema declares, and saves through the standard metadata write door (PUT /meta/doc/:name)" — pinned by both suites; "Title and body" — createFields, slugify, content on the canvas; "Locale variants … starts as a copy of the default body" — patchAddLocale; "Book placement … its own group key … every book that uses the key is listed, and a public book is marked" — resolvePlacements; "shows where the doc will appear, computed with the spec's resolveBookTree" — true of the resolver and the tree endpoint, see ③ B; "a label for the doc type in English and Chinese" — delivered. README section, line by line: the create-mode canvas through the generic edit page and PUT /meta/doc/:name — delivered; registry markdown with no plugin dependency and the unknown-component notice — delivered; translations with no locale key and the seeded variant — delivered; the group write with the readout tied to GET /meta/book/:name/tree — delivered; CANVAS_OWNED_KEYS and previews/doc-draft.ts — delivered. Neither text claims the menu, the portal sidebar or the acceptance item.

Clause-②: no — holds: no @object-ui/app-shell export, published type, prop type or schema changes accept or reject; index.ts and package.json are outside the diff. No declaration re-read is owed.

③ Boundary flags

Dev deviations (PR body and report), each answered:

  1. packages/app-shell/README.md outside the claim's file surface — accepted: the package's own README for a feature in that package, declared in the PR body; README Export Check green.
  2. New strings in metadata-admin/i18n.ts, not in packages/i18n packs — accepted: the designer's engine.* tables are where the neighbouring engine.bookPreview.* strings live; the zh-CN leak test pins no untranslated key.
  3. The heading / list / link render pin carried by @object-ui/plugin-markdown's markdown-render.test.tsx plus the live reading, while the app-shell suites stub the registry entry and pin the hand-off — accepted: app-shell takes no plugin-markdown dependency (package.json untouched), and pinning the renderer's output here would need one.
  4. origin/main (dded788ada, after PR feat(types,layout): a doc nav entry validates and draws as a link into the docs portal (objectui#11197) #11207) merged in — accepted: the merge-base is dded788ada, the net diff is the 11 files, none of feat(types,layout): a doc nav entry validates and draws as a link into the docs portal (objectui#11197) #11207's.
  5. check:published-dist started unlocked and stopped — accepted as a process note; the head's Build & E2E, Bundle Analysis and Test (dist pins) runs are green.
  6. Worktree and probe servers cleaned up — housekeeping, noted.

open_questions: none declared; none found.

Out-of-scope findings, routed:

  • A. Portal sidebar vs tree endpoint (class a, public door; seam apps/console/src/pages/book-nav.ts scopeDocsToBook): escalated to the seat to file against apps/console — outside this card's surface, correctly not fixed here. Until it lands, a doc placed from this editor opens in the portal but is missing from the book's navigation; the maintainer's "甚至加到菜单" is the menu half, which the card keeps open with the acceptance item, as the PR body says.
  • B. Residual wording: the changeset's "shows where the doc will appear" reads as the portal to a consumer; it is qualified by "computed with the spec's resolveBookTree" and the PR body discloses the sidebar gap, so not blocking. The seat may tighten it to "in the book tree" when A is filed.
  • C. The Documentation directory tile appears only once the active package holds a doc (carrier: none): a discoverability note for the seat; the /metadata/doc list and its New button do not depend on it.
  • D. No client-side validator for doc in clientValidation.ts (carrier: none): the server refuses on Save and the refusal message is pinned to reach the author; not owed by this card.

Gate state: the seven in_progress runs named in ① were not concluded when this record was written. This verdict reads the contract and the concluded runs, and treats the unconcluded ones as neither pass nor fail; the merge gate reads them when they conclude.

Blocking findings: none.

Implemented-by: claude/issue-10188-doc-markdown-editor
Reviewed-by: session_0122Knsowci76D2rBWReCzzZ

VERDICT: PASS

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 30, 2026 17:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit 02fe8ca Sep 30, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-10188-doc-markdown-editor branch September 30, 2026 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation package: app-shell tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants