Repository navigation
Conversation
issue #154 PR#1。设计经人类拍板:卡点1=盘级筛选器取值(A)、卡点2=增量式嵌套。 - 布局新增 type:"container" 栅格块(title/pinned),成员筛选器用扁平 containerId 反向指向容器——与 pageId 同性质,绝不嵌套子块,保住后端 projectLayout 的 switch 与图表引用计数 jsonpath 两个按块读路径。 - 后端零改动:容器无 binding/chartId 被投影天然跳过;成员仍按自身 pageId/scope 走原取数链路,containerId 后端不读、纯前端渲染分流。 - 文档版本仍为 2(纯增量,旧前端读到丢弃容器块、成员退化独立块,优雅降级)。 - 悬空 containerId 迁移后置 pass 剥离;会话内删容器由 handleRemoveWidget 就地清成员。 - 置顶=渲染分流:pinned 容器移到盘顶控件条、脱离栅格,四轴保留,取消置顶回原位。 - 契约先行:openapi DashboardWidget.type 加 container + containerId/pinned, gen_types.ts 手工同步(api-gen TS 半步当前坏,见 troubleshooting;Go 侧不 codegen layout)。 - 测试:schema 5 例 + 容器编辑器 4 例;全量 vitest 798 绿、tsc/biome 净。 - 真实浏览器 E2E:加容器/改标题/置顶↔栅格/加入筛选器归拢/删容器退回成员, 及 保存→layout_json 落库→reload 迁移重建 的整栈往返,均通过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
issue #154「仪表盘动态参数 + 查询容器」,经人类拍板解除阻塞后拆 2 个 PR。本 PR 是 PR#1:查询容器。
设计要点
type:"container"栅格块(label/pinned);成员筛选器用扁平containerId反向指向容器——与pageId同性质,不嵌套子块,从而保住后端projectLayout的 switch 与图表引用计数 jsonpath($.widgets[*] ? (@.chartId == …))两个按块读路径。binding/chartId,投影天然跳过;成员仍按自身pageId/scope走原取数链路,containerId后端不读、纯前端渲染分流(gridWidgetsOfPage排除被归拢的筛选器)。2(纯增量;旧前端读到丢弃容器块、成员退化为独立块 → 优雅降级)。containerId迁移后置 pass 剥离;会话内删容器由handleRemoveWidget就地清成员,筛选器不会凭空消失。pinned容器移到盘顶控件条、脱离栅格,四轴保留,取消置顶回原位。契约先行
api/openapi.yaml的DashboardWidget.type加container+containerId/pinned;gen_types.ts手工同步(api-gen的 TS 半步当前坏,见 troubleshooting;Go 侧本就 codegen 不含 layout schema,未受影响)。测试与验证
dashboardLayoutSchema.test.ts+5 例(容器采纳/悬空剥离/containerWidgetsOf/childrenOfContainer/gridWidgetsOfPage)。DashboardEditor.container.test.tsx新文件 4 例(成员在容器内渲染、移出、置顶分流、新建容器)。vitest798 绿;tsc --noEmit净;biome check src0 error(仅既有 CSS 警告)。layout_json原样落库 → 刷新 → 迁移重建 的整栈往返(container/pinned/containerId全部还原)。关联
Closes 一部分 #154(查询容器)。动态参数为后续 PR#2(依赖本 PR 的容器作控件落点)。
Test plan