Repository navigation
Commit 1c87956
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
Fixes #35688
Part of #36023
Fixes #35794
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu4DWfHGqeYFBSRSfZ4TnYTH)_
repo:objectstack#1 · os-sales · session_01L6bhgTJobxYSxskrNbCuHE
Slice S3 of #35688 (S1 #35990 and S2 #36018 merged), folded with the
in-place input part of #36023. #36023's remaining work, which this PR
leaves alone, runs in parallel slices: S4 covers Enter/Esc, panels below
the cell and the validation popover; S5 covers the form line-item grid.
#35794's two text fixes ride along (claimed into this PR, comment
7061527510).
Clause-②: yes (widening): `GridCellFacts` (exported from the
`@object-ui/components` entry) gains one optional key, `stars?: number`,
measured on the built `dist/context/gridCellSelection.d.ts`. Nothing is
removed or narrowed. No i18n key is added.
Metadata-protocol: none
## 维护者速读
- 列表里编辑文本、邮箱、电话、网址、数字、金额、百分比:格子本身变成输入框,高度就是一行,没有圆角、阴影和内框,只剩选中格那圈 2px
边。字多了向右变宽,盖住右边的格子,但不挤动它们,行高不变。
- 数字、金额、百分比靠右对齐,显示原始数字。金额前面标币种(如 USD),百分比显示「50 %」,去掉了滑块。
- 查找、主从、用户字段:进入编辑直接展开可搜索的列表(最近用过的在前),点一下就保存。列表下方有「浏览全部记录」(打开完整选择器)和「清空」。
- 评分:选中格子后直接按数字 1–5 设星,0 或退格清空;在已选中的格子里点第几颗星就是几星。不弹编辑框。
- 富文本、公式、自动编号、附件:按回车会提示原因(例如「列表里不能编辑,请打开记录」)。
- 「最近用过」按登录用户分开记录,同一浏览器里两个账号不再共用。
- 回车和 Esc 的行为、面板位置、校验提示不在这个 PR 里,由并行的 S4 处理(Sales 09:40
已定:回车保存并留在原格;多选和标签按 Esc 仍是放弃)。
## What changes
**Flat in-cell input face** (`@object-ui/fields`):
- New `InCellTextInput` (`widgets/InCellTextInput.tsx`, not on the
package entry). Its height is the layer's anchor height less the 2px
frame, with no border, fill or radius, 13px text and the cell's inset.
An invisible copy of the text sizes the box and the input lies over it,
so the `w-max` layer widens to the right without the input's intrinsic
width inflating it. Props: `align` (`end` = right-aligned tabular
digits), `leading` and `trailing` (muted adornments), and `below` (a
refusal line inside the layer).
- `TextField` (except password, textarea and currency-code branches),
`EmailField`, `PhoneField`, `UrlField`, `NumberField`, `CurrencyField`
and `PercentField` draw it when `inCell` is set:
- Number, currency and percent are `type="number"`, right-aligned, and
keep `readBadInput` and the `BadInputMessage` refusal (drawn under the
row).
- Currency puts its code first, keeps blur rounding and draws no
home-amount preview in the cell.
- Percent shows points, draws `%` after and has no slider.
- `RatingField` `inCell`: smaller stars in a 28px row, no "n / max"
caption. `RatingCellRenderer` stars carry `data-rating-star={n}`.
**Layer** (`@object-ui/components`, `dataTableCellOverlay.tsx`):
- `has-[[data-in-cell-face=input]]` drops the layer's padding, radius
and shadow, keeps a 2px border on the page background, and sets its
minimum height to the anchor height.
- Radius and shadow carry `!`, because the console theme rounds and
lifts every `[role=dialog]` with `!important`
(`apps/console/src/index.css`), and the layer is a Radix popover. An
important utility sits in a cascade layer and outranks the unlayered
rule. This was found in the browser and is not reproducible in jsdom.
- The density rule that sets inputs to `h-8` skips
`[data-in-cell-input]`.
**Grid** (`data-table.tsx`, `ObjectGrid.tsx`):
- The built-in number and text editors use the same flat face, with
numbers right-aligned.
- `builtInEditorWidthClass` and `cellEditorWidthClass`:
- The typed kinds start at `w-full`, the cell's own width, where S1 had
`min-w-40`.
- Select, status, date and datetime keep `min-w-56`.
- Rating on a select-first grid:
- `describeCell` adds `stars` (the field's `max`, default 5) for
`rating` fields.
- `attemptEdit` opens no editor for such a cell.
- A digit sets `min(digit, stars)`, and 0 clears. A digit sets at most
9, so the top of a wider scale is set by a click. The `stars` fact is
floored before its `> 0` test.
- Backspace and Delete clear.
- A click on a `data-rating-star` of the already selected cell sets that
count.
- Every one of these writes through `writeCell`, so it saves and undoes
like any cell write.
**Record pickers** (`LookupField`, `PeoplePicker`, `recentLookups`):
- `LookupField` with `inCell` (and not disabled) renders its panel body
inline in the layer, not in a portal popover, because the layer's focus
loop would take focus back from a portal.
- Search variant: `PeoplePicker` gets the new `embedded` prop.
- Classic variant: the same body as the form popover, with recents,
results, show-all and quick-create.
- After the list come Browse all records (`browse-all-records`, gated by
`dependsOn` like the form's button) and Clear (`lookup-in-cell-clear`,
while a value is held). A single pick in Browse all's dialog ends the
edit as a list pick does: `handleDialogSelectRecords` calls `onCommit`
after the declared targets fill. A multiple pick stages.
- A `dependsOn` gate shows as a hint in place of the list
(`lookup-in-cell-gated`).
- A single pick calls `onChange`, then `onCommit`. A multiple pick
stages. Enter that picks calls `stopPropagation`, so the grid's wrapper
does not commit a second time with the pre-pick value.
- `recentLookups` keys the ring as `<prefix><userId>:<object>` when a
user is signed in (`usePermissions().userId`). With no user, the key is
unchanged. Rings stored under the old object-only key are not read, so a
signed-in user's recents start empty once after the upgrade.
**Text (#35794)**:
`docs/qa/platform-checklist/areas/records-forms.json`.
`form-view-gallery` and `v18-semantic-defaults` move to revision 9, with
history entries, and now describe the select-first list with no switch.
`examples/app-showcase` Task Desk text: "Click a task's title to edit it
in a drawer".
## Why
Card #35688 sets this target:
- Typed values are edited in the cell.
- Numbers are raw and right-aligned.
- Currency shows its code, and percent has no slider.
- A lookup or user opens its searchable list at once and commits on the
pick.
- A rating is set in place.
- Read-only kinds say why they can't be edited.
#36023 adds that the row height does not change and the cell itself is
the input, with no inner box. S1 put every editor on a layer over its
cell, and S2 gave the pickers their in-cell faces. This slice gives the
remaining kinds theirs.
## Tests
- New in `ui/packages/fields/src/__tests__/inCellFaces-35688.test.tsx`:
- The seven typed faces are flat, with alignment, code, `%` and no
slider, and a bad number refusal.
- Rating `inCell`.
- The in-cell record picker opens at once, a pick commits, multiple
stages, and Enter does not reach the grid.
- The people picker is embedded.
- Clear.
- CONTROL form faces for text, number and lookup.
- New in `ui/packages/fields/src/widgets/recentLookups.test.ts`:
per-user rings, and the CONTROL key with no user.
- New in
`ui/packages/components/src/__tests__/data-table-cell-overlay-35688.test.tsx`:
- The layer drops padding, radius and shadow for the input face.
- Rating digits, Backspace and the star click on a selected cell.
- Enter, F2 and double-click open no editor for a rating.
- CONTROL: a non-rating cell still opens its editor on a digit.
- Changed in the same file: test 3 now expects no `min-w-40` on a typed
editor. The typed kinds now start at the cell's width.
- New in
`ui/packages/plugin-grid/src/__tests__/inCellSelectMultipleRouting-35688.test.tsx`
(real `ObjectGrid` → `data-table` → fields): a lookup pick ends the
edit; a single pick in Browse all's dialog closes the editor and saves
`{ tier: 'silver' }` through `ds.update` (fails with the commit
removed); a rating digit saves through `ds.update`.
- Changed in
`ui/packages/plugin-grid/src/__tests__/gridDependentValues-7165.test.tsx`,
`lookupPickerKeys-7154.test.tsx` and
`relationalMetaCopySet-7166.test.tsx`:
- The cell's lookup editor is now the open list, with no trigger button
to press, so `openEditor` returns the in-cell panel and Escape is sent
where focus is.
- Every claim stays, with its control: `dependsOn` gates (hint, Browse
all disabled, no options) and scopes the query; `multiple` accumulates
(two `aria-selected` rows) while single replaces; `allowCreate`;
`lookupPageSize` through Browse all (3 rows against the default 10); and
`descriptionField`, `lookupColumns` and `lookupFilters`.
- No case deleted.
- Changed in
`ui/packages/plugin-grid/src/__tests__/inlineEditExitMode.test.tsx`: the
two lookup exit-mode cases pinned the popover era, where a pick staged
and a click outside committed. They now pin the in-cell list: a pick
lands and closes the editor, a press inside the open list keeps it, and
a press outside exits (CONTROL). The four text-editor cases are
unchanged.
- Changed in
`ui/examples/schema-catalog/test/form-field-channel-census-12130.test.tsx`:
the `inCell` and `onCommit` ledger rows name the 13 widgets that now
read them.
- Local runs (before the last Browse all and theme commits):
| Package | Result |
|---|---|
| `@object-ui/fields` | 4,780 passed, 7 skipped |
| `@object-ui/components` | 4,798 passed, 24 skipped |
| `@object-ui/plugin-list` | 1,965 passed |
| `@object-ui/plugin-grid` | 2,610 passed, 11 failed |
The 11 plugin-grid failures were the three picker suites above. After
the fix they pass (14 of 14), and `inCellFaces-35688` with the grid
routing test passes (34). The overlay test passes after the theme fix
(12).
- `tsc --noEmit` is clean for fields, components and plugin-grid. eslint
on the changed files: 0 errors.
- `node scripts/check-platform-checklist.mjs` passes.
## Acceptance notes
- The S3 claim leaves out Enter and Esc behaviour, panel position and
look, and the validation popover. Sales ruled at 09:40Z, for S4: Enter
saves and stays in the cell, and multi-select and tags Esc discards.
- Rich text stays a preview plus a hint to edit on the record page
(fable-reviewed D1). Rich text, formula, rollup, autonumber and
attachment already say why on Enter through `grid.readOnlyReason.*`, so
they need no code. Measured below.
- Browser findings that predate this PR, not fixed here (the row-height
one goes to S4 under #36023, comment 7062043119; the other two are on
#36046):
- **Row height.** A user cell's avatar (`size-8` in a `py-1` cell) makes
its row 41px where other rows are 32px. Opening that cell's editor swaps
the chip out, and the row drops to 32 (#36023 「行高不变」).
- **Raw id after a pick.** After a user pick, the cell draws the bare id
(`UnresolvedUserReference`) until the row is fetched again. A lookup to
an ordinary object shows its name.
- **Initials.** The people list's initials for "Ada Auditor (demo)" read
"A(".
- Safari and the pinyin IME are not measurable in this container.
- Overlap (`scripts/pm/overlap-check.mjs`, clean): #36033 (data-table,
fields index), #36026 (records-forms.json) and #36024 (ObjectGrid) all
merge cleanly. S4 and S5 share data-table, ObjectGrid and LookupField;
whichever lands second merges main.
## Verification
Browser: showcase field zoo with a temporary 22-column view, name column
frozen (not in this pull request), in Chromium. Runs at 1280 light, 1280
dark and 768 light; at 375 the list is the phone card list, with no
in-cell editing. Script, screenshots and readings are in the project
folder `build-seat1/35688/S3/` (`s3.cjs`, `shots/`,
`browser-evidence.md`).
| Reading | this branch |
|---|---|
| text, email, url, phone: F2 | layer = cell box exactly (x, y, width,
height); radius 0, no shadow; input transparent, 13px, focused; row 32 →
32 → 32 after Esc |
| text, email: type a long tail | layer widens right (176 → 406px), left
edge fixed; row 32 |
| number / currency / percent | right-aligned; `7`; `USD` before an
empty amount; `50` with `%`; row unchanged |
| rating, selected: 3, click 5th star, Backspace, 4 | 3 → 5 → 0 → 4
stars, no layer, cell stays selected, saved |
| lookup (account): Enter | list 512×330, search focused, rows with
preview lines, Browse all records + Clear; pick "Hooli" saves, layer
closes, cell shows Hooli; row 32 |
| user: Enter, pick | people list, search focused; pick saves and closes
(raw id shown till reload, see notes) |
| lookup: Browse all, type "Wonka" in the dialog, pick | dialog 10 rows
→ 1; focus stays in the dialog's search; pick closes dialog and editor,
"1 row saved", cell shows Wonka Brands, row 32, kept after reload |
| rich text / formula / autonumber: Enter | no layer; "This field can't
be edited in a list. Open the record to change it." / "This value is
calculated, so it can't be edited." / "This field is read-only." |
| dark | same readings; flat face on the dark page background |
Two-minute check: open any list with a number column, select a cell and
press F2 (the cell itself is the box, right-aligned, row height
unchanged). Then select a rating cell and press 4.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the 维护者速读 block is the
maintainer's summary, in the maintainer's language).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgTJobxYSxskrNbCuHE)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgTJobxYSxskrNbCuHE
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgTJobxYSxskrNbCuHE -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 615d995 commit 1c87956
29 files changed
Lines changed: 1188 additions & 334 deletions
File tree
- .changeset
- docs/qa/platform-checklist/areas
- examples/app-showcase/src/ui/pages
- ui
- examples/schema-catalog/test
- packages
- components/src
- __tests__
- context
- renderers/complex
- fields/src
- __tests__
- widgets
- plugin-grid/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
| 965 | + | |
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
994 | | - | |
| 994 | + | |
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1100 | 1106 | | |
1101 | 1107 | | |
1102 | 1108 | | |
| |||
6510 | 6516 | | |
6511 | 6517 | | |
6512 | 6518 | | |
6513 | | - | |
| 6519 | + | |
6514 | 6520 | | |
6515 | 6521 | | |
6516 | 6522 | | |
| |||
6530 | 6536 | | |
6531 | 6537 | | |
6532 | 6538 | | |
6533 | | - | |
6534 | | - | |
| 6539 | + | |
| 6540 | + | |
6535 | 6541 | | |
6536 | 6542 | | |
6537 | 6543 | | |
| |||
6549 | 6555 | | |
6550 | 6556 | | |
6551 | 6557 | | |
6552 | | - | |
| 6558 | + | |
6553 | 6559 | | |
6554 | 6560 | | |
6555 | 6561 | | |
| |||
6623 | 6629 | | |
6624 | 6630 | | |
6625 | 6631 | | |
| 6632 | + | |
| 6633 | + | |
| 6634 | + | |
| 6635 | + | |
| 6636 | + | |
| 6637 | + | |
6626 | 6638 | | |
6627 | 6639 | | |
6628 | 6640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
316 | | - | |
317 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
318 | 324 | | |
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
324 | | - | |
325 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
0 commit comments