Skip to content

Commit 6dda0ce

Browse files
fix(console): dashboards meet the 44 px touch-target floor at phone width (#29149)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb9VAiRmdySQ7HJiMeXjuBmG)_ Fixes #29078 Part of #29040 (the Dashboards flow; the other seven flows have their own cards). Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:手机宽度(小于 `sm`,即 640 px)下,仪表盘页面的可点控件统一放大到 44 px 触控目标:页头「Refresh All」、筛选栏的日期/下拉/文本控件与「Reset」、下拉选项行、自定义日期日历(手机上只显示一个月,日期格 44 px)、数据表的排序按钮与可钻取行、透视表的可钻取单元格、「Export CSV」(手机上移到表格上方单独一行,不再压住最后一列的排序按钮)、钻取抽屉的「Open in list」,以及所有 Sheet 抽屉的关闭按钮。桌面宽度(`sm` 及以上)样式不变。 - 为什么改:#29040 要求移动端(WebView 内嵌 Console)逐流程审计。在真实 Console 上以 375 与 390 px 跑 CRM 和 showcase 的 4 个仪表盘:无横向滚动、弹层全部在视口内、4 倍 CPU 降速下滚动顺畅,唯独触控目标不达标,控件高 16 到 36 px。 - 风险与回滚:只改 className,不动属性、数据或协议;唯一共享组件改动是 `sheet.tsx` 的关闭按钮,只加 `max-sm:` 前缀类,桌面不变,手机上所有抽屉的关闭按钮变成 44 px;该文件由 shadcn 同步生成,改动已登记为本地补丁,同步时自动重放。回滚即还原本 PR。 - 先看:`ui/packages/components/src/ui/sheet.tsx` 与 `ui/scripts/shadcn-local-patches.mjs`(全局抽屉关闭按钮,作为 shadcn 本地补丁声明)、`ui/packages/plugin-dashboard/src/DatasetWidget.tsx`(Export CSV 手机上改为独立一行)、`ui/packages/plugin-dashboard/src/DashboardFilterBar.tsx`(日历手机上单月)。 - 两分钟验证:`cd ui && pnpm exec vitest run packages/plugin-dashboard/src/__tests__/DashboardPhoneTouchTargets-29078.test.tsx packages/components/src/__tests__/sheet-close-touch-target-29078.test.tsx packages/app-shell/src/views/DashboardView.phoneTouchTarget-29078.test.tsx`,预期 3 个文件 10 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes Every change is phone-only: a class under `max-sm:`, or a `min-h-11` floor released by `sm:min-h-0` (the pattern the form select trigger already uses). From `sm` up the class lists draw what they drew before. - **`@object-ui/app-shell`, `DashboardView.tsx`:** the page header's Refresh All gets the 44 px floor. - **`@object-ui/plugin-dashboard`, `DashboardFilterBar.tsx`:** the date-range and select triggers, the text filter, Reset, and every option row of both lists get the floor. The custom-range calendar opens one month below `md` (`useIsMobile`) with 44 px day cells (`max-md:[--cell-size:2.75rem]`); two stacked months at that size would run past a phone's viewport. From `md` up it keeps two months at 32 px. - **`@object-ui/plugin-dashboard`, `DatasetWidget.tsx`:** the table's sort buttons get the floor; the cells of a drillable row are 44 px tall (a table nobody can drill is unchanged); a drillable pivot cell is 44 by 44. Export CSV is 44 px and, below `sm`, leaves the table's top-right corner (where it would cover the last column's sort button) for its own right-aligned row above the table. - **`@object-ui/plugin-dashboard`, `OpenInListButton.tsx`:** the drill drawer's Open in list gets the floor; a host `className` still merges. - **`@object-ui/components`, `sheet.tsx`:** the Close button every Sheet draws is a 44 px box below `sm`, its 16 px glyph where it was. The Dialog close button is not touched. - **`ui/scripts/shadcn-local-patches.mjs`:** `src/ui/**` regenerates from the shadcn registry, so the Sheet edit is declared as the local patch `sheet-close-phone-touch-target` (one anchor, written from the vendored `sheet.registry.txt` bytes) and re-applied by the sync. Without it the next `shadcn:update` would revert it silently; `shadcn-local-patches.test.ts` caught the undeclared edit. ## Why The card asks for the Dashboards flow driven at 375×812 and 390×844 against the showcase and CRM examples, five checks each. The audit ran first on `origin/main` `6b3ba82c`, on a real Console, and only the touch-target check failed. Claim 6571438083 declared the audit read-only; the seat then amended the surface to these five files, their tests and a changeset (amendment 6571555427) before any push, and added `ui/scripts/shadcn-local-patches.mjs` and its tests (amendment 6572329768) once the derived gates showed the Sheet edit had to be declared there. ### Run record Harness: `pnpm build` + `pnpm console:build`, the Console served at `/_console` by `pnpm dev:crm -- --fresh` and `pnpm dev:showcase -- --fresh`, Playwright Chromium with `isMobile`, `hasTouch`, an Android UA and DPR 2. Pages: CRM `pipeline_dashboard` (KPIs, line, bar, pie); showcase `showcase_ops_dashboard` (date and select filters, KPIs, charts, table), `showcase_revenue_pulse` (date and region filters, KPIs, charts, table), `showcase_chart_gallery` (every chart type, table, pivot). Before and after screenshots and the raw reports stay in the project folder. | Check | 375×812 before | 375×812 after | 390×844 before | 390×844 after | Evidence | |---|---|---|---|---|---| | No horizontal page scroll | PASS | PASS | PASS | PASS | page overflow 0 on all 4 dashboards, no element past the right edge. Tables and the pivot scroll sideways inside their own card, not the page. | | Touch targets ≥ 44 px | FAIL | PASS | FAIL | PASS | before: Refresh All 36, filter triggers 32, option rows 32, calendar days and arrows 32, sort buttons 16, drillable rows 25, pivot cells 25, Export CSV 22, drawer Close 16, Open in list 36. After: 0 targets under 44 in the page, the filter lists, the calendar and the drill drawer. | | Dialogs and drawers fit | PASS | PASS | PASS | PASS | filter lists inside the viewport (after: B802 of 812, B834 of 844); custom range before two stacked months to B709, after one month T147 to B512; drill drawer full screen. No overlay overflows sideways. | | Virtual keyboard does not cover the focused field | N/A | N/A | N/A | N/A | no text-entry field in the flow: the four dashboards declare only date and select filters, the custom range is a calendar, the drill drawer has no input. | | Long lists responsive at CPU 4× | PASS | PASS | PASS | PASS | CDP `setCPUThrottlingRate 4`: the dashboard scroller (up to 6.5k px) scrolled in 30 steps with p95 frame 17 ms and 0 long tasks; tap on a table row to drill drawer visible 507 to 749 ms, the data request included. | Not fixed here, and not this card's file surface: the Console app bar's controls (sidebar toggle 28 px; home, search, Studio, inbox, account 32 px) are under 44 px on every route. They are AppHeader's, held by the Navigation card #29075. ## Tests - New `ui/packages/plugin-dashboard/src/__tests__/DashboardPhoneTouchTargets-29078.test.tsx` (8 cases): filter triggers, text field and Reset carry the floor; every option row of both lists does; below `md` the custom range opens one month with the 44 px cell size, and from `md` up it keeps two (control); sort buttons and drillable-row cells carry the floor and Export CSV is 44 px out of the corner; a non-drillable table's rows do not grow (control); a drillable pivot cell is 44 by 44; Open in list carries the floor and keeps a host class. - New `ui/packages/app-shell/src/views/DashboardView.phoneTouchTarget-29078.test.tsx` (1 case): Refresh All carries the floor. - New `ui/packages/components/src/__tests__/sheet-close-touch-target-29078.test.tsx` (1 case): the Sheet Close button is 44 px below `sm`, keeps `right-4 top-4` from `sm` up and its 16 px glyph. - Reverse verification: with the five source files checked out from `origin/main` `6b3ba82c`, the three files ran 8 failed, 2 passed (the two controls), then restored from `HEAD` (`git diff HEAD` empty). These tests import the components from source, so no build stands between the edit and the run. - `ui/scripts/__tests__/shadcn-local-patches.test.ts` was red on `0ff4d360` (1 case, "sheet: byte round-trip holds": `sheet.tsx` no longer regenerated from registry bytes) and is green on `8423b760` with the patch declared. - On `0ff4d360`: the whole `packages/plugin-dashboard/` suite, 200 files, 1922 passed, 6 skipped; the 43 components, app-shell and console test files naming `sheet` or the touched dashboard modules, 404 passed; `turbo run type-check` for components, plugin-dashboard and app-shell, 67 of 67 tasks. ## Acceptance notes - Chart segments are drill targets sized by the data (bars 39 to 56 px wide, some gallery bars 30 px tall). They are not controls this PR resizes. - The drill drawer lists held 2 to 4 seed rows, so a long drawer list was not exercised at 4× CPU; the dashboard scroller itself (6.5k px) was. - No Playwright spec is added; the card welcomes one where a fix lands but does not require it for this flow. The audit harness and its reports are in the project folder. ## Verification <details><summary>Derived gates, local subset</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 36 families. On `0ff4d360` all 36 ran: 35 exit 0 (among them `check-sdui-manifest.mjs` and its self-test, `check-changeset-no-major`, `check-empty-changeset`, `check-adr-0087-registration`, `check:nul-bytes`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:query-options-erasure`, and `check:type-check-debt` under the verify lock), and `pnpm --dir ui exec vitest run scripts/` exit 1 on the one shadcn round-trip case above. `dispatch-gates --ran`: 36 derived, 36 run, 0 NOT-MEASURED. On `8423b760` the same derivation (identical list): `pnpm --dir ui exec vitest run scripts/` exit 0, 169 files passed, 2 skipped (4900 tests). The other 35 are re-running on `8423b760`; their results go in the os-dev report on the card. </details> Families CI runs (Lint UI, Test UI, Type Check UI and the rest) are read from this PR's check-runs. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (Not touched.) - [x] 2. Every name I added uses the casing for its kind. - [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran; `pnpm lint` is CI's Lint UI run.) - [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 维护者速读 block the lane requires. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTE9T9iArKPf81eTtb --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fa31010 commit 6dda0ce

10 files changed

Lines changed: 420 additions & 18 deletions
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/plugin-dashboard': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/components': patch
5+
---
6+
7+
fix(console): dashboards meet the 44 px touch-target floor at phone width
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
Measured on a real Console at 375 and 390 px (objectstack#29078, part of the #29040 phone-width audit), the Dashboards flow had no horizontal page scroll, every overlay fit and scrolling stayed smooth at 4× CPU throttling, but most of its controls were 16 to 36 px tall. Below `sm` they are now 44 px touch targets; from `sm` up nothing changes:
13+
14+
- the dashboard page's Refresh All;
15+
- the filter bar's date, select and text controls, its Reset, and the option rows of its lists;
16+
- the custom-range calendar, which opens one month with 44 px days below `md` (two stacked months at that size ran past the viewport);
17+
- the dataset table's sort buttons and drillable rows, the pivot's drillable cells, and Export CSV, which on a phone takes its own row above the table instead of covering the last column's sort button;
18+
- the drill drawer's Open in list, and the Close button of every Sheet.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectstack#29078 — the dashboard page's "Refresh All" is a 44 px touch
11+
* target at phone width.
12+
*
13+
* Measured on a real Console at 375 and 390 px, on every example dashboard,
14+
* the button was 36 px tall (`size="sm"`), under the 44 px floor the #29040
15+
* phone-width audit holds every control to. jsdom has no layout, so the floor
16+
* is pinned as drawn: `min-h-11` below `sm`, released from `sm` up so the
17+
* desktop header keeps its compact button.
18+
*/
19+
20+
import * as React from 'react';
21+
import { afterEach, describe, expect, it, vi } from 'vitest';
22+
import { act, cleanup, render, screen, within } from '@testing-library/react';
23+
import { MetadataCtx } from '@object-ui/react';
24+
25+
const meta = vi.hoisted(() => ({ value: null as unknown }));
26+
vi.mock('../providers/MetadataProvider', () => ({ useMetadata: () => meta.value }));
27+
vi.mock('react-router-dom', () => ({
28+
useParams: () => ({ dashboardName: 'ops_board' }),
29+
useNavigate: () => vi.fn(),
30+
useLocation: () => ({ pathname: '/apps/crm/dashboard/ops_board', search: '' }),
31+
}));
32+
vi.mock('./useOpenRecordList', () => ({ useOpenRecordList: () => vi.fn() }));
33+
vi.mock('./MetadataInspector', () => ({
34+
MetadataPanel: () => null,
35+
useMetadataInspector: () => ({ showDebug: false }),
36+
}));
37+
vi.mock('../providers/AdapterProvider', () => ({ useAdapter: () => ({}) }));
38+
vi.mock('../providers/ExpressionProvider', () => ({ useExpressionContext: () => ({ app: undefined }) }));
39+
40+
import { DashboardView } from './DashboardView';
41+
42+
const DOC = {
43+
name: 'ops_board',
44+
label: 'Operations (29078)',
45+
widgets: [{ id: 'widget_total', type: 'kpi', title: 'Total (29078)', options: { value: 42 } }],
46+
};
47+
48+
afterEach(() => cleanup());
49+
50+
describe('#29078 — Refresh All is 44 px tall on a phone', () => {
51+
it('carries the phone floor, released from sm up', async () => {
52+
meta.value = {
53+
apps: [], objects: [], dashboards: [DOC], reports: [], pages: [],
54+
loading: false, error: null,
55+
refresh: async () => {}, invalidate: () => {}, ensureType: async () => [],
56+
getItem: vi.fn(async () => null), getItemsByType: () => [], getTypeStatus: () => 'ready',
57+
};
58+
render(
59+
<MetadataCtx.Provider value={meta.value as React.ContextType<typeof MetadataCtx>}>
60+
<DashboardView />
61+
</MetadataCtx.Provider>,
62+
);
63+
await act(async () => {});
64+
const button = await within(screen.getByTestId('page-header')).findByRole('button', { name: 'Refresh dashboard' });
65+
expect(button.className).toContain('min-h-11');
66+
expect(button.className).toContain('sm:min-h-0');
67+
});
68+
});

‎ui/packages/app-shell/src/views/DashboardView.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
337337
<Button
338338
variant="outline"
339339
size="sm"
340+
// 44 px tall below `sm`, a phone's touch-target floor (objectstack#29078).
341+
className="min-h-11 sm:min-h-0"
340342
onClick={refreshState.handleRefresh}
341343
disabled={refreshState.refreshing}
342344
aria-label={tt('dashboard.refreshDashboard', 'Refresh dashboard')}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectstack#29078 — a Sheet's Close button is a 44 px touch target at phone
11+
* width.
12+
*
13+
* Measured on a real Console at 375 and 390 px (the dashboard drill drawer),
14+
* the Close button was its 16 px glyph and nothing more, under the 44 px floor
15+
* the #29040 phone-width audit holds every control to. Every Sheet draws this
16+
* one button, so the floor lives here. jsdom has no layout, so it is pinned as
17+
* drawn: a 44 px box below `sm`, and from `sm` up the class list the desktop
18+
* had before, unchanged.
19+
*/
20+
21+
import { describe, it, expect, afterEach } from 'vitest';
22+
import { render, screen, cleanup } from '@testing-library/react';
23+
import { Sheet, SheetContent, SheetTitle, SheetDescription } from '../ui/sheet';
24+
25+
afterEach(() => cleanup());
26+
27+
describe('#29078 — the Sheet Close button on a phone', () => {
28+
it('is a 44 px box below sm and keeps its desktop placement from sm up', () => {
29+
render(
30+
<Sheet open>
31+
<SheetContent>
32+
<SheetTitle>Fabrikam</SheetTitle>
33+
<SheetDescription>Drill drawer</SheetDescription>
34+
</SheetContent>
35+
</Sheet>,
36+
);
37+
const close = screen.getByRole('button', { name: 'Close' });
38+
const cls = close.className.split(/\s+/);
39+
for (const c of ['max-sm:size-11', 'max-sm:flex', 'max-sm:items-center', 'max-sm:justify-center', 'max-sm:right-1', 'max-sm:top-1']) {
40+
expect(cls).toContain(c);
41+
}
42+
// Desktop: unprefixed placement as before.
43+
expect(cls).toContain('right-4');
44+
expect(cls).toContain('top-4');
45+
// The glyph itself stays 16 px.
46+
expect(close.querySelector('svg')?.getAttribute('class')).toContain('h-4 w-4');
47+
});
48+
});

‎ui/packages/components/src/ui/sheet.tsx‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ui/packages/plugin-dashboard/src/DashboardFilterBar.tsx‎

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
SelectItem,
3131
SelectTrigger,
3232
SelectValue,
33+
useIsMobile,
3334
} from '@object-ui/components';
3435
import { CalendarIcon, RotateCcw } from 'lucide-react';
3536
import { useSafeTranslate, useObjectTranslation, useSafeFieldLabel, pickLocalized } from '@object-ui/i18n';
@@ -100,6 +101,13 @@ const ALL_VALUE = '__all__';
100101
/** Sentinel for the date-range Select's "Custom…" item. */
101102
const CUSTOM_VALUE = '__custom__';
102103

104+
// objectstack#29078 — at phone width every control of the bar is a 44 px touch
105+
// target (the #29040 audit's floor); from `sm` up the bar keeps its compact
106+
// desktop sizes. `min-h` rather than `h`, so the `h-8` the desktop draws
107+
// stays the one height rule and the phone only raises its floor. The option
108+
// rows of the bar's two lists take the same floor.
109+
const PHONE_TARGET = 'min-h-11 sm:min-h-0';
110+
103111
export interface DashboardFilterBarProps {
104112
defs: DashboardFilterDef[];
105113
values: Record<string, any>;
@@ -229,6 +237,9 @@ function useCustomRangePopover() {
229237
}
230238

231239
function DateRangeFilter({ def, value, onChange }: { def: DashboardFilterDef; value: DateRangeValue | undefined; onChange: (v: DateRangeValue | undefined) => void }) {
240+
// Below `md` the custom-range calendar shows one month with 44 px day cells:
241+
// two months stacked at that size run past a phone's viewport (#29078).
242+
const isMobile = useIsMobile();
232243
const tt = useSafeTranslate();
233244
const label = useFilterLabel(def);
234245
const custom = useCustomRangePopover();
@@ -263,19 +274,19 @@ function DateRangeFilter({ def, value, onChange }: { def: DashboardFilterDef; va
263274
else onChange({ preset: v });
264275
}}
265276
>
266-
<SelectTrigger {...custom.selectTrigger} className="h-8 w-auto min-w-36 gap-1" aria-label={label || tt('dashboard.filters.dateRange', 'Date range')}>
277+
<SelectTrigger {...custom.selectTrigger} className={cn('h-8 w-auto min-w-36 gap-1', PHONE_TARGET)} aria-label={label || tt('dashboard.filters.dateRange', 'Date range')}>
267278
<CalendarIcon className="size-3.5 opacity-60" />
268279
<SelectValue placeholder={tt('dashboard.filters.dateRange', 'Date range')}>
269280
{rangeLabel(value, presetLabel) ?? tt('dashboard.filters.allTime', 'All time')}
270281
</SelectValue>
271282
</SelectTrigger>
272283
<SelectContent {...custom.selectContent}>
273-
<SelectItem value={ALL_VALUE}>{tt('dashboard.filters.allTime', 'All time')}</SelectItem>
284+
<SelectItem value={ALL_VALUE} className={PHONE_TARGET}>{tt('dashboard.filters.allTime', 'All time')}</SelectItem>
274285
{DATE_RANGE_PRESETS.map((p) => (
275-
<SelectItem key={p} value={p}>{presetLabel(p)}</SelectItem>
286+
<SelectItem key={p} value={p} className={PHONE_TARGET}>{presetLabel(p)}</SelectItem>
276287
))}
277288
{allowCustom && (
278-
<SelectItem value={CUSTOM_VALUE} {...custom.customItem}>{tt('dashboard.filters.custom', 'Custom…')}</SelectItem>
289+
<SelectItem value={CUSTOM_VALUE} className={PHONE_TARGET} {...custom.customItem}>{tt('dashboard.filters.custom', 'Custom…')}</SelectItem>
279290
)}
280291
</SelectContent>
281292
</Select>
@@ -288,7 +299,8 @@ function DateRangeFilter({ def, value, onChange }: { def: DashboardFilterDef; va
288299
<PopoverContent {...custom.popoverContent} className="w-auto p-0" align="start">
289300
<Calendar
290301
mode="range"
291-
numberOfMonths={2}
302+
numberOfMonths={isMobile ? 1 : 2}
303+
className="max-md:[--cell-size:2.75rem]"
292304
defaultMonth={openingMonth}
293305
selected={{ from: rangeFrom, to: rangeTo }}
294306
onSelect={(range: any) => {
@@ -529,13 +541,13 @@ function SelectFilter({ def, value, onChange, dataSource }: { def: DashboardFilt
529541
value={value ? String(value) : ALL_VALUE}
530542
onValueChange={(v) => onChange(v === ALL_VALUE ? undefined : v)}
531543
>
532-
<SelectTrigger className="h-8 w-auto min-w-32" aria-label={label} data-testid={`dashboard-filter-${def.name}`}>
544+
<SelectTrigger className={cn('h-8 w-auto min-w-32', PHONE_TARGET)} aria-label={label} data-testid={`dashboard-filter-${def.name}`}>
533545
<SelectValue>{selectedLabel ?? `${label}: ${tt('dashboard.filters.all', 'All')}`}</SelectValue>
534546
</SelectTrigger>
535547
<SelectContent>
536-
<SelectItem value={ALL_VALUE}>{tt('dashboard.filters.all', 'All')}</SelectItem>
548+
<SelectItem value={ALL_VALUE} className={PHONE_TARGET}>{tt('dashboard.filters.all', 'All')}</SelectItem>
537549
{options.map((o) => (
538-
<SelectItem key={o.value} value={o.value}>{o.label}</SelectItem>
550+
<SelectItem key={o.value} value={o.value} className={PHONE_TARGET}>{o.label}</SelectItem>
539551
))}
540552
</SelectContent>
541553
</Select>
@@ -553,7 +565,7 @@ function TextFilter({ def, value, onChange }: { def: DashboardFilterDef; value:
553565
};
554566
return (
555567
<Input
556-
className="h-8 w-36"
568+
className={cn('h-8 w-36', PHONE_TARGET)}
557569
type={def.type === 'number' ? 'number' : 'text'}
558570
placeholder={label}
559571
value={draft}
@@ -600,7 +612,7 @@ export function DashboardFilterBar({ defs, values, onChange, onReset, dataSource
600612
return <TextFilter key={def.name} def={def} value={value} onChange={set} />;
601613
})}
602614
{onReset && isDirty && (
603-
<Button variant="ghost" size="sm" onClick={onReset} className="text-muted-foreground">
615+
<Button variant="ghost" size="sm" onClick={onReset} className={cn('text-muted-foreground', PHONE_TARGET)}>
604616
<RotateCcw className="size-3.5" />
605617
{tt('dashboard.filters.reset', 'Reset')}
606618
</Button>

‎ui/packages/plugin-dashboard/src/DatasetWidget.tsx‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,11 @@ export function DatasetWidget({ widget, dataSource, heading, onForbidden }: {
15041504
data-testid="dataset-export"
15051505
title={tt('dashboard.exportCsv', 'Export CSV')}
15061506
aria-label={tt('dashboard.exportCsv', 'Export CSV')}
1507-
className="absolute right-1 top-1 z-10 rounded p-1 text-muted-foreground opacity-70 hover:bg-accent/50 hover:text-foreground hover:opacity-100"
1507+
// objectstack#29078 — below `sm` the button is a 44 px touch target.
1508+
// At that size, pinned over the table's top-right corner, it would
1509+
// cover the last column's sort button, so on a phone it leaves the
1510+
// corner and takes its own right-aligned row above the table.
1511+
className="absolute right-1 top-1 z-10 rounded p-1 text-muted-foreground opacity-70 hover:bg-accent/50 hover:text-foreground hover:opacity-100 max-sm:static max-sm:ml-auto max-sm:flex max-sm:size-11 max-sm:items-center max-sm:justify-center"
15081512
>
15091513
<Download className="h-3.5 w-3.5" />
15101514
</button>
@@ -1648,7 +1652,8 @@ export function DatasetWidget({ widget, dataSource, heading, onForbidden }: {
16481652
return (
16491653
<td
16501654
key={`${cc.col.id}-${cc.measure}`}
1651-
className={cn('px-2 py-1 text-right tabular-nums whitespace-nowrap', clickable && 'cursor-pointer hover:bg-accent/40')}
1655+
// A drillable cell is a 44 px touch target below `sm` (#29078).
1656+
className={cn('px-2 py-1 text-right tabular-nums whitespace-nowrap', clickable && 'cursor-pointer hover:bg-accent/40 max-sm:h-11 max-sm:min-w-11')}
16521657
data-testid={clickable ? 'dataset-drill-cell' : undefined}
16531658
onClick={clickable ? () => openDrill(index as number, title) : undefined}
16541659
>
@@ -1867,8 +1872,9 @@ export function DatasetWidget({ widget, dataSource, heading, onForbidden }: {
18671872
type="button"
18681873
onClick={() => cycleSort(c)}
18691874
data-testid="dataset-table-sort"
1875+
// 44 px tall below `sm` (#29078), so a phone can tap the sort.
18701876
className={cn(
1871-
'inline-flex w-full select-none items-center font-medium transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
1877+
'inline-flex w-full min-h-11 sm:min-h-0 select-none items-center font-medium transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
18721878
numeric ? 'justify-end' : 'justify-between',
18731879
)}
18741880
>
@@ -1898,7 +1904,9 @@ export function DatasetWidget({ widget, dataSource, heading, onForbidden }: {
18981904
// A comparison column formats as the measure it compares.
18991905
const measure = compareOf(c) ?? (values.includes(c) ? c : undefined);
19001906
return (
1901-
<td key={c} className={cn('px-2 py-1 whitespace-nowrap tabular-nums', numericColumns.has(c) && 'text-right')}>
1907+
// A drillable row is a 44 px touch target below `sm` (#29078);
1908+
// a `td`'s height is its floor, so the row grows to it.
1909+
<td key={c} className={cn('px-2 py-1 whitespace-nowrap tabular-nums', numericColumns.has(c) && 'text-right', canDrill && 'max-sm:h-11')}>
19021910
{measure
19031911
? formatMeasure(row[c], measureField(measure)?.format, measureCellCurrency(measureField(measure), state.rows[index]), measureField(measure)?.percentScale, displayLocale)
19041912
: formatDimensionValue(row[c], displayLocale)}

‎ui/packages/plugin-dashboard/src/OpenInListButton.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import React from 'react';
2020
import { useDrillNavigation } from '@object-ui/react';
21-
import { Button } from '@object-ui/components';
21+
import { Button, cn } from '@object-ui/components';
2222
import { useSafeTranslate } from '@object-ui/i18n';
2323
import { ArrowUpRight } from 'lucide-react';
2424

@@ -49,7 +49,8 @@ export const OpenInListButton: React.FC<OpenInListButtonProps> = ({
4949
type="button"
5050
variant="ghost"
5151
size="sm"
52-
className={className}
52+
// 44 px tall below `sm`, a phone's touch-target floor (objectstack#29078).
53+
className={cn('min-h-11 sm:min-h-0', className)}
5354
data-testid="drill-open-in-list"
5455
onClick={() => {
5556
openRecordList(objectName, filter);

0 commit comments

Comments
 (0)