Repository navigation
Commit 6ada509
fix(plugin-detail): the record strip edits in at most three columns so a lookup keeps its name (#29055)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUmit7WGQvTCFouBXLMxAWN)_
Fixes #28913
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:默认记录页的要点条(highlight strip)进入编辑态时,网格最多 3 列;6 个字段排成两行、每行 3
个。阅读态不变,宽容器下仍是一行 6 列。编辑态仍画出空字段,方便就地填写。
- **为什么改**:编辑态以前也是一行 6 列,在 1440 px 的最大化窗格里每格只有 168
px,查找字段(lookup)的选择器旁边还有清除和浏览按钮,「Initech」只剩 10 px,显示成「I…」,负责人「Dev
Admin」显示成「Dev A…」。
- **风险与回滚**:低。只改一个 `className` 分支,不加键、不加选项、不加 prop;保存与取消路径不动。回滚即回退本 PR。
- **先看**:`ui/packages/plugin-detail/src/HeaderHighlight.tsx`(网格
`className` 的 `!editing &&
'@3xl:grid-cols-6'`);`ui/packages/plugin-detail/src/__tests__/HeaderHighlight.editGridCap-28913.test.tsx`(阅读
6 列、编辑最多 3 列、取消回到 6 列)。
- **两分钟验证**:`pnpm --dir ui exec vitest run
packages/plugin-detail/src/__tests__/HeaderHighlight.editGridCap-28913.test.tsx`,预期
3 个用例全部通过。
- **需要你做的**:无,席位落地。
## What changes
On the default record page the highlight strip is an equal-width grid:
two columns on a narrow strip, three from `@lg`, six from `@3xl`. Edit
mode draws every declared strip field, empty ones included, so they can
be filled in place. With six declared fields the edit face therefore put
six editors in one row.
The grid now adds `@3xl:grid-cols-6` only while reading. While editing
it stops at three columns, so six fields edit in two rows of three. The
narrower steps (`grid-cols-2`, `@lg:grid-cols-3`) are the read face's
and are unchanged, and so is the wrapping flex row used outside the
default page. No key, option or prop is added.
### Three columns, measured against four
Measured in the real Console (`examples/app-crm` backend, Vite console
on this branch's source), on a lead with six strip fields declared
locally for the shot only (`company`, `email`, `phone`, `source`,
`assigned_to`, `account`; not committed). Text widths are the rendered
name span; "full" means the span's `scrollWidth` fits its `clientWidth`.
| Layout | Grid width | main (6 max) | cap 4 | cap 3 |
| --- | --- | --- | --- | --- |
| Maximized pane, 1440 px viewport | 1088 px | 6 cols, cell 168 px:
`assigned_to` "Dev Admin" cut to 52 px, `account` "Initech" cut to 10 px
| 4 cols, cell 260 px: both names full | 3 cols, cell 352 px: both names
full |
| Same, account renamed "Initech Global Holdings" (149 px) | 1088 px |
not measured | name cut to 102 px | name full (149 px) |
| Pane, 1440 px viewport (the pane is about 720 px wide) | 623 px | 3
cols, cell 197 px | 3 cols (same) | 3 cols (same) |
At four columns the account picker has about 102 px for the name beside
its clear and browse buttons; at three it has about 194 px. Both caps
clear the seed data, but only three shows a 23-letter company name
whole, so the cap is **3**. In every reading the buttons neither overlap
the trigger nor spill out of the cell, and every name span carries the
full name as its `title`.
Screenshots (before and after, both layouts, plus the long-name pair)
are on the card's dispatch thread; the seat links them.
## Tests
- `HeaderHighlight.editGridCap-28913.test.tsx` (new), on the default
page inside an `InlineEditProvider`: the read face resolves to at most
six columns and draws only the four fields with a value; after entering
edit, every `grid-cols-N` class on the grid resolves to at most three,
`grid-cols-6` is absent, the 2 and 3 steps remain, and all six fields
draw; cancelling returns to six.
- The existing read-face pin in `recordPageV3Face-27055.test.tsx`
(`@3xl:grid-cols-6`) is unchanged and green.
## Acceptance notes
- **Save and cancel behave as today**, checked in the real Console in
the maximized pane: read 6 columns, edit 3, cancel back to 6; editing
the company and pressing Save persisted the value (read back through the
data API) and the strip returned to 6 columns.
- **The pane (about 720 px) is unchanged by this PR.** Its 623 px strip
is below `@3xl`, so main, cap 4 and cap 3 all draw three columns there.
In that layout the `account` picker shows "Init…" (39 of 43 px) with
"Initech" as the span's `title`, which meets the card's "truncates with
the name available on hover"; `assigned_to` shows "Dev Admin" whole. A
wider cell there would need fewer than three columns, outside the 3-or-4
choice this card measured.
- A 720 px viewport is the phone layout, whose strip carries a different
field set (no `account`); `assigned_to` showed whole there before and
after.
- Whether a double-click should put the whole record into edit mode is
out of scope, per the card.
## Verification
Branch base `135054eb`; readings on `3e7948b2` unless named. Head
`4ea64784` merges `origin/main` (16 commits, none touching
`HeaderHighlight.tsx`); there the four strip test files
(`HeaderHighlight.editGridCap-28913`, `recordPageV3Face-27055`,
`HeaderHighlight.editable`, and main's new
`RecordMetaFooter.drawnStrip-28909`) re-ran 31/31 passed, and
`check-sdui-manifest` exit 0.
<details><summary>Tests</summary>
- `pnpm --dir ui exec vitest run packages/plugin-detail/` (under the
verify lock, `--maxWorkers=2`): 363 files passed, 1 skipped; 3209 tests
passed, 18 skipped.
- Ablation (one-time, not kept): `scripts/ablation-replace.mjs` replaced
`!editing && '@3xl:grid-cols-6',` with `(editing || true) &&
'@3xl:grid-cols-6',`; the new file went 1 failed / 2 passed (the
edit-face case), and the restore leg read blob == HEAD with an empty
`git diff HEAD`.
</details>
<details><summary>Type-check and lint</summary>
- `pnpm --filter @object-ui/plugin-detail run type-check`: exit 0.
- eslint (`--no-inline-config`, from `ui/`) on both changed source and
test files: exit 0.
</details>
<details><summary>Derived gates</summary>
`node scripts/pm/dispatch-gates.mjs --ran`: 34 derived families
accounted for, 34 run, 0 NOT MEASURED, every one exit 0. That includes
`node scripts/check-sdui-manifest.mjs` and its `--self-test`, `pnpm
--dir ui exec vitest run scripts/` (169 files passed, 2 skipped; 4900
tests passed) and `pnpm check:type-check-debt` under the verify lock.
The PR-body gates (`check-changeset-no-major`,
`check-closing-keyword-parity`, `check-adr-0087-registration`,
`check-empty-changeset`) ran on this body. `pnpm
check:new-line-citations` under `ui/`: 0 new citations.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jU1A8SyDJ4Lxe7A9Kd
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jU1A8SyDJ4Lxe7A9Kd)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b889c40 commit 6ada509
3 files changed
Lines changed: 103 additions & 1 deletion
File tree
- .changeset
- ui/packages/plugin-detail/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
| 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 | + | |
0 commit comments