Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/dashboard/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions docs/.agents/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
| I-013 | Dashboard 无用量数据时第二次刷新起抛 TypeError(图表空态替换掉 canvas 后未恢复) | ✅ 已完成 | 2026-11-24 | [详情](#I-013) |
| I-014 | Model Bind 下拉缺 GLM 5.4(pricing 与调用记录已有,但内置目录停在 GLM 5.3) | ✅ 已完成 | 2026-11-27 | [详情](#I-014) |
| I-015 | Dashboard 编辑 Model Calling 并行度时轮询提交半截输入、每次编辑连发两个 PUT | ✅ 已完成 | 2026-11-27 | [详情](#I-015) |
| I-016 | Overview 分布卡图形区下限 250px 高过 3 行订阅卡,订阅卡底部留白 81px(下限改为 180px,两卡等高) | ✅ 已完成 | 2026-11-28 | [详情](#I-016) |

---

Expand Down Expand Up @@ -593,3 +594,28 @@ Model Calling 改为按 vendor / model 键复用行节点,轮询只改文字
同类风险:其它「变更即提交」的控件,以及任何用 `innerHTML` 周期性重建、内部含输入控件的列表。排查时先问两件事:重绘会不会移除正在编辑的节点;提交函数重入时会不会再发一次请求。用浏览器自动化复现这类时序问题时,要直接调用页面的刷新函数制造「输入到一半时刷新到达」,不要等真实的轮询周期。

---

<a id="I-016"></a>
## I-016:Overview 分布卡图形区下限 250px 高过 3 行订阅卡,订阅卡底部留白 81px

**问题描述**

订阅状态只有 3 行(GLM Coding Plan / Claude Code / Antigravity)时,Overview 并排的两张卡虽然等高,订阅卡底部却有约 81px 空白,环形图在分布卡里上下留出大片空地。视口 1228px 实测:分布卡 329px,订阅卡内容只有 269px,图例折到环下方,环直径 186px。README 首图用 4 行订阅(333px)数据,恰好盖住了这个问题。

**表因根因**

表因:`.dist-card .chart-wrap` 的 `min-height: 250px`,加上分布卡标题(含 16px 下边距)与上下内边距共 79px,分布卡下限是 329px,高于 3 行订阅卡的自然高度 269px,网格默认的 `align-items: stretch` 把订阅卡拉高到 329px。根因:下限按 4 行订阅(333px)的首图数据定,没有拿订阅行数偏少的常见形态校验;等高网格里谁的下限更高,谁就决定整行高度。

**处理方式**

下限改为 180px,图形区的 `flex: 1 1 0` 照旧吃余量:3 行时图形区恰为 190px,两卡同为 269px。4 行(333px)与 8 行(589px)时与改前逐像素一致(hero / worst 数据集整页截图逐字节相同),堆叠档(1179px 及以下)不受影响。订阅行数 4 到 3 再回 4 时,分布卡 333 到 269 再回 333,随行数回缩。截图同构数据在 1228px 下环直径 186 缩到 126px。`tests/test_dashboard_overview.py` 钉住下限不超过 190px。

**后续防范**

等高网格里的保底高度,要小于最矮常见形态的内容高度;验证两栏等高要用 3 行订阅的数据(用户实机的常见形态),不能只看 README 首图的 4 行。

**同类问题影响与处理注意事项**

订阅行只有 1 到 2 行(空数据)时,订阅卡仍会被 180px 下限拉高留白,属等高网格的固有表现,不再继续降下限(环会小到难以辨认)。供应商 6 个以上且视口窄于 1300px 时图例折成 3 行,环直径约 99px,仍可辨认。其它「随邻卡等高 + min-height」的组合改动时,同样先算邻卡最矮形态的内容高度。

---
5 changes: 3 additions & 2 deletions src/coding/proxy/server/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,10 @@ def file_response(self, *args: Any, **kwargs: Any) -> Response:
}
/* 分布卡随左卡等高:标题留在顶上,图形区吃掉余量,甜甜圈与图例在余量里垂直居中。
flex-basis 取 0 而不是 auto:auto 会让图形区的高度钉在 canvas 上一次写下的像素高度上,
左卡变矮后这一行回不去 */
左卡变矮后这一行回不去。min-height 只在订阅行很少时保底,须 ≤ 190px(3 行订阅卡 269px 减去
标题与内边距 79px),否则分布卡撑高整行,订阅卡底部留白 */
.dist-card { display: flex; flex-direction: column; }
.dist-card .chart-wrap { flex: 1 1 0; height: auto; min-height: 250px; }
.dist-card .chart-wrap { flex: 1 1 0; height: auto; min-height: 180px; }
@media (max-width: 1179px) {
.status-row { grid-template-columns: minmax(0, 1fr); }
.dist-card .chart-wrap { flex: none; height: 240px; min-height: 0; }
Expand Down
5 changes: 4 additions & 1 deletion tests/test_dashboard_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ def test_overview_css_constraints(client: TestClient):
focus = _rule(html, ".trend-panel:focus-visible")
assert "outline: 2px solid var(--accent-blue); outline-offset: -2px;" in focus
# 分布卡图形区的 flex-basis 为 0:钉在 canvas 上一次写下的像素高度上,左卡变矮后这一行回不去
assert "flex: 1 1 0;" in _rule(html, ".dist-card .chart-wrap")
dist_wrap = _rule(html, ".dist-card .chart-wrap")
assert "flex: 1 1 0;" in dist_wrap
# 图形区下限 ≤ 190px(3 行订阅卡 269px 减去分布卡标题与内边距 79px):更高则整行被分布卡撑高,订阅卡底部留白
assert int(re.search(r"min-height: (\d+)px", dist_wrap).group(1)) <= 190
# 模型名最多折两行,不默认截断(全名只在 title 里,键盘与触屏拿不到)
name = html[html.index(".mc-model-name {\n font-size: 12px") :]
assert "-webkit-line-clamp: 2" in name[: name.index("}")]
Expand Down
Loading