Skip to content

fix(components): give the Dialog close button a 44 px touch target at phone width - #29204

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-rh798r
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-rh798r

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ

Requested by Steedos · project thread

Fixes #29107

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:手机宽度(小于 sm 断点)下,所有弹窗右上角的关闭按钮从 16×16 px 的点击区扩大到 44×44 px,图标本身仍是 16 px;桌面宽度下按钮样式一字未改。
  • 为什么改:移动端 App 用 WebView 承载 Console,手机用户打开的每个弹窗(操作参数弹窗如审批「驳回」、命令面板 ⌘K 等)都用这一个共享 Dialog,关闭按钮太小、经常点不中。
  • 风险与回滚:只加了 max-sm: 前缀的样式类,桌面不受影响;图标在手机上向内移动 2 px(距角 17 px → 19 px)。回滚即 revert 本 PR。
  • 先看:ui/scripts/shadcn-local-patches.mjs(新增的 phoneCloseTouchTargetPatches 补丁声明)、ui/packages/components/src/ui/dialog.tsx(Close 那一行)、ui/packages/components/src/__tests__/dialog-close-touch-target-29107.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/components/src/__tests__/dialog-close-touch-target-29107.test.tsx scripts/__tests__/shadcn-local-patches.test.ts,预期全绿;或在 375 px 宽的 Console 里按 Ctrl+K,关闭按钮的点击区是 44×44。
  • 需要你做的:无,席位落地。

What changes

  • The close button DialogContent draws in its top-right corner gets a phone-only touch target: below sm it is a 44 x 44 px flex box placed 4 px from the corner with the 16 px glyph centred (max-sm:right-1 max-sm:top-1 max-sm:flex max-sm:size-11 max-sm:items-center max-sm:justify-center, the class set Console at phone width: Dashboards flow audit and fixes at 375 and 390 px #29078 uses for the Sheet close). From sm up the class list is upstream's, token for token, so the desktop header does not grow.
  • dialog.tsx is a Shadcn-synced file (ui/AGENTS.md commandment 7), so the change is declared as a local patch, phoneCloseTouchTargetPatches('Dialog') in ui/scripts/shadcn-local-patches.mjs, anchored on the opening of the Close element's class list as the vendored registry fixture spells it. The shipped dialog.tsx line was written by applying that patch to the file, so REGISTRY_FIXTURES.dialog keeps its byte round trip (roundTrip: true) and the next pnpm shadcn:update re-applies it instead of reverting it. The helper takes the Radix prefix, so the Sheet close can take the same family.
  • Both sites the card names render DialogContent's own close: the declared-action param dialog (ActionParamDialog, e.g. the sys_approval_request Reject decision) and the command palette (CommandDialog).
  • ui/packages/components/shadcn-components.json: dialog's localEdits note now names the phone close touch-target patch beside the i18n close patch (claim amendment 6573487904).
  • Changeset .changeset/29107-dialog-close-phone-touch-target.md: @object-ui/components patch.

Tests

  • New ui/packages/components/src/__tests__/dialog-close-touch-target-29107.test.tsx: on DialogContent and on CommandDialog, the Close carries the six phone classes, every class without the max-sm: prefix equals upstream's list in order, and the glyph keeps h-4 w-4.
  • ui/scripts/__tests__/shadcn-local-patches.test.ts: the dialog declares the new patch id; applied to the registry bytes it adds the phone classes and leaves upstream's Close classes unchanged; it refuses (only that patch, the close-label family still lands) when upstream moves the Close off right-4 top-4. The two close-label counts on dialog are scoped to their own family.
  • Ablation, one-shot, at 20e48bf: with dialog.tsx restored to main's bytes (tree only, restored from HEAD afterwards, git status clean), 4 cases go red: both new component cases, "dialog.tsx carries its declared patches" and "dialog: byte round-trip holds".

Acceptance notes

Verification

  • Real browser, showcase backend plus the Console Vite dev server, Playwright at 375 x 812 and 1280 x 800, measuring the dialog element's own Close (screenshots and the script stay in the project files, not here):
    • Before (main's dialog.tsx): param dialog and command palette Close are 16 x 16 px at 375 px and at 1280 px.
    • After: 44 x 44 px at 375 px on both sites, glyph 16 x 16; at 1280 px both are still 16 x 16 px at the same position.
  • Local gates at 20e48bf: the 36 families dispatch-gates --commands derives for this diff all exit 0 (--ran reconciliation: 36 derived, 36 run, 0 NOT-MEASURED), including node scripts/check-sdui-manifest.mjs and pnpm --dir ui exec vitest run scripts/ (169 files, 4903 tests passed). @object-ui/components type-check (including tsconfig.test.json) exit 0; eslint on the four touched source files exit 0; pnpm check:new-line-citations 0 new.
  • After merging main (d0c0add, no main commit touches these files): the three touched test files re-run green (66 tests).
  • At cc550d3 (the localEdits note): the same 36 derived families; the files that read shadcn-components.json plus the patch and dialog tests re-run green (5 files, 92 tests), check:published-files, check:nul-bytes and check-empty-changeset exit 0.
  • At 1855aa3: snapshot-critical.test.tsx ("Dialog snapshots > renders open dialog structure", red in Test UI 10/16 on cc550d3) regenerated with vitest --update; the .snap diff is the Close line only, gaining the six max-sm: classes. A sweep of every *.snap, *.test.* and *.spec.* file for the Close class list (right-4 top-4 rounded-sm, rounded-sm opacity-70, data-[state=open]:bg-accent data-[state=open]:text-muted-foreground) finds no other pin. The snapshot file and the dialog test re-run green (2 files, 22 tests); the whole components package did not finish locally within 560 s, so CI Test UI carries it.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

… phone width

Below sm the DialogContent close button becomes a 44 px box with the
16 px glyph centred; from sm up its classes are upstream's, unchanged.
dialog.tsx is Shadcn-synced, so the classes are declared as a local
patch (phoneCloseTouchTargetPatches) and the shipped file is regenerated
from it. Tests pin the phone classes on DialogContent and the command
palette, and the patch's anchor against the vendored registry bytes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jQryAdPcJnhAWQzVjB
… its localEdits note

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jQryAdPcJnhAWQzVjB
…h-target classes

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jQryAdPcJnhAWQzVjB
…-rh798r

Keeps both close touch-target declarations in LOCAL_PATCHES: the
sheet family from main and this branch's dialog family.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jQryAdPcJnhAWQzVjB
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ

维护者速读

  • 改了什么:手机宽度(小于 sm 断点)下,所有弹窗右上角的关闭按钮从 16×16 px 的点击区扩大到 44×44 px,图标本身仍是 16 px;桌面宽度下按钮样式一字未改。
  • 为什么改:手机用户打开的每个弹窗(操作参数弹窗如审批「驳回」、命令面板 ⌘K 等)都用这一个共享 Dialog,关闭按钮太小、经常点不中。
  • 风险与回滚:dialog.tsx 是 Shadcn 同步文件,改动以本地补丁声明(shadcn-local-patches.mjs),下次 shadcn:update 会自动重放而不是被覆盖;只加 max-sm: 类,桌面不受影响;图标在手机上向内移动 2 px。回滚即 revert 本 PR。
  • 先看:ui/scripts/shadcn-local-patches.mjs 的 phoneCloseTouchTargetPatches,然后 ui/packages/components/src/ui/dialog.tsx 的 Close 那一行。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/components/src/__tests__/dialog-close-touch-target-29107.test.tsx scripts/__tests__/shadcn-local-patches.test.ts,预期全绿;或在 375 px 宽的 Console 里按 Ctrl+K,关闭按钮点击区是 44×44。
  • 需要你做的:无,席位验收后进合并队列。

席位意见: 范围与卡一致,按仓库规矩走声明式补丁而非手改同步文件,字节往返测试守住。与已落地的 Sheet 补丁(#29149)类名集合相同、顺序不同,两者各自独立声明,互不干扰。无公开面变化,Clause-②: no 成立。

席位核对 — ACCEPT · domain:ui#2 · head 9878ef61 · 2026-11-02T10:46Z

  • 形态: draft PR on main, Fixes #29107 on its own line and no other card number beside a closing keyword. 7 files, +225/−6, Tier S (check-governed-merges --pr 29204: not governed). All inside claim 6572252694 as amended by 6572263305 (declared patch), 6573487904 (localEdits note) and 6573945962 (the snapshot file).
  • 前提实测: at origin/main the Dialog Close was absolute right-4 top-4 around a bare 16 px glyph. The dev's real-browser run measured 16×16 at 375 and 1280 px before, and 44×44 at 375 px / unchanged 16×16 at 1280 px after, on the param dialog and the command palette. The ablation with dialog.tsx restored reds 4 cases, including the byte round trip.
  • 门禁 check-runs (pinned to head 9878ef617761c0f3239f4e953db554bf5f84b8ab): 44 success, 11 skipped, 0 failed, 0 pending, including Lint & Repo Gates, TypeScript Type Check, Type Check UI, Lint UI, Check Changeset and all Test UI shards (the snapshot-critical red on cc550d3e is fixed by the regenerated snapshot, whose diff is the Close line only). After merging main (fix(console): dashboards meet the 44 px touch-target floor at phone width #29149's Sheet patch), 6 shadcn/dialog/sheet test files passed 89/89 locally.
  • 接受的偏差: the glyph moves 2 px inward on phones, which the seat accepted to keep the Dialog and Sheet class sets identical. pnpm shadcn:check is NOT MEASURED, because the registry host is unreachable from the container; the "every declared anchor applies to real registry bytes" cases stand in for it and are green for both families. The snapshot update ran outside the test lock once; the snapshot content is deterministic and CI re-ran the package.
  • 范围外去向: none. fix(console): dashboards meet the 44 px touch-target floor at phone width #29149's sheetCloseTouchTargetPatches is a separate declaration with the same class set in a different order; it is left untouched, and this PR's doc comment names it.
  • 落地条款: Clause-②: no (no published export or key changes; the @object-ui/components patch changes classes only), so no contract review is owed. mergeable_state is clean. Land by pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 10:47
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 2, 2026 10:47
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 276ca30 Nov 2, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-rh798r branch November 2, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog close button at phone width: the X in the shared Dialog is a 16x16 px target, below the 44 px minimum, in every modal the mobile app shows

1 participant