Repository navigation
fix(web): harden the UI against worst-case data - #1381
Conversation
…emitter buildProject is an Effect in 0.4.0, so the Tinybird manifest is one too; the generator scripts run it at their top. The generated manifest, ClickHouse schema, insert mappings and local schema are byte-identical (6c40bbce). A parity test renders the schema through effect-orm from the same definitions and compares it with the emitter's snapshot. The one difference is real: the emitter drops ENGINE_VER, so self-managed and local session_replays have no version column on their ReplacingMergeTree.
A worst-case pass over every surface: long unbreakable names, emoji and diacritic initials, 0/1/huge counts, NaN and Infinity, future timestamps, deep traces, narrow widths and touch. - Wrong numbers: host CPU% averaged non-idle states (read ~1/7 of real usage), workloads with one name merged across namespaces, the service map node and panel disagreed across environments, "Infinity×" release ratios, 7.000000000000001% alert thresholds, UInt64 ids comma-formatted in AI tables, all-null series showing 0 stats. - Unreachable content: Clerk member/org lists stopped at 10, pod and container lists at 50, nodes/workloads/investigations capped silently, log drawer unscrollable after expanding a big body, deep spans losing their names to the indent, hover-only actions invisible on touch. - Shared primitives: MiddleTruncate, TruncatedCell, grapheme-safe initialsFrom; formatDuration gains ns/d tiers, sign and NaN handling; bytes reach PB; ListFooter pluralizes; Badge caps at its container; Item actions wrap on narrow cards; the topbar breadcrumb stays on one line. - Dev-only /lab/worst-case renders the affected components over worst-case fixtures behind a Demo / Worst case toggle.
|
Important Review skippedToo many files! This PR contains 188 files, which is 38 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configuration
📒 Files selected for processing (188)
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note A newer push replaced |
# Conflicts: # apps/api/package.json # apps/web/src/components/alerts/overview/active-incidents-table.tsx # apps/web/src/components/alerts/overview/rules-overview-table.tsx # apps/web/src/components/code-review/review-detail-sheet.tsx # apps/web/src/components/dashboard-builder/inline-editable-title.tsx # apps/web/src/components/dashboard-builder/widgets/stat-widget.tsx # apps/web/src/components/errors/error-signal-row.tsx # apps/web/src/components/infra/cloudflare/cloudflare-zone-table.tsx # apps/web/src/components/integrations/cloudflare-account-card.tsx # apps/web/src/components/logs/log-row-expanded.tsx # apps/web/src/components/logs/logs-table.tsx # apps/web/src/components/metrics/metric-detail.tsx # apps/web/src/components/metrics/metrics-table.tsx # apps/web/src/components/onboarding/onboarding-header-actions.tsx # apps/web/src/components/replays/replay-editor-timeline.tsx # apps/web/src/components/service-map/service-map-view.tsx # apps/web/src/components/services/service-api-tab.tsx # apps/web/src/components/services/service-operations-tab.tsx # apps/web/src/routes/code-review/issues.tsx # apps/web/src/routes/infra/containers/index.tsx # apps/web/src/routes/infra/kubernetes/nodes/index.tsx # apps/web/src/routes/infra/kubernetes/pods/index.tsx # apps/web/src/routes/infra/kubernetes/workloads/index.tsx # bun.lock # packages/backend/package.json # packages/domain/package.json # packages/query-engine-integrations/package.json # packages/query-engine/package.json
Maple review🟡 Confidence 6/10 · needs attention Hardens ~90 web surfaces against worst-case data: truncation, paging, number formatting, plus host CPU% now
Before merge
Production impactOpen errors in the changed files
After this merges, Maple checks whether they stop. What was checked
Files not reviewed (47)The review ended before it read these diffs, so nothing above vouches for them.
|
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Summary
A worst-case data pass over the whole web app: realistic long names, unbreakable emails and URLs, emoji and diacritic names, counts of 0, 1 and millions, NaN and Infinity, future timestamps, 60-deep traces, 390px widths and touch. Every surface was audited, then fixed area by area.
Wrong numbers
1 - idle.7.000000000000001, AI tool tables comma-formatted UInt64 ids (losing precision), all-null chart series showed 0 stats, tiny conversion and error rates printed "0%".Content you could not reach
L{depth}marker).truncateinside nowrap cells where it does nothing, so the table widened and pushed actions off screen.Shared primitives
MiddleTruncate(keeps the distinguishing tail of pod hashes, routes, paths, URLs),TruncatedCell, grapheme-safeinitialsFrom.formatDurationgains ns and day tiers, keeps the sign, rounds before choosing a unit and returns an em dash for NaN;formatNumberno longer prints "InfinityT"; byte formatters reach PB; uptime has<1mand year tiers; the replay clock rolls into hours; usage switches to TB.ListFooterpluralizes ("1 log"),Badgecaps at its container,Itemactions wrap on narrow cards, the topbar breadcrumb stays on one line and truncates.Dev-only lab
/lab/worst-caserenders the affected components over worst-case fixtures behind a Demo data / Worst case toggle (?data=worst). It 404s in production like every other lab.Not changed (needs a decision)
maxLengthonly on org rename.system.filesystem.utilizationmay not carry astateattribute in real data, which would make host disk % always 0. Worth checking against live data; the query filter is unchanged apart from excluding pseudo filesystems.Test plan
tscfor apps/web, packages/ui, packages/query-engine/lab/worst-caseat 1280px and 390px🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.