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

Fix fumadocs component styling: Import ObjectUI components CSS - #161

Merged
hotlong merged 2 commits into
mainfrom
copilot/fix-button-color-calendar-text
Jan 23, 2026
Merged

hotlong merged 2 commits into
mainfrom
copilot/fix-button-color-calendar-text

Conversation

Copilot AI commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Component styles missing on fumadocs documentation pages:

  • Buttons rendered without background colors (no bg-primary, bg-destructive, etc.)
  • Calendar dates and weekday headers collapsed without spacing

Changes

Fixed CSS packaging and imports

  • packages/components/package.json: Corrected CSS export path from ./dist/style.css to ./style.css → ./dist/index.css (actual build output)
  • apps/site/app/layout.tsx: Added import '@object-ui/components/style.css'; after global.css import

The components package builds a standalone CSS bundle (dist/index.css) containing all Tailwind utility classes used by components. This CSS must be imported by consuming applications.

Disabled broken plugin imports

  • apps/site/app/components/InteractiveDemo.tsx: Commented out @object-ui/plugin-object import
  • apps/site/app/components/ObjectUIProvider.tsx: Commented out @object-ui/plugin-object import

Plugin has missing @object-ui/data-objectql dependency causing build failures.

Screenshots

Buttons - Before:

Button colors missing

Buttons - After:

Button colors fixed

Calendar - Before:

Calendar text squished

Calendar - After:

Calendar spacing fixed

Original prompt

fumadocs 文档页,按钮颜色没出来,日历选择组件的文字也挤在一起

https://objectui.org/docs/components/form/button


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented Jan 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 23, 2026 9:39am
objectui-site Ready Ready Preview, Comment Jan 23, 2026 9:39am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – objectui-docs January 23, 2026 09:26 Inactive
…n colors and calendar spacing

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@vercel
vercel Bot temporarily deployed to Preview – objectui-docs January 23, 2026 09:36 Inactive
Copilot AI changed the title [WIP] Fix button color and calendar text alignment issues Fix fumadocs component styling: Import ObjectUI components CSS Jan 23, 2026
Copilot AI requested a review from hotlong January 23, 2026 09:39
@hotlong
hotlong marked this pull request as ready for review January 23, 2026 09:41
Copilot AI review requested due to automatic review settings January 23, 2026 09:41
@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1587.97KB 372.82KB
core (index.js) 0.53KB 0.28KB
data-objectql (ObjectQLDataSource.js) 11.05KB 2.64KB
data-objectql (hooks.js) 5.62KB 1.43KB
data-objectql (index.js) 0.62KB 0.36KB
designer (index.js) 1.46KB 0.51KB
plugin-charts (AdvancedChartImpl-DazADGz5.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DVw_7KEd.js) 3.17KB 1.10KB
plugin-charts (index-CdgY2AuM.js) 12.39KB 3.83KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-B7ZgZJJG.js) 18.15KB 5.59KB
plugin-editor (index-Dl3HAAqu.js) 10.07KB 3.31KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CUWM-JC-.js) 76.50KB 20.46KB
plugin-kanban (index-BV3FWhCb.js) 11.86KB 3.67KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-BRkYjVWf.js) 256.79KB 64.50KB
plugin-markdown (index-D_CdfEXQ.js) 9.59KB 3.16KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.32KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.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

@hotlong
hotlong merged commit 706fa05 into main Jan 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CSS styling issues in the fumadocs documentation site where ObjectUI components were rendering without proper styles. The fix involves correcting the CSS export path in the components package and importing that CSS in the site's layout.

Changes:

  • Corrected CSS export path in components package.json from incorrect ./dist/style.css to proper ./style.css → ./dist/index.css mapping
  • Added CSS import in site layout to load component styles
  • Temporarily disabled plugin-object imports due to build issues

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/components/package.json Fixed CSS export path to correctly map ./style.css to the actual build output ./dist/index.css
apps/site/app/layout.tsx Added import of components CSS to ensure styles are loaded for documentation pages
apps/site/app/components/ObjectUIProvider.tsx Commented out plugin-object import with note about missing dependency issue
apps/site/app/components/InteractiveDemo.tsx Commented out plugin-object import with note about missing dependency issue

import('@object-ui/plugin-kanban'),
import('@object-ui/plugin-markdown'),
import('@object-ui/plugin-object'),
// import('@object-ui/plugin-object'), // Temporarily disabled due to missing dependency

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

The comment "Temporarily disabled due to missing dependency" is misleading. The @object-ui/data-objectql package exists in the monorepo (packages/data-objectql/), is properly listed in plugin-object's package.json dependencies (line 50), and is only used for type imports in the plugin-object source code.

If there is a genuine build or runtime issue causing this to be disabled, the comment should specify the actual error or problem encountered rather than claiming the dependency is missing.

Suggested change
// import('@object-ui/plugin-object'), // Temporarily disabled due to missing dependency
// import('@object-ui/plugin-object'), // Temporarily disabled pending plugin integration

Copilot uses AI. Check for mistakes.
Comment thread apps/site/app/layout.tsx
@@ -1,4 +1,5 @@
import './global.css';
import '@object-ui/components/style.css';

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

This import creates CSS duplication. The components package's index.css (which gets built to dist/index.css) contains '@import tailwindcss' and defines all theme variables (packages/components/src/index.css lines 1-109). The site's global.css already imports tailwindcss and defines the same theme variables (lines 1-104).

With Tailwind 4's @source directive, global.css already scans the components package for classes (line 7: '@source ../../packages/components/src/**/*.{ts,tsx}'). This should generate all needed component styles without requiring a separate CSS import.

However, there's a tradeoff: the components package needs standalone CSS for external consumers. If removing this import causes styling issues, it suggests the @source scanning may not be working correctly. Consider verifying that Tailwind 4's @source properly processes the component classes, or document why both imports are necessary despite the duplication.

Suggested change
import '@object-ui/components/style.css';

Copilot uses AI. Check for mistakes.
import('@object-ui/plugin-kanban');
import('@object-ui/plugin-markdown');
import('@object-ui/plugin-object');
// import('@object-ui/plugin-object'); // Temporarily disabled due to missing dependency

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

The comment "Temporarily disabled due to missing dependency" is misleading. The @object-ui/data-objectql package exists in the monorepo (packages/data-objectql/), is properly listed in plugin-object's package.json dependencies (line 50), and is only used for type imports in the plugin-object source code.

If there is a genuine build or runtime issue causing this to be disabled, the comment should specify the actual error or problem encountered rather than claiming the dependency is missing.

Suggested change
// import('@object-ui/plugin-object'); // Temporarily disabled due to missing dependency
// import('@object-ui/plugin-object'); // Temporarily disabled pending resolution of plugin issues

Copilot uses AI. Check for mistakes.
os-steve pushed a commit that referenced this pull request Sep 20, 2026
…viding a float by 100

The percent edit widget converted a typed percentage-point value to its stored
fraction with `n / 100`. Division by 100 is not representable in binary
floating point, so the quotient carried residue no author typed: measured over
the whole step grid a `scale: 2` field offers (`0.00` to `100.00`, 10001
values), 2760 of them convert to a stored fraction of 16 to 19 decimal places.
`66.67` stored `0.6667000000000001`; `99.99` stored `0.9998999999999999`.

Maintainer ruling batch #161 item 3 letter B settles which quantity `scale`
names: the DISPLAYED percentage-point decimals, with the storage side derived
(a fraction-stored percent allows `scale + 2` decimal places in the stored
fraction). The platform enforces that allowance by REJECTION, never rounding,
so every one of those residue values is a write the widget's own `step`
attribute offers and the write path refuses.

Shifting the decimal exponent instead yields the double nearest the decimal the
author typed, so a display value carrying `d` places stores `d + 2` and no
more. It is not a rounding: an author typing finer than the declared width
still stores every digit and is still refused upstream, which is the ruled
behaviour. The `whole` convention (`max > 1`) keeps its identity conversion --
there the typed number is the stored number.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QVJUngS9FKfuyQ9NFR2Nbn
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
…generated field set (objectstack-ai#9948)

Fixes objectstack-ai#9778

Clause-②: no

`object-form.customFields` now MERGES over the metadata-generated field
set, per the director-seat ruling on the card (batch objectstack-ai#161 item 5, summon
objectstack-ai#24, maintainer 「其他同意」 2026-09-18T12:07Z). The registration description
is the contract and is **unchanged**.

Clause-② tested against this diff, not inherited: the diff adds **0**
lines containing `export ` (lit control on the same corpus: 18 added
lines contain `customFields`) and no new key on any published payload —
an existing branch is made reachable. Answer stands at `no`.

## What changed

`ObjectForm.tsx`, three sites:

1. **The replace path is gone.** A non-empty `customFields` used to run
`setFormFields(schema.customFields.map(normalizeVisibility))` and return
above the metadata branch, so the object's schema was never even
fetched.
2. **The metadata is now fetched whenever an `objectName` and a data
source are present**, inline members or not — without the generated set
there is nothing to merge over, and the merge lookup
`schema.customFields?.find((f) => f.name === name)` stays the dead code
objectui#8071 measured. The members-only schema (an object with no
fields) became the **fallback** rather than the inline path's fixed
answer: it is what the registration's second sentence describes, "with
inline definitions and no data source, this becomes the only field
source".
3. **Members naming nothing in the generated set are appended** after
it, in authored order, right before `setFormFields(generatedFields)`.

Two smaller consequences, both deliberate:

- The loading flag no longer drops unconditionally on the inline path —
it drops when nothing is going to be fetched, otherwise the metadata
branch's own `willFetchData` tail clears it. Without this an empty
`form` sat on screen for the duration of `getObjectSchema`.
- A `getObjectSchema` that throws (or returns nothing) now falls back to
the members-only source **when inline members are present**, instead of
replacing a form that used to render with an error panel. The metadata
is an overlay on this path, not a prerequisite.

## The pins, one row per direction

`objectFormCustomFieldsMembers-8071.test.tsx` flips from pinning the
replace behaviour to pinning the merge:

| row | direction | asserts |
| --- | --- | --- |
| 1 | shape + merge | members are whole field definitions keyed by
`name`; the merged set is `customer, note, amount, zz` |
| 2 | **override** | a member takes the declared field's position,
supplies its whole definition, **and the metadata IS fetched** —
`getObjectSchema` inverted from `toBe(0)` to `toBe(1)` |
| 3 | **keep** | `customer` / `amount`, which no member names, still
render with the object's own labels |
| 4 | **append** | members naming nothing declared come after the
generated set, in authored order |
| 5 | (unchanged) | an EMPTY `customFields` is UNAUTHORED — the read is
`.length > 0`, not truthiness |
| 6 | (unchanged) | the same member count exempts the block from the
no-adapter panel; doubles as the control for the no-data-source sentence
|

One collateral red, repaired in place and called out here:
`ObjectForm.mobileFullscreen.test.tsx`'s "commits a fullscreen edit back
into the form state" mounts a `customFields` member named `summary`
against an object that also declares `changelog`, so the merge draws two
expand affordances and an unscoped `findByTestId` found both. The lookup
is now scoped to the field the case is about; nothing else in the file
moved.

## Reverse verification (ablation)

The fix was committed first, then `ObjectForm.tsx` alone was reverted to
this branch's base commit and the flipped pins re-run:

- mutation landed on disk: the `objectui#9778` markers went 5 to 0 and
the replace path
`setFormFields(schema.customFields.map(normalizeVisibility))` came back
(1 occurrence); blob `85d6c1c4` against HEAD's `cd4bd869`
- result: **4 failed | 2 passed (6)** — rows 1-4 red, each for its own
reason (`expected [ 'zz', 'note' ] to deeply equal [ 'customer', 'note',
'amount', 'zz' ]`; `expected +0 to be 1`; `expected null to be
'Customer'`; `expected [ 'zz', 'yy' ] to deeply equal [ 'customer',
'note', 'amount', …(2) ]`), rows 5-6 green as they should be, since
neither is about the merge
- restored by `git checkout HEAD -- ObjectForm.tsx` (trap-guarded,
absolute path): blob back to `cd4bd869`, `git diff HEAD` empty, markers
back to 5

## Tests

Run at `096496e052`:

- `pnpm --filter @object-ui/plugin-form test` — **100 files passed, 940
passed | 1 skipped (941)**
- `pnpm --filter @object-ui/plugin-form type-check` — exit 0 (`tsc
--noEmit` plus `tsconfig.test.json`), after `pnpm --filter
'@object-ui/plugin-form^...' build` — without that dependency-closure
build it reports `TS2307 Cannot find module '@object-ui/*'` on every
workspace import, which is a missing `dist`, not a type error
- consumers that pass `customFields` through: `packages/plugin-view/` +
`packages/plugin-designer/` + `registry-inputs-spec-parity.test.ts` +
`public-block-binding-reach.test.tsx` — **66 files, 757 passed**. The
fenced ledger's counts do not move, exactly as the dispatch predicted,
so it was **not edited**.
- gates, each exit code captured before any pipe: `check:control-bytes`,
`check:new-line-citations`, `check:changeset-claims`,
`check:pending-changeset-literals`, `check:test-path-roots`,
`check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:element-data-source-declaration`,
`check-changeset-presence.mjs`, `check-changeset-no-major.mjs` — all
exit 0. `eslint` on the three changed files: 0 errors (64 pre-existing
`no-explicit-any` warnings).
- `check:sdui-registration-pins` — **NOT MEASURED**: exit 2 is its own
prerequisite refusal ("No console build to weigh at
apps/console/dist/assets"), not a red. This diff adds and removes no
registration; CI builds the console and runs it.

## Acceptance notes

Out-of-scope findings, neither touched here:

1. **To file (class b).** The same registered description still
describes the drawer and modal presentations of this block, and both
still replace. `ObjectForm` spreads the schema — `customFields` included
— into `DrawerForm` / `ModalForm` for `formType: 'drawer' | 'modal'`,
and each of those runs its own `if (schema.customFields?.length) {
setFormFields(schema.customFields); }`. So an author who takes the
registration at its word gets a merge on the flat presentation and a
replacement on the other two, from one declared key. Out of this card's
file surface (the ruling names `ObjectForm.tsx`) and it needs its own
pins. Dedupe words: `DrawerForm customFields replace` · `ModalForm
customFields replace` · `presentation arms merge parity` · `formType
drawer inline fields` · `customFields merge unreachable`.
2. **Noted, not filed.** The console ledger entry for
`object-form.customFields` still describes the replace behaviour in
prose ("they REPLACE the metadata-generated set … `getObjectSchema`
asserted at zero calls … handed back as a finding rather than
repaired"). It is reviewed prose, not a computed assertion — its counts
do not move and its test stays green (measured above) — and the file is
held by open PR objectui#9924, so it was not edited. Successor: whoever
lands objectui#9924, or the next objectui#8071 slice that edits that
ledger.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L

---
_Generated by [Claude
Code](https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
…ure control (objectui#9780) (objectstack-ai#9968)

Fixes objectstack-ai#9780

Clause-②: no — tested against THIS diff, ⛔ not inherited from the claim.
No new
exported symbol (the diff adds none: `grep -E "^\+.*\bexport\b"` over
the
branch's `packages/plugin-form/src` diff matches nothing), and no new
key on any
published payload — the divider pseudo-row already emitted
`collapsible`,
`collapsed` and `onToggle`; only what the first and third are computed
FROM
moved. The authorable accept set is unchanged: both spellings were
accepted
before, and behaviour widens only.

## The ruling this implements

Maintainer ruling 2026-09-18, batch objectstack-ai#161 item 4, **letter A** (director
seat
comment on the card; maintainer 「其他同意」). Quoted verbatim:

> `object-form`: a section with `collapsed: true` is collapsible — the
toggle is
installed; `collapsible: true` alone (open, toggle present) is
unchanged;
`collapsible: false` with `collapsed: true` is the same contradiction
and
resolves the same way (collapsed wins, toggle present), noted in the
describe.

⛔ Letter **B** (refuse the combination at the declaration face) and
letter **C**
(a dev-only `console.warn`) were refused and are ⛔ not re-opened here.

⚠️ **The ruling has two halves and only one is in this repo.** The
second bullet
— the `sections[].collapsed` describe stating 「implies `collapsible`」 —
lives in
objectstack's `packages/spec`, which this repo consumes as a published
dependency
(objectui declares `collapsible` only for the disclosure/accordion
family, and
there is no form-section schema or `forms.zod.ts` under
`packages/types/src/zod/`
to hold the sentence). ⇒ this pull request is the **behaviour half**
only; the
describe line is an upstream card the PM has recorded. The behaviour
half does
not depend on it: the describe documents the behaviour, it does not gate
it.

## What changed

`packages/plugin-form/src/ObjectForm.tsx`, grouped (default) layout. The
initial
state was read off `collapsed` unconditionally while the disclosure
control was
installed only for a section that also wrote `collapsible` — so
`collapsed: true`
written alone, the most natural spelling of "collapsed by default",
rendered a
section that starts closed, keeps its fields out of the DOM, and offers
nothing
on the page able to bring them back, with no error, warning or
degradation.

The divider row's `collapsible` and its `onToggle` now both derive from
one
`isCollapsible`, read off the **declaration** (`section.collapsible` OR
`section.collapsed`) and ⛔ never off the live collapse state — deriving
it from
the live state would install the control while closed and delete it the
moment
the user opened the section, i.e. a section openable exactly once. The
`if (label)` heading gate and its three riders (the ADR-0089 predicate
row, the
objectui#6236 membership claim, the untitled-bucket rule) are untouched.

## Tests

New pin
`packages/plugin-form/src/__tests__/collapsedImpliesCollapsible-9780.test.tsx`
— four rows, covering each case the ruling names:

1. `collapsed: true` alone — starts closed, a control IS on the page,
clicking it
hands the fields back; clicked twice, because the control must survive
the
   section being opened.
2. `collapsible: true` alone — unchanged: open, control present, still
closes.
3. `collapsible: false` with `collapsed: true` — collapsed wins, control
present,
   opens on click.
4. Absence control — a section declaring neither member draws its
heading, draws
its fields, and carries no control at all, so the reader rows 1-3 use to
find
   the toggle is one that can report none.

The rows pin the **decision**, not just the outcome: letter C leaves
rows 1 and 3
without a control and fails them, and letter B would refuse the row-1
combination
outright.

`objectFormSectionMembers-8071.test.tsx` row 4 **flipped**, in the same
change
that made the implication true — it had pinned the trap AS behaviour
(that is how
objectui#8071 slice 11 found it), exactly as rows 6 and 7 of that same
file
flipped when their own rulings landed. It keeps its job and still reads
`collapsible: true` alone as an open section, so the implication running
one way
only stays pinned. That row is the one test in the package my change
reds; it is
the only test outside the new file that this branch touches.

Evidence, all run on this branch's tree:

- `pnpm exec vitest run packages/plugin-form/` → `Test Files 101 passed
(101)`,
  `Tests 947 passed | 1 skipped (948)`.
- `pnpm --filter @object-ui/plugin-form run type-check` (echoed
  `tsc --noEmit && tsc -p tsconfig.test.json`) → exit 0.
- `pnpm --filter '@object-ui/plugin-form^...' build` (dependency
closure) → exit 0.
- Package lint unit (`eslint .` in `packages/plugin-form`, what CI's
`pnpm lint`
runs for this package) → exit 0; `--format json` reports **131 files**
linted,
0 errors. Narrowing to this package is sound because `eslint.config.js`
enables
no type-aware linting (no `parserOptions.project`, no `projectService`),
so each
file's verdict is computed from that file alone and this diff cannot
move the
  verdict of any file it does not touch. The repo-wide run is CI's.
- Gates: `check:control-bytes`, `check:new-line-citations` (0 new
citations),
`check:test-path-roots`, `check:vi-mock-override-shape`,
`check:lint-coverage`,
  `check:changeset-presence`, `check:changeset-claims`,
`check:pending-changeset-literals`, `check:governed-queue-guard --test`
(NOT
  GOVERNED) — all exit 0.

### Reverse verification (ablation)

Run from the committed fix, mutating `ObjectForm.tsx` back to the
pre-ruling
gating (`collapsible: section.collapsible` / `onToggle:
section.collapsible`).
Direction predicted before the run: rows 1 and 3 of the new file plus
the flipped
row 4 go red, the unchanged spellings stay green.

- The mutation reached disk, proven by anchor counts either side of the
write
  (`collapsible: isCollapsible,` 1 → 0, `onToggle: isCollapsible` 1 → 0,
  `onToggle: section.collapsible` 0 → 1) and by the blob hash changing.
- Mutated run: `Tests 3 failed | 11 passed (14)`, failing with
`expected [] to have a length of 1` on each disclosure-control assertion
— the
  right reason, ⛔ not an unrelated error.
- Restored by `git checkout HEAD --
packages/plugin-form/src/ObjectForm.tsx` under
a trap, proven by STATE: the restored blob hash equals the HEAD blob
hash and
  `git diff HEAD` for that path is empty.

## Acceptance notes

Out of scope, noted here and reported to the PM rather than fixed in
this pull
request (the dispatch fences this branch to `ObjectForm.tsx`, its pins
and one
changeset):

- **The same trap exists in `DrawerForm.tsx`.** Its explicit-`sections`
divider
push reads `collapsed` for the initial state unconditionally and
installs
`onToggle` only for `collapsible`, and its collapse branch is not gated
on a
heading either — so a drawer form (`formType: 'drawer'`, reached
straight
through `ObjectForm`'s drawer map, which copies both members) still
renders a
permanently closed, unopenable section for `collapsed: true` alone. Same
class
as this card, a different site, and ⛔ not fixed here. The file's OTHER
site,
the derived-fieldGroups fallback, is already safe (it reads `collapsed`
only
when `collapsible` is declared) — which is a third resolution of the
same pair,
  a fourth one now that this layout implements the ruling.
- **Observation, ⛔ not a card:** `FormSectionContainer` (published from
  `@object-ui/plugin-form`) has the same shape at the React-prop level —
`collapsed` without `collapsible` renders no content and no control. It
is a
component prop, not authored metadata, and no layout in this repo passes
it
  those props (the wizard, its only caller, passes neither).

## 维护者速读(草稿)

**改了什么** — 表单分区只写 `collapsed: true`、没写 `collapsible: true` 时,
以前会渲染成一个永远打不开的区块:字段不在页面上,也没有任何可点的东西能把它们拿回来。
现在这种写法会自带展开控件,点一下就能打开、再点一下能关上。

**为什么改** — 「默认折叠」是最常见的意图,`collapsed: true` 是它最自然的拼法,
而它单独写下来恰好是坏的,运行时还不报错、不警告。裁决按 A 案:`collapsed` 蕴含
`collapsible`。

**风险与代价(含回滚)** — 风险很低:接受集一个字节都没动(两种拼法以前就都接受),
只是行为放宽了 —— 一个打不开的区块没有人能依赖它,所以没有输家。
`collapsible: true` 单写的行为完全不变(由一条独立的钉子看着)。
回滚就是把两处改回读 `section.collapsible`,三条钉子会立刻变红并指明原因。

**席位意见** — (留空,待认领席定稿)

**你要做的** — 不需要做什么。⚠️ 只有一点要知道:裁决的另一半(spec 里
`sections[].collapsed` 的 describe 加上「implies `collapsible`」那句话)在
objectstack 仓,本 PR 做不到,PM 已记为一张上游卡。另外 drawer 布局里还有同样一处陷阱,
见上面的 Acceptance notes,那需要另一张卡。

---
🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L

---
_Generated by [Claude
Code](https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
…ion width (objectui#9810) (objectstack-ai#10079)

Fixes objectstack-ai#9810

Clause-②: no

The accept set of this package does not move outward: no new key, no new
published
symbol, no new declaration read. `storedFraction` is module-private and
is not
re-exported through the barrel (the same shape `percent-scale.ts` and
`numberBadInput.tsx` already use in this package), so the published
surface of
`@object-ui/fields` is byte-identical. What changes is the VALUE this
widget hands
to its host's `onChange` for a fraction-stored percent — a runtime
emission, and it
moves toward the declared contract rather than away from it.

## The ruling this implements

Maintainer ruling, batch objectstack-ai#161 item 3, letter B (comment 5729749935),
maintainer
「其他同意」 2026-09-18T12:07Z, director seat summon objectstack-ai#24. Operative clause,
quoted:

> `scale` on a `percent` field means the DISPLAYED percentage-point
decimals — the
> landed objectui#9295 convention; the storage side derives: for a
fraction-stored
> percent (`percentScaleOf` = `fraction`) the objectql record
validator's
> `max_scale` branch allows `scale + 2` decimal places in the stored
fraction; the
> spec docblock states both; ⛔ no second member

The DISPLAY half of that clause is already landed in this repository and
is left
exactly where it was: objectui#9295 on the read-only cell, the grid
summary footer
and the record summary chip, objectui#9568 (PR objectui#9804) on this
widget, and
objectui#9808 (PR objectui#9919) on the out-of-range width both faces
take. This
branch re-derived all of it by symbol on today's `origin/main` and moved
none of it.

What was NOT landed is this widget's ability to MEET the derivation.

## The defect — our own arithmetic, not the author's value

`PercentField` converted a typed percentage-point value to its stored
fraction with
`n / 100`. Division by 100 is not representable in binary floating
point, so the
quotient carried residue nobody typed. Measured over the whole step grid
a
`scale: 2` percent field offers (`0.00` through `100.00`, 10001 values),
2760 of
them — 27.6% — convert to a stored fraction of 16 to 19 decimal places:

| typed (the step this widget offers) | stored before | decimal places |
stored now |
|---|---|---|---|
| `66.67` | `0.6667000000000001` | 16 | `0.6667` |
| `99.99` | `0.9998999999999999` | 16 | `0.9999` |
| `29.97` | `0.29969999999999997` | 17 | `0.2997` |
| `8.35` | `0.08349999999999999` | 17 | `0.0835` |
| `0.07` | `0.0007000000000000001` | 19 | `0.0007` |

Those counts are the reading the platform's own instrument takes: the
objectql
record validator's `max_scale` branch counts decimal places off the
value's
`String()` form (its `decimalPlacesOf` helper), exponent folded in, and
**refuses**
a caller value exceeding the declared width — it never rounds (that
repository's
2026-08-11 ruling, restated in the branch's own comment). So each row
above is a
write this widget's own `step` attribute offers and the write path then
refuses,
against ANY declared width — which is the affordance objectui#9810 was
filed about,
surviving on the limb the ruling settled in this widget's favour.

## What moved

`fromDisplay`'s fraction arm now shifts the DECIMAL exponent two places
instead of
dividing: the result is the double nearest the decimal value the author
typed, so a
display value carrying `d` decimal places stores `d + 2` and no more.
The `whole`
arm (a field declaring `max > 1`) keeps its identity conversion — there
the typed
number IS the stored number, so there is no arithmetic of ours to
correct, and the
ruling derives `scale`, not `scale + 2`, for that storage scale.

⛔ **It is not a rounding, and that boundary is pinned in both
directions.** An
author who types finer than the declared width (`12.345` into a `scale:
2` field)
still stores every digit they typed and is still refused upstream. That
is the ruled
behaviour: a widget-side rounding would convert the platform's refusal
into the
silent data alteration the platform explicitly ruled out.

## Tests

`packages/fields/src/__tests__/PercentField.storedScale-9810.test.tsx` —
7 rows, all
driven through the rendered control (the box the author types into, and
the slider),
because the emission is what the defect is about:

- the residue table above, each row asserted as the exact double AND
within the
  ruled `scale + 2 = 4` places;
- a sweep of the whole `scale: 2` grid at every third step, whose
offender list must
be empty — the invariant is re-derived on every value it enumerates, not
sampled
  from a remembered list;
- MUST-NOT-CHANGE control: a value the old division already got right is
  byte-identical (`12.34` ⇒ `0.1234`, `50` ⇒ `0.5`, `100` ⇒ `1`);
- MUST-NOT-CHANGE control: the `whole` convention (`max > 1`) is
untouched;
- the no-rounding pin (`12.345` ⇒ `0.12345`, five places, still refused
upstream);
- `scale: 0`, and the slider path sharing the one conversion.

### Reverse verification — the ablation, with on-disk proof

Run from the committed fix, through `ablation-replace.mjs` (the sibling
repository's
tool, which proves the mutation landed by anchor count and blob hash
rather than by
an exit code), restoring `git checkout HEAD -- path`:

```
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 9cbb65b -> 76170b9ff3dc
  fromDisplay reverted to `n / 100`
  vitest: Tests  3 failed | 4 passed (7)
    x stores an ordinary two-decimal percentage point as the value it is
      -> expected 0.6667000000000001 to be 0.6667
    x holds for every display value the declared step offers
      -> expected [ ...(936) ] to deeply equal []       (936 offenders of 3334 enumerated)
    x emits the same exact fraction from the slider as from the input
ablation-replace: ok restored: blob == HEAD (9cbb65b) and `git diff HEAD` is empty
```

⭐ The direction is the ordinary one (red), and the SPLIT is the
load-bearing part:
the three rows that assert the repair go red, the four control rows stay
green — a
pin that also went red on its controls would be pinning the mutation,
not the fix.

### Gates — hand-derived, exit codes captured to disk before any pipe

⚠️ `dispatch-gates.mjs` refuses for this repository (it derives families
from the
sibling objectstack tree it runs in), so this list is hand-derived from
this repo's
own root `package.json` scripts and `.github/workflows/`, and that is
declared rather
than dressed up as a tool reading.

| run | exit |
|---|---|
| `pnpm exec vitest run packages/fields/` (whole affected package, under
the shared verify lock) | 0 — `Test Files 173 passed (173)`, `Tests 2964
passed (2964)`, lock VERDICT `command-exit 0` |
| `pnpm exec vitest run
packages/fields/src/__tests__/PercentField.storedScale-9810.test.tsx` |
0 — 7 passed |
| `pnpm --filter '@object-ui/fields^...' build` (dependency closure,
under the lock) | 0 |
| `pnpm --filter @object-ui/fields type-check` (`tsc --noEmit` AND `tsc
-p tsconfig.test.json`, so the new test is inside the typed population)
| 0 |
| `node scripts/check-changeset-presence.mjs` | 1 BEFORE the changeset
(lit control: the gate does see this diff), 0 after |
| `node scripts/check-changeset-fixed.mjs` ·
`check-changeset-no-major.mjs` · `check-changeset-claims.mjs` ·
`check-pending-changeset-literals.mjs` | 0 · 0 · 0 (re-run after
committing the changeset, so its corpus is 1 and not 0) · 0 |
| `node scripts/check-control-bytes.mjs` | 0 |
| `node scripts/check-new-cross-file-line-citations.mjs` (Line Citation
Gate, differential) | 0 |
| `node scripts/check-test-path-roots.mjs` | 0 |
| `check-vi-mock-specifiers.mjs` · `check-vi-mock-inherit.mjs` ·
`check-vi-mock-override-shape.mjs` | 0 · 0 · 0 |
| `node scripts/check-unreferenced-sources.mjs` | 0 |
| `node scripts/check-component-surface-parity.mjs` ·
`check-spec-symbol-derivation.mjs` · `check-phantom-dependencies.mjs` |
0 · 0 · 0 |
| `grep -naP` for control bytes over the three changed files (beyond the
gate) | 1 = no hits |

**Lint — a DECLARED narrowing, with the three readings that make it a
measurement:**
`pnpm exec eslint --no-inline-config --format json` over the two changed
source files
exited **0** (0 errors; 8 `no-explicit-any` warnings, all on lines this
diff did not
add — `--max-warnings` is deliberately unset in `lint.yml`). ① The
population is read
from eslint's own config, not guessed: its typed block is `files:
['**/*.{ts,tsx}']`
and the top-level `ignores` block leaves only build output out. ② The
file count is
read from the `--format json` output: 2 files. ③ Invariance for
untouched files: the
config enables NO type-aware linting (`tseslint.configs.recommended`, no
`parserOptions.project` and no `projectService` anywhere in
`eslint.config.js`), so
nothing in this diff can move a verdict on a file it did not touch. The
repo-wide
`turbo run lint` remains CI's run, never this branch's.

**NOT MEASURED, with reasons** (⛔ read as neither green nor red):
`node scripts/check-readme-exports.mjs` exited 1 with `packagesRead:
found 10, floor
is 25` and `run pnpm build first` — a PREREQUISITE NOT MET on a tree
where only the
`@object-ui/fields` dependency closure is built, ⛔ not a finding: this
diff adds no
export and touches no README. `check:dist-completeness` and the full
repo `pnpm test`
are the same class (whole-tree build / whole-farm run, CI's). Playwright
e2e: not
run; this widget's browser-measured rows already live in its sibling
pins.

## Acceptance notes

**① The PM's mechanism assumption is FALSIFIED, and the card's own
headline reading
is now a stale address.** The dispatch's reading — the percent edit
widget reads
`precision ?? 2` while the cell reads `scale ?? 0`, so a field declaring
neither
renders two widths — does not hold on today's `origin/main`. PR
objectui#9804 landed
that member swap on 2026-09-18T14:58Z and PR objectui#9919 landed the
width clamp at
19:42Z, both AFTER the readings on this card were taken. Re-derived by
symbol, not by
line: this widget resolves ONE width, from `scale`, guarded with
`typeof` so
`scale: 0` survives. The card's filer declared its readings unverified;
on the
`precision`-versus-`scale` limb they were correct WHEN TAKEN and are now
historical.

**② The one divergence that remains is another card's, and it is in the
decision
box.** With nothing declared, this widget still keeps its own `2` while
`PercentCellRenderer` spells the same absence `0`. That is
objectui#9843, which is
open, asks the maintainer for a letter (its option A declares a default
in
`@objectstack/spec`; option B changes this widget), and is therefore ⛔
not touched
here and ⛔ not referenced with any keyword that would close it. Its
subject is the
DEFAULT when nothing is declared; this branch only changes what happens
to a value
that HAS been typed, so the two do not overlap in either direction.

**③ The upstream half of the ruling is an objectstack change, to FILE
and ⛔ never to
patch from here or to compensate for on the consumer side.** Re-derived
at source on
the sibling checkout's `origin/main` (commit `4efb988`):
`percentScaleOf` in
`packages/spec` resolves `fraction` unless `max > 1` and its docblock
states nothing
about `scale`; the objectql record validator's `max_scale` branch
compares
`decimalPlacesOf(n)` against `def.scale` with NO percent arm. So the
ruled
`scale + 2` allowance is not live yet — the spec docblock clause and the
validator
branch plus its per-storage-scale pins are still owed there, which the
ruling's own
Execution section assigns to the spec seat's vertical dispatch. Filing
class **(b)**,
a declared contract not matched by the implementation. Dedupe words for
whoever
files it: `max_scale percent fraction scale+2` · `record-validator
percent branch
derived storage scale` · `FieldSchema scale docblock percent displayed`.
⚠️ This branch does NOT depend on that landing: today the residue values
are refused
by `max_scale` for the same reason, only sooner, so the repair is
correct before and
after it.

**④ Noted, ⛔ not filed.** `dataset-format.ts` in `@object-ui/core`
describes this
widget in a comment as one that "divides input by 100". The sentence
stays true as a
statement about MAGNITUDE (that is still the conversion), only not about
the
operation, and it is outside this card's file surface. Successor who
will meet it:
whoever next edits that formatter's percent path — ⛔ no PR is pending on
it today.

**⑤ Scope held.** `packages/types/src/` was excluded by the dispatch
(objectui#8345
and objectui#9511 are in flight there) and was not touched: `scale` is
already a
declared member of `PercentFieldMetadata` (objectui#9784), so nothing
was owed there.
The one file outside the declared `packages/fields/src/` surface is the
changeset,
which this repo's `changeset-presence` gate mechanically requires — its
lit-control
exit 1 above is the evidence it was owed.

**⑥ The orphan branch was ⛔ not built on.** A remote branch from the
abandoned
2026-09-18 claim exists under a different name; nothing was merged,
cherry-picked or
adopted from it. Its predecessor report on the card was read as
information only,
and every reading reproduced here was re-taken in this worktree.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QVJUngS9FKfuyQ9NFR2Nbn)_

---------

Co-authored-by: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – objectui-site — c38e8336 Deployed Jan 23, 2026 by vercel[bot]
Preview – objectui-docs — c38e8336 Deployed Jan 23, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants