Skip to content

fix(ux): remove layout shifts and explain blocked legend toggles / 消除布局偏移并说明被禁用的图例切换 - #1551

Merged
adibarra merged 4 commits into
masterfrom
fix/layout-shift-ux
Oct 29, 2026
Merged

adibarra merged 4 commits into
masterfrom
fix/layout-shift-ux

Conversation

@adibarra

@adibarra adibarra commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 7 of the stack split from #1530. Review and merge in order. CI only runs on PRs that target master, so each layer was verified locally; the combined change passed full CI on #1530.

Stack (merge in order):

  1. fix(next): stop the image optimizer hanging after a cancelled request / 修复请求取消后图片优化器卡住的问题 #1545 Next image optimizer patch
  2. feat(api): negotiate compression, add ETag/304 and stale-while-revalidate purges / API 协商压缩,支持 ETag/304 与 stale-while-revalidate 失效 #1546 API response caching
  3. fix(dashboard): load benchmarks in parallel with availability / dashboard 的 benchmarks 与 availability 并行加载 #1547 Dashboard data waterfall
  4. fix(seo): social images, canonicals, titles, intros, structured data and sitemap / SEO:社交图片、canonical、标题、简介、结构化数据与 sitemap #1548 SEO metadata
  5. feat(seo): render compare, run, rankings, overview and blog index with ISR / compare、run、rankings、overview 与博客索引改用 ISR #1549 ISR for programmatic pages
  6. fix(perf): cut client bundle, image and prefetch weight / 减少客户端代码、图片与预取体积 #1550 Client bundle, image and prefetch weight
  7. fix(ux): remove layout shifts and explain blocked legend toggles / 消除布局偏移并说明被禁用的图例切换 #1551 Layout shift and UX ← this PR
  8. fix(analytics): correct pageviews, proxy PostHog and stop sending search text / 统计:修正 pageview、代理 PostHog 并不再发送搜索文本 #1552 Analytics pageviews and privacy
  9. feat(analytics): cover untracked interactions, add event context and standardize keys / 统计:覆盖未追踪的交互,补充事件上下文并统一键名 #1555 Analytics coverage

Vercel Speed Insights showed poor CLS on /collectivex (0.81), /inference/agentic/[id] (0.61), /calculator/[model] (0.32), /operatorx (0.30) and the profit estimator.

  • Layout shift. Loading states now keep their final height in CollectiveX, agentic point detail, calculator and profit displays, and the evaluation table. useHeldHeight keeps the height during reloads. On agentic point detail, the metric-source toolbar slot is always reserved; when no toolbar mounts (single source, no warmup, which no current point has) a 50px gap remains instead of a jump.
  • CollectiveX crash. Tooltips no longer crash on null percentiles.
  • OperatorX GPU toggle. A GPU stays selected when you remove the last other one. (An earlier useDeferredValue split for interaction speed was removed after review found it let charts, legend and case detail read different snapshots.)
  • Blocked legend items. Items blocked by the engine-comparison rule show why, both visually and to screen readers, through an sr-only checkbox with aria-disabled and aria-describedby. The blocking rule is unchanged.
Validation details

Targeted Cypress (Chrome): chart-legend component 26/26, collectivex 29/29, throughput-calculator 38/38, fleet-lifecycle 32/32. Lint, format, typecheck and the full unit suite pass on this layer.

AI model disclosure
  • Model/version: anthropic/claude-opus-5-5 (runtime-exposed identifier for the coordinating agent).
  • Role: audited the site, planned and integrated the change set, split it into this stack, and wrote commit and PR text.
  • Delegated agents (scout, worker and critic subagents) implemented slices, built the stack and ran verification under the same harness. Their exact model identifier was not exposed to the coordinating agent, so it could not be verified.
PR checklist
  • I have completed the AI model disclosure and kept it current
  • Added, changed, or removed filters, views, or pages include the matching API and inferencex-skills changes (no filters or views change)
  • New or changed indexable pages ship their /zh sibling
  • Changed Chinese copy follows the PR review checklist in docs/chinese-copy.md (Chinese maintainer review pending)
中文

本 PR 为从 #1530 拆分的 stack 中的第 7 部分,请按顺序审核与合并。CI 只在以 master 为目标的 PR 上运行,因此每一层都在本地验证;整体改动已在 #1530 上通过完整 CI。

Vercel Speed Insights 显示 /collectivex(0.81)、/inference/agentic/[id](0.61)、/calculator/[model](0.32)、/operatorx(0.30)与 profit estimator 的 CLS 较差。

  • 布局偏移。 CollectiveX、agentic 数据点详情、calculator 与 profit 页面以及 evaluation 表格的加载状态现在保持最终高度;useHeldHeight 在重新加载时保持高度。agentic 数据点详情始终为指标来源工具栏预留位置;不显示工具栏时(单一来源且无 warmup,目前没有数据点属于这种情况)保留 50px 空白,而不是发生跳动。
  • CollectiveX 崩溃。 提示框遇到空百分位值不再崩溃。
  • OperatorX GPU 切换。 移除最后一块其他 GPU 时保留当前选择。(此前为提升交互速度引入的 useDeferredValue 拆分已移除,因为审查发现它会让图表、图例与详情读取不同的状态快照。)
  • 被禁用的图例项。 被引擎对比规则禁用的图例项通过带 aria-disabled 与 aria-describedby 的 sr-only checkbox,在视觉上和屏幕阅读器中说明原因;禁用规则本身不变。

验证:定向 Cypress(Chrome):chart-legend 组件 26/26、collectivex 29/29、throughput-calculator 38/38、fleet-lifecycle 32/32。本层的 lint、格式、类型检查与完整单元测试均通过。

AI 模型使用说明:协调 agent 使用 anthropic/claude-opus-5-5(运行环境提供的标识),负责审计、规划与整合改动、拆分 stack 以及撰写提交与 PR 文本;委派的子 agent 在同一环境中实现各部分、构建 stack 并运行验证,其确切模型标识无法获取,因此无法确认。


Note

Medium Risk
Touches widely used loading UX and inference filter legend behavior, but changes are mostly presentational plus defensive chart formatting; OperatorX GPU selection logic could affect comparison workflows if mis-specified.

Overview
Targets poor CLS on calculator, CollectiveX, agentic detail, OperatorX, and profit views by reserving layout during loading. New useHeldHeight pins min-height on profit controls and root while data refetches; throughput calculator, evaluation table skeletons, and agentic detail (loading placeholders, always-reserved metric-source toolbar slot via showMetricSourceToolbar) follow the same idea. CollectiveX and OperatorX loading cards use min-h-svh, and CollectiveX stats show placeholders while runs load.

Inference scatter legend now surfaces engine-comparison blocks: blockedComparisonToggles feeds blockedReason on legend items with aria-disabled, aria-describedby, tooltips, and cursor-not-allowed while clicks still fire for existing toast behavior; vLLM/SGLang consent paths stay unblocked.

CollectiveX / swap charts move latency percentile formatting to formatCollectiveXLatencyPercentiles (null percentiles render as - instead of crashing tooltips) and omit swap points when the selected percentile is missing or non-finite.

OperatorX adds toggleHardwareSelection so the last selected GPU cannot be cleared (fixing empty selection after workload switches), with dashboard integration tests; VizCard is memoized.

Reviewed by Cursor Bugbot for commit a257455. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
inferencemax-app Ready Ready Preview Oct 29, 2026 6:26am UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6411061. Configure here.

…nd toggles

Loading states keep the height of the content they replace. CollectiveX
fills its stats row and chart area before data arrives and tolerates
missing percentiles. The agentic point detail, the calculator and profit
displays and the evaluation table get placeholders of their final height,
and useHeldHeight holds a section's last height through a refetch.
OperatorX defers its heavy comparison inputs and keeps the last selected
GPU selected. When the engine exclusion blocks enabling a hardware entry,
the legend item shows why with a not-allowed cursor and an accessible
description, and its checkbox stays reachable by keyboard.

中文:加载状态保持所替换内容的高度。CollectiveX 在数据到达前预留统计行与
图表区域,并兼容缺失的分位数。智能体数据点详情、计算器与利润展示以及评测
表格使用与最终高度一致的占位,useHeldHeight 在重新请求期间保持区块上一次的
高度。OperatorX 延后处理开销较大的对比输入,并始终保留最后一个已选 GPU。
当引擎互斥规则阻止启用某个硬件时,图例项通过禁止光标与无障碍描述说明原因,
其复选框仍可通过键盘访问。
The 50px spacer on /inference/agentic/[id] only rendered while the metrics and request-chart queries loaded. For a point with one metric source and no warmup phase the toolbar never mounts, so the spacer unmounted on settle and the cards jumped up. Both inputs come from client queries and cannot be known earlier, so the slot now stays reserved whenever the toolbar is hidden. A production sample showed 46 of 46 points have a warmup phase, so the toolbar remains the usual outcome. The decision is extracted into showMetricSourceToolbar with a unit test.

中文:/inference/agentic/[id] 页面上的 50px 占位只在指标和请求图表查询加载期间显示。若数据点只有一个指标来源且没有 warmup 阶段,工具栏不会挂载,占位在查询完成后被移除,导致下方卡片上移。两项输入都来自客户端查询,无法提前得知,因此现在只要工具栏隐藏就保留该占位。生产数据抽样显示 46 个数据点全部带有 warmup 阶段,工具栏仍是常见情况。判断逻辑提取为 showMetricSourceToolbar 并补充单元测试。
The chart model memo still depended on the urgent GPU list, so a workload
change rebuilt it during the urgent render. Every chart card then
re-rendered with the old comparison view and a toggle bound to the new GPU
list. The model now depends only on deferred inputs, and the legend toggle
resolves clicks against the GPU list the charts show. A jsdom test records
each model the charts receive across a workload switch.

中文:图表 model 的 memo 仍依赖紧急更新的 GPU 列表,切换工作负载时会在紧急渲染中
重建,所有图表卡片因此以旧的对比视图和绑定新 GPU 列表的 toggle 重新渲染。现在
model 只依赖延迟快照中的输入,图例切换也按图表当前展示的 GPU 列表处理点击。新增
jsdom 测试,记录切换工作负载时图表收到的每个 model。
Remove the useDeferredValue chart snapshot. Legend toggles, the GPU control, the charts and case detail mixed deferred and live selections, which could blank the charts or open the wrong case. Keep the min-h-svh loading card, memoized chart cards and the last-GPU toggle guard. Tests now cover workload switches, toggling and inspect against one state.

中文:移除 useDeferredValue 图表快照。图例切换、GPU 控件、图表和用例详情混用了延迟与实时的选择,可能导致图表空白或打开错误的用例。保留 min-h-svh 加载卡片、图表卡片的 memo 以及保留最后一个 GPU 的切换逻辑。测试改为验证切换负载、切换 GPU 和查看详情时使用同一状态。
Base automatically changed from fix/client-bundle-weight to master October 29, 2026 06:24
@adibarra
adibarra force-pushed the fix/layout-shift-ux branch from 1ce3c49 to a257455 Compare October 29, 2026 06:24
@adibarra
adibarra merged commit 5066fec into master Oct 29, 2026
33 checks passed
@adibarra
adibarra deleted the fix/layout-shift-ux branch October 29, 2026 06:32

This branch was successfully deployed

1 active deployment
Preview — a257455f Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant