Repository navigation
fix(ui): dashboard KPI values and chart labels stay readable on a phone - #28223
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKuj2HUUN2wUhZ9Go
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKuj2HUUN2wUhZ9Go
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKuj2HUUN2wUhZ9Go
…ch for per-category bars Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKuj2HUUN2wUhZ9Go
|
domain:ui#1 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz Contract-review-claim: Contract review lane (Fable): declaration face (Clause-②: yes, no schema or governed path) at TIER_DEFAULT per |
|
domain:ui#1 · os-tesla · session_01L9qibzKuj2HUUN2wUhZ9Go
Generated by Claude Code |
The axis already read `2025-10` as `Oct 2025`; the tooltip header beside it still showed the raw key. ChartTooltipContent now runs its header through formatMonthBucketLabel in the display locale, and any other label reads as written. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKuj2HUUN2wUhZ9Go
|
domain:ui#1 · os-tesla · session_01L9qibzKuj2HUUN2wUhZ9Go The head moved to
Generated by Claude Code |
|
domain:ui#1 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz Contract-review-claim: |
|
domain:ui#1 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz Contract reviewServed-tier: Inputs: card #27520 body (rows 3, 15 and 18) and its comments (triage 6495077487, seat 4's split 6506509231, ui seat 1 claim 6526230292, os-dev-report 6529089724, claim amendment 6529126343); PR #28223 body, 14-file list and the diff against Delta since the 23380e9 review (claim 6529668734; re-claimed on this head): two commits. 644c6e3 merges origin/main 39da1bd (which carries the #28227 main-red fix): the PR's own hunks against the new merge base are identical to the reviewed ones (same file names, no content difference beyond hunk offsets) and main changed no file the PR touches. 63b2a69 is the should-fix below: ① Derived judgments
② Semver level
③ Boundary flags
Should-fix, resolved by 63b2a69 on this head: the chart tooltip header now reads a month bucket key as its month, the same face as the axis. Implemented-by: VERDICT: PASS |
|
domain:ui#1 · os-tesla · session_01L9qibzC6RxMfB59EsgAoNN 席位核对ACCEPT · seat 席位意见:仪表盘可读性三行。KPI 卡片的主数值在手机上不再被截成
|
Requested by Tesla · project thread
Part of #27520 — rows 3, 15 (the chart half) and 18 (the chart part). Every other row stays on the card.
Clause-②: yes (widening: @object-ui/core gains the public export formatMonthBucketLabel; no accept set moves)
Metadata-protocol: none
维护者速读
@object-ui包),不碰 spec、元数据和数据;数据行里的月份键不变,下钻与排序不受影响。回滚即 revert 本 PR。ui/packages/plugin-charts/src/AdvancedChartImpl.tsx(标签格式化、两个刻度组件、图例色块);ui/packages/plugin-dashboard/src/metricTile.ts(数据集 KPI 的字号阶梯);ui/packages/plugin-charts/src/ChartContainerImpl.tsx(图例色块)。$1,090,000.00;打开 CRM 的 Pipeline Dashboard,趋势图 X 轴应为 "Oct 2025 … Oct 2026",图例里 "vs last year" 是空心色块。What changes
DatasetWidget's metric tile drew every value at the short face (20 px, 24 px from a 160 px tile), so$1,090,000.00clipped in a phone's two-per-row tile. It now takesMETRIC_TILE_DATASET_VALUE_LADDERinmetricTile.ts: the same rungs as the plain tiles' ladder (objectui#12942), measured against the dataset tile's own box (no Card inset), never drawing 24 px under 160 px. Past the last rung the value keeps the ellipsis and carries the full figure as its tooltip. A short value keeps today's face and draws no tooltip. Compact notation ($1.09M) was not needed: shrink-to-fit holds the figure on a 390 px phone, and it would override the measure's declaredformat.@object-ui/coregainsformatMonthBucketLabel(value, locale)(utils/date-bucket-label.ts): aYYYY-MMbucket key readsOct 2025in the display locale, formatted in UTC so no zone moves it a month; anything else answersundefinedand keeps its text. The chart's category label reads it. The row's key is untouched, so drill-through and ordering are unchanged. The line/area edge inset (objectui#13390) is now sized from that face (Mmm 0000) instead of0000-00.url(#…), which no swatch can draw: every bar chart's legend had no swatch.AdvancedChartImplnow handsChartLegendContenta per-seriesLegendSwatch(the colour the mark is drawn in). AcompareTooverlay keeps its primary's hue (it mirrors it on purpose) and its swatch is drawn hollow, the way its mark is muted, so the two read apart. A lone bar series painted per category (semantic option colours) draws its label with no swatch, since no one colour names it.WrappedCategoryTick; a label still too long ends in…with the full text as an SVG title;xAxisTickFormatter, so the fit and rotation decisions measure the full label: a phone's few buckets rotate and drawIn Progresswhole (the rotated cap of 12 characters holds it). An unrotated label on a phone, and a rotated one past 12 characters, are still cut, andTitledCategoryTick(recharts' ownText) carries the full label as its tooltip.The widget descriptions on the CRM Pipeline dashboard that leak authoring notes ("Pie/donut/funnel ignore
compareTo", "(compareTo)") are example content inexamples/app-crm/src/dashboards/pipeline.dashboard.ts; not edited here, per the order.Tests
ui/packages/core/src/utils/__tests__/date-bucket-label.test.ts,ui/packages/plugin-charts/src/AdvancedChartImpl.dashboardReadability-27520.test.tsx,ui/packages/plugin-dashboard/src/__tests__/metricTileDatasetValueScale-27520.test.tsx.AdvancedChartImpl.pointAxisEdgeLabels-13390andAdvancedChartImpl.missingCategoryKeyread the month labels asAug 2026/Jan 2026; the edge-inset geometry assertions are unchanged and pass.AdvancedChartImpl.labelFitBand-13241asserted the full name was absent from the chart's wholetextContent; the tick's tooltip now carries it, so the assertion reads the drawn labels and pins the tooltip.metricTileLayout-12623pins the short face, and its fixture1964500is now past the short rung, so it uses196450; the long value is pinned in the new 27520 file.scripts/ablation-replace.mjswith an on-disk restore to the HEAD blob: removing the month label, the dataset ladder, the legend swatch colour or the wrap each turns its new test red (1 failed each). The first month ablation was a no-op (an empty replacement is refused) and was redone with--delete.Acceptance notes
main. The order says it belongs to console analytics: a formula declared returnType currency renders as a bare number, a KPI tile cannot show its description, percent fields always draw a progress bar, and report charts cannot split a series by a second dimension #27430 (closed). console analytics: a formula declared returnType currency renders as a bare number, a KPI tile cannot show its description, percent fields always draw a progress bar, and report charts cannot split a series by a second dimension #27430 shipped the tile caption (PR fix(plugin-dashboard): metric tile captions its value with the widget description #27972) and its row 1 is the formulareturnType: currencyface; neither puts a currency on a dataset KPI. Measured on this branch and at9f13ee81: the CRM Pipeline dashboard's Total Pipeline tile reads710,000, Won This Quarter235,000, Avg Deal Size81,000, with no currency, while the showcase's Total Budget reads$1,090,000.00. Not fixed here; reported to the seat for routing.2025-10), as it already did for an ISO day; only the axis reads the face.Verification
Browser, Chromium at 390×844 and 1440×900, Console from this branch's
ui/src (Vite) againstexamples/app-showcaseandexamples/app-crmbooted--fresh --seed-admin; the before column is the same stacks with the Console at the merge base9f13ee81.Measured before / after
In Progr…,In Revie…In Progress,In Review(rotated)2026-09,2026-10Sep 2026,Oct 20262025-10…2026-10Oct 2025…Oct 2026rgb(36, 99, 235)vs last yearhollow (1 px border, same hue)url(#…))vs previous periodhollowProspect…,Qualific…,Closed W…Prospecting,Qualificati…(title: Qualification),Closed WonLocal runs
At head
23380e90(this branch merged withorigin/mainat35f20551):scripts/pm/os-verify-lock.sh:pnpm install --frozen-lockfile, the@object-ui/plugin-dashboard...+@object-ui/plugin-charts...closure build,type-checkof@object-ui/core,@object-ui/plugin-chartsand@object-ui/plugin-dashboard, thenpnpm --dir ui exec vitest run --maxWorkers=2 packages/core/ packages/plugin-charts/ packages/plugin-dashboard/:VERDICT command-exit 0; Test Files 523 passed (523), Tests 7418 passed, 42 skipped (7460).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 commands, each run with</dev/null, allexit 0;--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED.pnpm --dir ui exec vitest run scripts/was SIGKILLed on its first run (the box was out of memory with the browser stacks still up); rerun alone after stopping them: exit 0, Test Files 169 passed, 2 skipped (171), Tests 4901 passed, 2 skipped.pnpm --dir ui check:new-line-citationsexit 0 (outside the derivation),node scripts/check-sdui-manifest.mjsexit 0.Generated by Claude Code