Repository navigation
Commit c7174c3
fix(ui): record page polish — dates read as dates, Save is the primary, new detail lines start on their defaults, no band above the tabs (#35937)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuNEeCbXSi4Z8618BgVLuSfe)_
Fixes #35745
Fixes #35816
Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: none — no skill text describes the record page's date face,
its edit-state buttons or a new detail line's start values; a field's
`format` and `defaultValue` keep the meaning the skills already teach
## 维护者速读
- 记录详情页上:日期直接写成日期(悬停才显示"5
天前"),页签上方不再空出一大块,编辑时"保存"成了唯一的实心按钮,主从明细新加的一行一开始就带好默认值、不再一片红。
- 属于「记录详情页重做」专题,替日常录入和查看记录的业务用户解决读日期要换算、误点取消、新行假报错的问题。
- 出错时最坏是某处日期或按钮样式不对、或新行默认值没带上,保存请求和事务都没动,可以直接撤回本次改动。
- 无。
## What changes
Four record-page fixes, one PR (the two cards were folded by the seat).
**#35745 — business dates as dates.** `DateCellRenderer` gains an
`absoluteDate` cell prop: with no declared `format`, the cell writes the
date (with its year) and keeps the relative phrase as the `title`, the
same face a grid column already uses (`inGridColumn`, #25884).
`DetailSection` and `HeaderHighlight` pass it, so the record page's
field sections and highlights strip read like the list beside them. A
declared `format` (`'relative'` included) still wins; an overdue
deadline still reads red, with "Overdue 5d" as the tooltip. A `datetime`
field with no `format` already paints the compact absolute face (its
cell's default, never the relative phrase); a test now pins that on the
record page too. The record footer's created/modified times and card
surfaces are untouched.
**#35745 — the band above the tabs.** The page scroller
(`RecordDetailView`) and `RecordPageColumns` each padded their top 24px
on desktop, stacking a 48px band between the header and the tab row. The
scroller now pads sides and bottom only; `RecordPageColumns` keeps a
12px top at every width. The print chrome and the approval-fallback
actions bar above the columns take `mt-3` so they keep their spacing. An
authored page the page renderer draws (no `RecordPageColumns` root, a
print page included) keeps the renderer's own `p-3 md:p-4 lg:p-6`, so it
still starts clear of the header (24px on a desktop, from 48); the
loading, error, not-found and forbidden states are early returns of the
view and never render inside the scroller. Side padding is unchanged.
**#35816 — Save is the primary button.** `sys_record_edit_save` declares
`variant: 'primary'`, and `page:header` now lets a host button that
declares `variant: 'primary'` be the primary, in the place the host gave
it (Cancel, then Save). No other host button declares a variant, so
every other header ranks as before.
**#35816 — a new detail line starts on its defaults.**
`RecordBodyTableEditor` computes the child object's static defaults with
`schemaDefaultValues` (the values a create form seeds) and hands them to
`LineItemsField` as `newRowValues`; the ghost line starts on them. A new
line's empty required cell reads red only once a save was refused
(`newRowRequiredShown`), so the server's reason and the red cell arrive
together; a stored line is flagged as before. A line `Add` starts on
`newRowValues` carries `UNTOUCHED_NEW_ROW` (a symbol key:
`Object.entries`, `JSON.stringify` and so every payload skip it) until
its first edit; `isBlankRow` treats a marked line as blank, so a line
added and left as it came is skipped at save, while a line the user
edited is judged by its values alone and is saved even when every typed
value equals a default. `@object-ui/fields` exports `UNTOUCHED_NEW_ROW`
and `isUntouchedNewRow`. Server-resolved defaults (`NOW()`, CEL) are
left to the server. The batch request and transaction are unchanged.
## Tests
- Added: `DetailSection.dateYear-27520` (#35745: past / today / future
date, highlights strip, declared `relative` wins, CONTROL bare cell);
`RecordPageColumns` (root padding pinned); `page-header-primary-12617`
(#35816: Cancel then Save with Save the only filled button; Save stays
primary beside page actions, one declaring `variant: 'primary'`
included; CONTROL with no host primary the first page action leads);
`GridField` (#35816: Add and the entry line start on the host's values;
a line Add started is marked untouched until its first edit, even an
edit back to its default; CONTROL with no `newRowValues` no mark; a new
line's empty required cell waits for the host's word while a stored line
is flagged; CONTROL without that word a new line is flagged at once);
`RecordBodyTableEditor.recordEditBatch-35599` (#35816: an untouched new
line is skipped, a line with input created with its default; a line
edited back to exactly its defaults is created; the mark never reaches a
write payload); `DetailSection.dateYear-27520` also pins a `datetime`
field reading as its date in a section row and the highlights strip;
`RecordDetailView.topInset-35745` (mounted through the view: an authored
page pads its own top under a scroller that pads none, CONTROL the
scroller keeps sides and foot; a print page's chrome takes its top
margin); live e2e `ui/e2e/live/record-page-polish-35745.spec.ts`
(showcase Expense Report on the real stack: tabs ≤ 12px under the
scroller top, the date and its tooltip, Cancel then Save with Save the
only filled button, a new line on Other / Submitted with no red cell,
and an added untouched line not stored).
- Migrated: `recordPage.deadlineSettled-11815` — the record page now
writes the absolute date, so its text assertions read `formatDate(iso,
undefined, { alwaysShowYear: true })` and the relative phrase ("Overdue
5d" / "5 days ago") moved to the tooltip assertion. Same records, same
red/settled verdicts.
- Voided: none.
- Ablations (each restored, tree clean): `absoluteDate` removed from
`DetailSection` → 3/9 red; `hostPrimary` forced undefined → 2/8 red;
`!newRowWaits` removed from `GridField` → 1/54 red; `newRowValues`
dropped from `isBlankRow` → 1/7 red. Rework: scroller padding back to
`p-3 sm:p-4 lg:p-6` plus print chrome `mt-3` removed → 2/2 red
(`topInset-35745`); `DateTimeCellRenderer` default `'compact'` →
`'relative'` → 1/10 red; `touched(r)` removed from `GridField`'s edit
path plus the mark check removed from `isBlankRow` → 2/64 red; under the
live spec, scroller padding back → red (tabs 36px under the scroller
top), mark check removed → red (the untouched line is sent, the save is
refused, the edit state stays).
## Acceptance notes
- #35853 (header two rows, seat 5) had not landed when this was built,
so this is on current `main`; `overlap-check` shows it merging cleanly
with #35910 and #35921, the open PRs sharing `RecordDetailView.tsx`. The
header and band hunks were done last, and keep off the breadcrumb/frame
hunks #35853 changes.
- The branch is a harness-assigned `claude/project-thread-*` name.
- The horizontal double inset (scroller + columns, 48px on each side at
desktop) is left as it is; this PR removes only the vertical band the
card names.
- On a 375 phone the title block sits inside the page; title block →
tabs is 16px (the page's own gap), page top 12px.
- `buildDefaultPageSchema.ts` and the save transaction are untouched.
- Follow-up: #35940 (new MasterDetailForm rows: prefill defaults, no
early required flags)
- Review rework (L2 record 7050830297, S1–S4): S1 a `datetime` field is
pinned absolute; S2 the other pages the scroller hosts are checked and
one is pinned through the view; S3 a line is skipped only while
untouched, by the mark above, instead of by comparing its values with
the defaults; S4 the claimed `ui/e2e` spec is added under `e2e/live`,
since the band only shows in real layout. The L2 nit and L1-c's two nits
ride #35940.
Read first (by risk):
`ui/packages/components/src/renderers/layout/containers.tsx` (the
primary pick — every record header goes through it);
`ui/packages/fields/src/widgets/GridField.tsx` (`newRowWaits` in the
invalid computation); `ui/packages/plugin-form/src/masterDetailTx.ts`
(`isBlankRow`).
Two-minute check: open any Expense Report record, click Edit → the
header reads Cancel (outline) then Save (filled); Add line in Expense
Lines → the new line shows Other / No / Submitted and no red cell.
## Verification
Browser evidence (light and dark, 1280 desktop and 375 phone, showcase
app on a fresh seed) is in the project's evidence folder; readings
below.
<details><summary>Browser readings</summary>
- Gap header → tabs: before 48px (92 → 140), after 12px (92 → 104) on
four records, light and dark; phone 16px.
- Submitted On (date, no format): Nov 15, 2026 / tooltip "5 days ago";
Nov 19 / "Yesterday"; Nov 20 / "Today"; Nov 25 / "In 5 days" — desktop
and 375, light and dark. Footer keeps "Created 9m ago".
- Edit state: Cancel outline then Save filled, desktop header and 375
bottom bar, light and dark.
- New line: prefilled Other / No / Submitted, 0 red cells; Amount only →
Save → `400 VALIDATION_FAILED`, merchant cell red "Merchant is
required", list "Row 3 · Merchant: Merchant is required", still in edit
state; Merchant filled → stored with status `submitted`; an untouched
added line → save succeeds, no line created.
</details>
<details><summary>Unit tests and type-check (under the verify
lock)</summary>
- `@object-ui/fields` 308 files / 4688 passed; `@object-ui/plugin-form`
241 / 2697; `@object-ui/plugin-detail` 393 / 3606;
`@object-ui/components` 492 / 4733; `@object-ui/app-shell` 2350 / 22040
— all exit 0; `type-check` exit 0 in all five.
- After merging `main` (643fe3b): the six touched test files plus the
`components` tests `main` changed — 12 files / 156 passed;
`check:type-check-debt` (with `--re-measure`) OK.
- Rework head `1f0b5268`: `@object-ui/fields` 308 files / 4690 passed;
`@object-ui/plugin-form` 241 / 2698; `type-check` of fields,
plugin-form, app-shell and `type-check:e2e` exit 0;
`DetailSection.dateYear-27520`, `RecordDetailView.topInset-35745`,
`RecordDetailView.appendInset-27520` 3 files / 14 passed; the live spec
passed against a local showcase stack (1 passed, 9.5s).
</details>
<details><summary>Card gates (dispatch-gates)</summary>
- `dispatch-gates --ran`: 40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN.
39 exit 0 at head `0baf37d5`. On the rework head `1f0b5268` the same 40
re-derived and re-run: 40 exit 0, `vitest run scripts/` included (it
completed this time against the built console).
- `overlap-check` on `1f0b5268`: clean against `main` and #35910,
#35921, #35938; `check:test-source-alias` and `check:nul-bytes` OK.
- `pnpm --dir ui exec vitest run scripts/`: NOT MEASURED locally — with
the console closure built (76/76 turbo tasks), the run was OOM-killed by
the container's memory limit; CI's lint workflow runs it on this head.
- `check:test-source-alias` first flagged
`page-header-primary-12617.test.tsx` (it reaches the react runtime's
dynamic import during a clocked case); fixed with the module-top import
the gate names, re-run exit 0.
- `overlap-check`: clean against `main` and #35910, #35921.
`check:nul-bytes` OK.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgVhfKtUtFdDWNgeCCE
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgVhfKtUtFdDWNgeCCE -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6b360ab commit c7174c3
18 files changed
Lines changed: 771 additions & 26 deletions
File tree
- .changeset
- ui
- e2e/live
- packages
- app-shell/src/views
- components/src
- __tests__
- renderers/layout
- fields/src
- widgets
- plugin-detail/src
- __tests__
- plugin-form/src
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
0 commit comments