You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 73f3abb
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ui): the approval request page heads the submitted record's field groups as real sections, with section links (#34743)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBU5y97XtBcJ8qSLSR3B3Djd)_
repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs
Closes#34707
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
改了什么:审批请求页「提交时的内容」卡片里,每个字段分组的名字改成真正的分组标题(和记录页同一套样式:加粗、前景色、组图标、下方细分隔线,组间距明显大于字段行距);记录有两个及以上带标题的分组时,卡片顶部多一条分组导航,点分组名滚到该组。
- 为什么改:原来分组名是 12px 灰字,和 11px 灰色字段标签几乎一样,40
多个字段连成一片,看不出分组(维护者原话:「还有审批单显示记录所有字段的时候是不是没有带分组」)。
- 风险与回滚:只动审批页这一张卡片的标题与导航,不改显示哪些字段、字段顺序和「已改动 / 当前值」标注;没有新导出、没有新翻译键。回滚即
revert 本 PR。
-
先看:`ui/packages/app-shell/src/views/approval-decision/SubmittedRecord.tsx`
的 `SectionHeading` 与 `SectionNav` 两个组件,以及卡片正文里调用它们的那段。
- 两分钟验证:打开 showcase 的审批收件箱,点「Expense Report Sign-off」,卡片顶部应有「Report ·
Totals」导航,下面两个加粗分组标题带分隔线;点「Totals」滚到该组;手机宽度标题不截断。
- 需要你做的:无,席位落地。
## What changes
On the approval request page, the "As submitted" card
(`SubmittedRecordCard`) now:
1. **Heads each titled section as a real heading.** A level-4 heading
(the card's own "As submitted" is level 3), in the default record page's
section face: plugin-detail's `DetailSection` frameless title row
(semibold, foreground colour, the group's declared icon, a hairline
under it). `DetailSection` cannot be reused here: it renders its own
fields and has no slot for this card's "Changed / Current value" cells,
and its header is not exported on its own. So `SectionHeading` repeats
that header's classes, with one change: the title wraps (`break-words`)
instead of `truncate`, so a long group name is not cut off at phone
width (the card's acceptance 3). Sections are now `space-y-6` apart,
double the field row gap.
2. **Keeps every section open.** Unchanged behaviour, now pinned: a
group declared `collapse: 'collapsed'` is drawn open, with no disclosure
control.
3. **Adds section links when there are two or more titled sections.** A
strip of section names at the top of the card; a click scrolls that
section's heading into view. One titled section draws no strip. The nav
is named by the card's own "As submitted" heading (`aria-labelledby`),
so no i18n key is added.
`submittedRecordPlan.ts` carries the group's declared `icon` through to
the drawn section.
Not changed: which fields show, their order, and the "Changed" mark with
the current value. No exported symbol and no i18n key is added; both
modules stay internal to the package.
## Why
The section label was `mb-2 text-xs font-medium text-muted-foreground`
and the field label `text-[11px] text-muted-foreground`: one pixel and
one font weight apart, in the same grey, so a record with many groups
read as one run of fields.
## Tests
New top-level `describe` in the shared harness
`ApprovalDecisionPanel.fullRecord-34588.test.tsx`, "the submitted record
heads its sections and links to them (objectstack#34707)", five cases:
- each titled section is a level-4 heading under the level-3 "As
submitted", in the foreground face, not truncated, over a hairline; a
field label is not a heading;
- a group declared collapsed is drawn open, with no `aria-expanded`
control;
- two titled sections get a nav named "As submitted" with entries in
page order; a click calls `scrollIntoView` on that section's heading;
- CONTROL: one titled section draws its heading and no nav;
- field keys per section, their order, and the single "Changed" mark are
unchanged.
The existing #34588 cases (field set, order, marks, redaction) pass
unchanged.
## Acceptance notes
- **Reuse of the #34605 navigation.** The drawn strip of #34605,
`FormSectionNav`, lives in `@object-ui/plugin-form` and is not exported
from it (neither the package root nor `./core`). `@object-ui/components`
exports only the reporting contract (`FormSectionNavContext`,
`FormSectionNavItem`, `FormSectionNavSink`), which a `form` renderer
feeds; this card has no form renderer. Exporting `FormSectionNav` would
add an exported symbol and flip Clause-② to yes, so this PR does not.
`SectionNav` here is a module-internal component that types its entries
with `FormSectionNavItem`'s `key` / `label` / `anchorId` and uses the
same strip classes. It has no scroll-spy highlight and no error counts
(nothing here can be in error or folded).
- **The nav does not stick.** A sticky strip was tried in the browser.
The record page's scroller pads its content (`p-3`), so the scrolled
fields showed through in a 12px band above the stuck strip at 390px
width. The strip now sits at the top of the card.
- **Heading size.** The card says the record page uses 14px or larger
titles. The default record page's frameless face (the one an object
without a custom page gets) draws 13px semibold. This PR copies that
face, so the two pages match. `DetailSection` draws its 16px card face
only off the default record page or on a print page (it chooses with
`useDefaultRecordPage() && !isPrintPage`).
- **Seen in the browser, not part of this diff:** at 390px the record
page's absolutely positioned `ManagedByBadge` ("System-managed",
`RecordDetailView`) overlaps the card's "Open record" link. It was there
before this change and is reported to the seat.
## Verification
Head `39afff86a`. Readings below are from this worktree; CI runs the
full set.
<details><summary>Unit tests (approval-decision and its
importers)</summary>
`pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/views/approval-decision/
apps/console/src/pages/system/ApprovalsInboxPage.queueStepper-34586.test.tsx
packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts
packages/app-shell/src/views/__tests__/DeclaredActionsBar.approverFold-34361.test.tsx
packages/app-shell/src/__tests__/product-neutral-renderer.ratchet.test.ts`
`Test Files 12 passed (12)` · `Tests 136 passed (136)` · lock `VERDICT
command-exit 0`.
Narrowed on purpose: the whole `packages/app-shell/` suite (about 2,300
files) is left to CI's `Test UI`.
</details>
<details><summary>Typecheck</summary>
`pnpm --filter @object-ui/app-shell run type-check` (`tsc --noEmit` plus
`tsc -p tsconfig.test.json`, which compiles the tests): `VERDICT
command-exit 0`.
</details>
<details><summary>Ablation (two mutations, each restored and checked
against HEAD)</summary>
Run with `node scripts/ablation-replace.mjs` on the test file. The test
imports `SubmittedRecord.tsx` from source, so no build step was needed.
- Nav threshold changed from "fewer than 2 entries draws nothing" to
"fewer than 1": the CONTROL case failed (`1 failed | 11 passed`).
Restored blob matched HEAD and `git diff HEAD` was empty.
- `SectionHeading` replaced with the old `mb-2 text-xs font-medium
text-muted-foreground` div: the heading, collapsed, nav and CONTROL
cases failed (`4 failed | 8 passed`). Restored blob matched HEAD and
`git diff HEAD` was empty.
</details>
<details><summary>Browser (own stack: showcase backend --fresh on :4377,
Console vite on :5377, Chromium)</summary>
Seeded request "Expense Report Sign-off" (Report and Totals groups), and
a one-group request raised by retitling an announcement:
- Desktop 1400px, light and dark: two headings at 13px / 600, colour
rgb(2,8,23) in light and rgb(248,250,252) in dark. Field labels are 11px
/ 400, rgb(100,116,139) in light and rgb(148,163,184) in dark. The nav
shows Report and Totals.
- Phone 390px, light and dark: headings not truncated (scrollWidth
equals clientWidth); document width 390, so no sideways scroll. Clicking
Totals put its heading 12px below the scroller top.
- One-group request (Announcement) at 390px: heading drawn, no nav.
</details>
<details><summary>Local gate subset</summary>
Gates derived by `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` and checked with `--ran`: `38 derived, 38
run, 0 NOT-MEASURED, 0 UNRUN`. All 38 exited 0 on `4571eff5f`. The next
commit, `39afff86a`, changed only class strings and a comment in
`SubmittedRecord.tsx` and one changeset sentence. The families that read
those files' content were run again on `39afff86a` and exited 0:
`check:nul-bytes`, `check-adr-0087-registration`,
`check-changeset-no-major`, `check-empty-changeset`,
`check-closing-keyword-parity`, `check:published-files`,
`check:undeclared-dep-imports`, `check:cross-package-test-inputs`,
`check-comment-mask-corpus`. `check:new-line-citations` (ui) found 0 new
citations.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (eslint on the three
touched files: 0 errors).
- [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: not touched.
- [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, except the 维护者速读
brief, which is written in Chinese for the maintainer.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzgwLiKcfujYUug7sPs -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(app-shell): the approval request page heads the submitted record's field groups as real sections, with links to each
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
On an approval request page, the "As submitted" card drew each field group's name as small grey text, one pixel larger than the field labels and in the same grey, so a record with many groups read as one long run of fields.
11
+
12
+
Each titled group is now a heading, a level below "As submitted", drawn the way the object's default record page draws its section titles: semibold, in the foreground colour, with the group's declared icon, over a hairline, and with more space between groups than between fields. The title wraps instead of being cut off on a phone. Every group stays open: a group declared collapsed is not folded here, because the approver decides on the whole record.
13
+
14
+
When the record has two or more titled groups, a strip of group names sits at the top of the card; a click scrolls to that group. A record with one group shows no strip.
15
+
16
+
Which fields show, their order, and the "Changed" mark with the current value are unchanged.
it('each titled section is a level-4 heading under the level-3 "As submitted", in the record page\'s foreground face; a field label is not a heading',async()=>{
0 commit comments