Repository navigation
fix(components): give the Dialog close button a 44 px touch target at phone width - #29204
Merged
Merged
Conversation
… 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
…-rh798r 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
Contributor
Author
|
domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ 维护者速读
席位意见: 范围与卡一致,按仓库规矩走声明式补丁而非手改同步文件,字节往返测试守住。与已落地的 Sheet 补丁(#29149)类名集合相同、顺序不同,两者各自独立声明,互不干扰。无公开面变化, 席位核对 — ACCEPT ·
|
Merged
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ
Requested by Steedos · project thread
Fixes #29107
Clause-②: no
Metadata-protocol: none
维护者速读
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
DialogContentdraws in its top-right corner gets a phone-only touch target: belowsmit 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). Fromsmup the class list is upstream's, token for token, so the desktop header does not grow.dialog.tsxis a Shadcn-synced file (ui/AGENTS.mdcommandment 7), so the change is declared as a local patch,phoneCloseTouchTargetPatches('Dialog')inui/scripts/shadcn-local-patches.mjs, anchored on the opening of the Close element's class list as the vendored registry fixture spells it. The shippeddialog.tsxline was written by applying that patch to the file, soREGISTRY_FIXTURES.dialogkeeps its byte round trip (roundTrip: true) and the nextpnpm shadcn:updatere-applies it instead of reverting it. The helper takes the Radix prefix, so the Sheet close can take the same family.DialogContent's own close: the declared-action param dialog (ActionParamDialog, e.g. thesys_approval_requestReject decision) and the command palette (CommandDialog).ui/packages/components/shadcn-components.json: dialog'slocalEditsnote now names the phone close touch-target patch beside the i18n close patch (claim amendment 6573487904)..changeset/29107-dialog-close-phone-touch-target.md:@object-ui/componentspatch.Tests
ui/packages/components/src/__tests__/dialog-close-touch-target-29107.test.tsx: onDialogContentand onCommandDialog, the Close carries the six phone classes, every class without themax-sm:prefix equals upstream's list in order, and the glyph keepsh-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 offright-4 top-4. The two close-label counts on dialog are scoped to their own family.dialog.tsxrestored to main's bytes (tree only, restored from HEAD afterwards,git statusclean), 4 cases go red: both new component cases, "dialog.tsx carries its declared patches" and "dialog: byte round-trip holds".Acceptance notes
max-sm:right-0.5 max-sm:top-0.5would keep it at 17 px.sheet.tsx's close is Console at phone width: Dashboards flow audit and fixes at 375 and 390 px #29078's;REGISTRY_FIXTURES.sheetisroundTrip: trueas well, so a bare class edit there reds "sheet: byte round-trip holds" unless it is declared the same way.Verification
dialog.tsx): param dialog and command palette Close are 16 x 16 px at 375 px and at 1280 px.dispatch-gates --commandsderives for this diff all exit 0 (--ranreconciliation: 36 derived, 36 run, 0 NOT-MEASURED), includingnode scripts/check-sdui-manifest.mjsandpnpm --dir ui exec vitest run scripts/(169 files, 4903 tests passed).@object-ui/componentstype-check (includingtsconfig.test.json) exit 0; eslint on the four touched source files exit 0;pnpm check:new-line-citations0 new.localEditsnote): the same 36 derived families; the files that readshadcn-components.jsonplus the patch and dialog tests re-run green (5 files, 92 tests),check:published-files,check:nul-bytesandcheck-empty-changesetexit 0.snapshot-critical.test.tsx("Dialog snapshots > renders open dialog structure", red in Test UI 10/16 on cc550d3) regenerated withvitest --update; the.snapdiff is the Close line only, gaining the sixmax-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
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code