Skip to content

仪表盘在页面上编辑:管理员点「编辑」后拖动换位置、调大小、加卡片、改卡片;写明每张卡片跟不跟顶部筛选变;保存即生效 #36372

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #36255(专题:仪表盘和报表的使用体验,维护者直派)。⛔ 不是认领。优先级 p1(维护者 2026-11-22:「这几张卡都 p1」)。

本卡属于「运行界面的设计模式」这套方案,总说明和全部效果图在 #36359。

维护者说过的(2026-11-22)

  • 「我同意先做页面上的「编辑」」
  • 更早(2026-11-19)问到界面类修改是不是保存即生效,答:「是,保存即生效」

效果图(设计板图 49 的图二)

仪表盘的编辑状态和右侧属性栏

现状(主干 6c7c6db250,本机环境 HotCRM 6.5.0「高管总览」,浏览器实测)

  • 运行界面的仪表盘页右上角只有「全部刷新」,不能改。
  • Studio「界面」里可以改:中间是真实的仪表盘,右边属性栏列出全部卡片,点一张卡片出它的属性(标题、类型、数据集、维度、度量、过滤器绑定、颜色、宽高、删除)。改完要发布整个应用包。
  • 把顶部的时间筛选从「本季度」换成「上季度」:四张数字卡片和上面两张图完全不变,只有一张图变空。原因是每张卡片在 Studio 里单独勾选了跟不跟某个筛选变,但运行界面上看不出来。

要做的

入口和状态

  1. 仪表盘页右上角,系统管理员多一个「编辑」。普通成员没有。
  2. 点了进入编辑状态:页头变成「+ 添加卡片」「放弃」「保存」,标题旁一个「编辑中」的标记。卡片出现虚线框。
  3. 拖动卡片换位置;拖卡片的角调大小(按现有网格吸附)。
  4. 点一张卡片:卡片高亮,右边出属性栏。属性栏的内容和用词见报表专题里「编辑面板换成业务用词」那张卡;本卡先直接复用 Studio 现成的那一栏。
  5. 「+ 添加卡片」:加一张新卡片到末尾并选中它。属性栏里可以「删除这张卡片」。
  6. 顶部筛选旁「+ 添加筛选」可以加、删、改页面顶部的筛选项。

跟不跟顶部筛选变(要让人看得见)

  1. 属性栏里有一组「跟着页面顶部的筛选变」,每个顶部筛选一个开关。
  2. 不在编辑状态时也要显示:哪个筛选对这张卡片不起作用,卡片副标题后面就有一个小标记写明,比如「时间固定为今年」。全部都起作用的卡片不加标记。

保存

  1. 点「保存」直接生效,所有人看到,不用发布应用包。点「放弃」全部不要。
  2. 保存写的是应用的定制层,和 Studio 里改仪表盘存的是同一份;安装来的应用同样能改。

不做的

验收

  • 系统管理员打开「高管总览」:右上角有「编辑」;普通成员没有。
  • 进入编辑,把一张卡片拖到另一个位置、把一张图拖宽,保存:刷新后布局保持;普通成员看到同样的布局。
  • 加一张卡片、删一张卡片,保存:生效。
  • 做了改动后点「放弃」:和进来之前一样。
  • 不在编辑状态时:「行业收入分布」这类不跟时间筛选变的卡片上有「时间固定为…」的标记;换顶部时间筛选,有标记的不变,没标记的变。
  • 在属性栏里把一张卡片的「时间」开关打开并保存:标记消失,换时间筛选时它跟着变。
  • HotCRM(安装来的应用)上改一次:能保存;在 Studio 的「界面」里看到同样的改动。
  • 网络里:保存只有对仪表盘定义的写请求,没有发布应用包的请求。
  • PR 正文附编辑状态和带标记的卡片截图。

协调席自己加的(不是维护者原话)

  • 第 8 项「不在编辑状态也显示标记」和标记的写法。
  • 第 6 项在这里改顶部筛选。
  • 只有系统管理员有「编辑」。
  • 「不做的」五条。

没有核对的

  • Studio 里仪表盘的保存能不能跳过「发布」直接生效,还是现在只能存草稿。这决定第 9 项的工作量,没有读代码。
  • 仪表盘的网格是几列、卡片大小的最小值,没有量。
  • 普通成员现在看不看得到任何编辑入口,需要第二个账号,没有测。

Reader: domain:ui 车道。ui/packages/plugin-dashboard;Studio 里现成的仪表盘设计在 ui/packages/app-shell/src/views/studio-design/。

Dedupe: 仪表盘 编辑 运行界面(objectstack,open)→ 0。相关:#36256、#36230(数字准确,不重叠)。

Activity

  1. added
    enhancement
    priority:p2
    domain:ui
    on Nov 22, 2026
  2. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

    通知记录 · 2026-11-22T08:24Z

    维护者 2026-11-22:「后续 ux 专题立卡之后都通知 7号座位。」本卡按此通知席位 repo:objectstack#7,随后在它的信箱 #36199 里发一条。同批:#36362 #36363 #36364 #36366(设计模式专题 #36359)、#36370 #36371(列表专题)、#36372 #36373 #36374(报表专题)。

  3. added
    priority:p1
    and removed
    priority:p2
    on Nov 22, 2026
  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Feature · a child the coordinator filed under #36255 (dashboards and reports on the page) → p1 as set by the maintainer · size M.

  5. added
    pm:queue
    on Nov 22, 2026
  6. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

    Claim: PM loop round 4
    Session: session_01QsR2jTeURPvEm465RcoYEC
    Thread session: session_01QsR2jUeSU9HhKxjcVsyprx
    Account: zhuangjianguo
    Branch: claude/project-thread-jj5n19 (the thread's container pushes only to its own branch name)
    Worktree: objectstack-issue-36372
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: f7-seat (single-card thread; enters no area)
    File surface: the dashboard page and grid in ui/**, the customization-layer write path for dashboards, their tests; the property bar reuses the Studio panel as it stands
    Container & model: L, mode:thread, model: default tier (the thread re-derives dispatch-gates --tier at its head), effort: high (seat order)
    Clause-②: yes (widening) — new @object-ui/i18n keys for the new UI strings (the thread re-judges from the diff; a spec/schema change is told to the seat before push)
    Metadata-protocol: none (the thread re-judges from the diff)
    Responsibility: n/a — not a defect card
    Thread-read: 7076505985
    Premise: holds as filed (card 现状 read at main 6c7c6db; the thread re-measures first and stops on a premise that does not hold)
    Serial constraints cleared: rebases on #36373 if both touch the panel; overlap-check before every push.
    Pre-claim lane: repo:objectstack seat 7: the maintainer's 「后续 ux 专题立卡之后都通知 7号座位」 (relayed by coordinator#1, record 7076505985) and 「ux 新进一批 p1 卡,要优先派发」 (2026-11-22T08:40Z, seat thread); coordinator#1's take request 7076651522, acknowledged 7076693653.
    Pre-claim deps: #36373 (other thread) rewrites the shared panel's wording; this card rebases on it once landed and does not rewrite wording.
    Prior rulings read: epic #36359 (maintainer's words, board 49; the 2026-10-09 "no orchestration handles in the runtime" ruling stands, since editing controls appear only in the edit state); the thread runs check-prior-rulings.mjs --card 36372 before code.
    Resume-from: none (fresh from origin/main)

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  8. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jUeSU9HhKxjcVsyprx
    os-dev-report

    PR #36405 (draft), final head 3e7995a73b6f2176048981406fb832391a61c2e1: every check run on that head concluded success or skipped-by-design, mergeable_state: clean. 30 files, +1913/−21.

    Verdict on the card: done as ordered, on the plan the claim agreed (save-and-publish through the #35955 door per ruling 7058616478, the .custom pair for installed apps, refusal on a pending Studio draft, the mark reading resolveBoundField through the new exported dashboardFiltersNotApplied).

    Declarations (as claimed, re-judged on the diff): Clause-②: yes (widening) — dashboardFiltersNotApplied (core export), DashboardRenderer onWidgetResize / onAddFilter (optional props), new i18n keys. Metadata-protocol: none. Changeset patch on core, i18n, plugin-dashboard, app-shell.

    Acceptance against the card

    • Edit button, admins only: useStudioEntryGate on the dashboard's package (edit or view posture; kernel and unread list answer none). Pinned: no button behind the gate.
    • Edit state: Editing badge, hint, Add card / Discard / Save, dashed outlines, drag (existing reorder), corner resize by grid tracks (new handle, keyboard too), click → highlight + right panel (Studio's DashboardWidgetInspector / DashboardDefaultInspector, untouched; no wording change, so no rebase on 仪表盘和报表的编辑面板换成业务用词:字段显示标签不显示内部名,「维度」「度量」改成「分组」「指标」,图表类型用中文,标题不变成英文 #36373 was owed).
    • Add card at the end and selected; delete through the panel's Remove; "+ Add filter" opens the panel's Filters section (add / delete / edit globalFilters); per-card follow switches are the panel's existing filter-binding toggles.
    • Always-visible mark: drawn in view and edit mode; reads the same binding the query is built from. Pinned beside the query's runtimeFilter (opt-out, rebound, targetWidgets).
    • Save: writes into the owning package when writable, else <base>.custom from the ensure door with overrides: { package, basedOn }, draft under ifNoneMatch: '*' then that one item's publish (no package publish). Pending Studio draft → not entered / nothing written. Discard drops everything. Pinned through the real DashboardView.
    • Out of scope kept out: undo, business-user copy, new dashboard, chart drawing, drill-down, Studio.

    Deviations

    1. saveAndPublishRuntimeMetadata is NOT widened: the package is bound by wrapping the client's save / publish / reset. A first cut added a { packageId } option; overlap-check showed it conflicting with fix(console): Shared in Add view only for administrators who can write it, and published at once (#36409) #36398 (which edits the same save call), so it was reverted to keep both PRs merging cleanly.
    2. Edit is offered from the sm breakpoint up only (the panel needs the width); the corner handle is not drawn on a phone.
    3. One existing test outside the card's files was touched: AppContent.dashboardRouteReads-28784.test.tsx's useStudioDesignGate mock now also answers useStudioEntryGate (Test UI 11/16 red on b0637777 → green on the final head). No assertion changed.
    4. Screenshots come from a temporary static harness (real header pieces, renderer and Studio panels, no backend), deleted before commit; attached in the project thread, not on GitHub.

    Local verification (all under os-verify-lock): type-check core / plugin-dashboard / app-shell green; 145 tests across the 15 dashboard view, renderer and persistence files, the i18n suite, check-i18n-en-drift, call-site and dead-key checks green. dispatch-gates --ran: 72 of 72 families run; four reds on the first pass were re-run green (two were my own harness and build prerequisites, one an OOM kill on the shared box, one check:test-source-alias finding fixed in the tests). overlap-check clean against main and 10 open PRs.

    ADR: the PR cites seat 7's ADR-0146 D1 row on #36086 and ADR-0034; no docs/adr edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpm:dispatchedpriority:p1

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions