Repository navigation
Commit ff88105
fix(plugin-grid): list grid row actions trigger visible at rest in a muted tone (#28922)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbYXRisiPeY3Ds8vvkqmFfEg)_
Fixes #28871
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:列表表格「操作」列里每行的 ⋯
按钮,静止时也画出来(灰色弱化色),鼠标移到该行、行内获得焦点、行被选中、按钮自己获得键盘焦点、菜单打开时,或在触屏上,变为正常前景色。菜单里有哪些项、各项的显示条件和顺序都不变。
- **为什么改**:表头「操作」一直在,但桌面端按钮在鼠标移上行之前是透明的,整列看起来是空的,读者会以为「没有可用操作」。
- **风险与回滚**:只改 `ui/packages/plugin-grid` 一个组件里那个按钮的样式类,不动
spec、服务端、元数据和菜单逻辑。弱化色用的是文字色(`text-muted-foreground`),不是透明度,对比度与其它次要图标一致。回滚
= revert 本 PR。
- **先看**:`ui/packages/plugin-grid/src/components/RowActionMenu.tsx` 里
`data-testid="row-action-trigger"` 那个按钮的 `className`;再看新测试
`RowActionMenu.atRest-28871.test.tsx`。
- **两分钟验证**:`cd ui && pnpm exec vitest run
packages/plugin-grid/src/components/__tests__/RowActionMenu.atRest-28871.test.tsx`,应
1 个文件 4 个用例全部通过;或在 Console 打开线索列表(1440 px),不移动鼠标就能看到每行的 ⋯。
- **需要你做的**:无,席位落地。
## What changes
`RowActionMenu`'s ⋯ trigger (`data-testid="row-action-trigger"`, the one
the list grid's `_actions` column draws per row):
- **At rest:** drawn on every row, on every pointer type, in
`text-muted-foreground`. The `opacity-0` / `transition-opacity` pair is
gone, so nothing hides the trigger before the pointer reaches the row.
- **Full strength (`text-foreground`)** on row hover
(`group-hover/row`), focus within the row (`group-focus-within/row`), a
selected row (`group-data-[state=selected]/row`), an open menu
(`data-[state=open]`), its own keyboard focus (`focus-visible`) and a
coarse pointer (`pointer-coarse`), which cannot hover.
- The tone is a text colour, not an opacity, so the resting glyph keeps
the same contrast as every other muted secondary icon. The ghost
variant's own `hover:bg-accent hover:text-accent-foreground` still
applies when the pointer is on the button itself.
Unchanged: the menu's items, their gates and their order
(`useRowActionPlan`, #28434), the inline primary buttons, the empty-menu
guard (no trigger when the plan offers nothing), the header
(`objectGridActionsColumn.tsx` is not touched), the 44 px touch target,
and the accessible name. No key, option or prop is added.
## Tests
- `RowActionMenu.atRest-28871.test.tsx` (new, 4 cases, `dom` project).
jsdom applies no stylesheet, so visibility is read off the classes that
decide it, as `data-table-leadingCell-12423.test.tsx` does:
- at rest the trigger carries no `opacity-0` (under any variant),
`invisible`, `hidden` or `sr-only`, and keeps its accessible name;
- it rests in `text-muted-foreground` and carries the five full-strength
variants;
- the only `pointer-coarse:` class is `pointer-coarse:text-foreground`,
so a coarse pointer strengthens the tone and is never what makes the
trigger appear;
- control: opening the menu flips the trigger's `data-state` to `open`
(the state `data-[state=open]:` keys on) and shows the item.
<details><summary>Ablation (scripts/ablation-replace.mjs, at 7d46751,
source-resolved, no dist)</summary>
- `opacity-0` put back at rest (`text-muted-foreground
transition-colors` to `text-muted-foreground opacity-0
transition-colors`): 1 failed ("is drawn at rest: nothing hides it
before the pointer reaches the row"), 3 passed. Restored, blob
`adea0869` equal to HEAD, `git diff HEAD` empty.
- The coarse-pointer leg put back to an opacity reveal
(`pointer-coarse:text-foreground` to `pointer-coarse:opacity-100`): 1
failed (the every-pointer-type case), 3 passed. Restored, blob
`adea0869` equal to HEAD, `git diff HEAD` empty.
</details>
## Acceptance notes
- `ui/packages/components/src/renderers/complex/data-table.tsx` draws
its own row-actions trigger (`data-testid="data-table-row-actions"`, the
generic `data-table` renderer's schema `rowActions`) with the old
`opacity-0` set, pinned by `data-table-leadingCell-12423.test.tsx`. It
is not the list grid's trigger and is outside this card's file surface,
so it keeps hover-reveal.
`ui/packages/app-shell/src/views/objectViewOpenAsPage.tsx` has a
separate hover-revealed control in the same style, also untouched.
- The enlarged related tab inherits this once it draws `object-grid`
(#28865), with no change here.
## Verification
All on the final head `7d467519` (base `origin/main` `b15b634c`), after
`pnpm install --frozen-lockfile` and `turbo run build
--filter='@object-ui/plugin-grid^...'` plus formula, sdui-parser, lint
and client (49 tasks, exit 0), under `scripts/pm/os-verify-lock.sh`.
- The whole `packages/plugin-grid/` vitest suite (`--maxWorkers=2`): 271
files, 2353 tests passed. The five `RowActionMenu*` files alone: 81
passed.
- `pnpm --filter @object-ui/plugin-grid run type-check` (both `tsc`
programs, the test one included): exit 0.
- ESLint on the two changed tsx files: exit 0, no findings.
- Derived gates (`node scripts/pm/dispatch-gates.mjs --commands`): 34 of
34 run, each exit 0 (`check:type-check-debt` and `pnpm --dir ui exec
vitest run scripts/` under the lock; the latter 169 files passed, 2
skipped), including `node scripts/check-sdui-manifest.mjs` and the
PR-body gates with this body as `GITHUB_EVENT_PATH`. `--ran` reconciles
34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.
`check-partof-closing-keyword` with `PR_BODY`: exit 0. `ui`
`check:new-line-citations`: 0 new citations.
- Not run locally: the other packages whose tests click
`row-action-trigger` (plugin-view, plugin-designer, app-shell). They
find the trigger by test id and never read its classes; CI's Test UI
runs them.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jSUCWFfGqhaRR97caT
Co-authored-by: Claude <noreply@anthropic.com>1 parent e0dc077 commit ff88105
3 files changed
Lines changed: 105 additions & 5 deletions
File tree
- .changeset
- ui/packages/plugin-grid/src/components
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
732 | 736 | | |
733 | 737 | | |
734 | 738 | | |
| |||
| 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