Skip to content

字段修改历史:动态里的修改显示「旧值 → 新值」;字段和格子上可以看这一个字段的历次修改(数据后端已有) #36290

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #35590(记录页专题,维护者直派)。⛔ 不是认领。优先级 p2(协调席定的,维护者未指定)。

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

  • 「关于 attio 的用户体验,你再完整的试用一下和我们相关的各项功能,并提出优化改进意见和我沟通。」
  • 协调席汇报后,维护者:「1 2 3 6 7 继续确认」,复核后又要求「上一轮的四条,具体给我解释」。
  • 听完逐条解释(现状、Attio 的做法、建议的做法)后,维护者:「立」。
  • 本卡是四条里的第 3 条。

现状(主干 6c7c6db250,本机环境浏览器实测,1440 宽,自建应用「客户」)

我们的动态:只写更新了客户备注,展开后也没有前后值

  • 记录页「动态」里,一条修改写的是「Seed Admin 更新了 客户备注」,右边「2 次」。展开后是两行「Seed Admin 更新了 客户 "青岛海辰食品集团有限公司":客户备注」。看不到改之前和改之后的值。
  • 后端有数据:sys_audit_log 里每次修改各有一行,old_value 和 new_value 是修改前后的整条记录(实测这条记录的两次修改都查得到,备注的前后文字都在)。
  • 界面代码里有显示前后值的组件(FieldChangeItem),对象和字段上有「历史追踪」开关(trackHistory)。这个自建应用的字段没开。

Attio(同日浏览器实测):

Attio:在格子上看修改历史,原地一张小卡片

  • 在格子上右键选「查看修改历史」:原地弹出一张小卡片,列出谁、什么时候、把值改成了什么。

要做的

第一步

  1. 动态里的每条修改显示「字段名:旧值 → 新值」。旧值为空写「空」。长文本各截到一行,可以展开。
  2. 一次保存改了多个字段:一条动态下面每个字段一行。

第二步

  1. 记录页字段上、列表格子的右键菜单里加「修改历史」。点了在原地弹一张小卡片,只列这一个字段的历次修改:谁、什么时候、旧值 → 新值,最新的在上,先显示最近 10 次,可以加载更多。
  2. 这个字段从来没改过:卡片里写「没有修改记录」,并写上创建人和创建时间。

权限

  1. 看不到某个字段的人,在动态里看不到这个字段的修改行,也打不开它的修改历史。按字段当前的读取权限判断。

不做的

  • 不做「恢复到某个历史值」。
  • 不改审计日志怎么存、存多久。
  • 不改动态页签的分组和筛选。

验收

  • 改一条客户的「客户备注」并保存:动态里出现「客户备注:旧文字 → 新文字」。
  • 一次保存同时改电话和邮箱:一条动态,下面两行。
  • 在记录页「客户备注」上打开修改历史:列出历次修改,和动态里的一致。
  • 在列表的格子上右键「修改历史」:同一张卡片。
  • 一个没改过的字段:显示「没有修改记录」和创建信息。
  • 用一个没有某字段读取权限的账号:动态里没有那个字段的修改行,那个字段上也没有「修改历史」。
  • 单选、关联记录、人员字段:前后值显示的是选项名和记录名,不是内部编号。
  • PR 正文附动态和修改历史卡片的截图。

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

  • 分两步。
  • 第 5 项的权限规则。解释时协调席提了「敏感字段的旧值要不要显示」并建议按读取权限来,维护者说的是「立」,没有另作指示。
  • 「最近 10 次」「没有修改记录时显示创建信息」。
  • 「不做的」三条。

没有核对的

  • 前后值显示是不是受 trackHistory 开关控制、没开的字段该不该显示,没有读清楚代码。本卡写的是都显示;如果开关的本意是「没开就不显示」,请席位在卡上提出来由维护者定。
  • 按单个字段查修改记录,后端现在只能把整条记录的前后拿回来再比对,量大时够不够快,没有测。
  • 密码、密钥这类字段有没有另外的保护,没有查。

Reader: domain:ui 车道,后端查询可能要 domain:data 配合。ui/packages/plugin-detail/src/RecordActivityTimeline.tsx、FieldChangeItem.tsx;数据在 sys_audit_log。

Dedupe: 修改历史 字段、动态 旧值 新值(objectstack,open)→ 都是 0。

Activity

  1. added
    enhancement
    priority:p2
    domain:ui
    on Nov 22, 2026
  2. 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 #35590 (maintainer-directed, measured against Attio or Twenty), not a claim → p2 as set by the coordinator · size M.

  3. added
    pm:queue
    on Nov 22, 2026
  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

    Ruling: two questions · option A on both · the maintainer (Steedos) chose on two decision cards in the seat thread, each after an isolated Fable analysis

    1. 2026-11-22T08:25Z card 「确定记录页字段修改的前后值默认显不显示(字段修改历史:动态里的修改显示「旧值 → 新值」;字段和格子上可以看这一个字段的历次修改(数据后端已有) #36290)」 → 「默认显示,可逐个关闭」, consequence as shown: 「所有应用的记录页都能看到「旧值 → 新值」;不想显示的对象或字段可以单独关掉。」
    2. 2026-11-22T08:25Z card 「确定谁能看到记录页字段的修改前后值(字段修改历史:动态里的修改显示「旧值 → 新值」;字段和格子上可以看这一个字段的历次修改(数据后端已有) #36290)」 → 「能看这个字段的人」, consequence as shown: 「普通成员在能打开的记录上,看到自己有权读的字段的前后值;完整审计日志仍只给管理员。」

    Facts the cards were built on (the analysis, read at main c448c61): the record page reads sys_audit_log only when the object sets enable.trackHistory (default false); member_default grants no read of sys_audit_log, so a plain member sees no values there today; the 动态 stream (sys_activity, readable by members) carries "label: old → new" only for fields with per-field trackHistory: true; the ledger read is narrowed by org scope, the parent-record gate and field redaction, and secret/password values are masked at write.

    What the rulings bind:

    1. Old → new is shown by default on every object's record page; an object, or a single field, can turn it off. This reverses ADR-0052 §5b.1's opt-in default (recorded as a row on the week's ADR card ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086); Metadata-protocol: semantic (a published default changes meaning), Clause-② judged by the build.
    2. A member sees old → new on records they can open, only for fields they can read. The full audit ledger stays admin / auditor only (it also holds deletion, sign-in and record-view trails): members are NOT granted sys_audit_log. Seat reading, not the maintainer's words: the values reach members through the activity stream (or an equivalent per-field read that applies the same field-read rule), never by widening the ledger grant.
    3. The security floor is unchanged: a value the viewer cannot read is never sent to the browser.

    Execution: server + spec + record page, size L, so it is built in its own card thread with a schema/rules-face L2. #36289 step 2 follows it. needs-user-decision (if present) is removed in this act.

  5. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

    Claim: PM loop round 3
    Session: session_01QsR2jTeURPvEm465RcoYEC
    Thread session: session_01QsR2jRCdMrPNTumXfsr1mw
    Account: zhuangjianguo
    Branch: claude/project-thread-xu21qu (the thread's container pushes only to its own branch name)
    Worktree: objectstack-issue-36290
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: f7-seat (a single-card thread: server + spec + record page, size L, so it enters no area)
    File surface: the field-history default (packages/spec/src/data/object.zod.ts enable.trackHistory and the per-field trackHistory describe, their regenerated artifacts), the member-readable history carrier (packages/plugins/plugin-audit/src/audit-writers.ts and its redaction), the record page reader (ui/packages/app-shell/src/views/RecordDetailView.tsx, utils/auditHistoryDisplay.ts), their tests, changesets; split into PRs, server half first (measured by the thread before code)
    Container & model: L, mode:thread, model: default tier (the thread re-derives dispatch-gates --tier at its head), effort: high (seat order); the L2 runs on the schema/rules face at the contract-review tier from the seat
    Clause-②: yes (widening) — members newly see old → new values on fields they can read (the thread re-judges from the diff)
    Metadata-protocol: semantic (a published default changes meaning)
    Responsibility: n/a — not a defect card
    Thread-read: 7076513167
    Premise: holds (the ruling's Facts section, read at main c448c61; the thread re-measures first)
    Serial constraints cleared: #36289 step 2 follows this card; overlap-check before every push.
    Pre-claim lane: repo:objectstack seat 7, by the maintainer's choices on the seat thread (2026-11-22T07:18Z: the three-area plan and 「交接给你的任务 p1 p2 都要做」).
    Pre-claim deps: Ruling-ref: 7076513167 (both questions ruled A).
    Prior rulings read: ADR-0052 §5b.1 (opt-in, reversed by this ruling; amended through #36086); the thread runs check-prior-rulings.mjs --card 36290 before code.
    Resume-from: none (fresh from origin/main)

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  7. 22 remaining items

  8. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim: PM loop round 4 · 2026-11-23T08:52Z
    Session: session_01JQwxbZeHNsF3RWcWpj7rGj
    Thread session: session_01JQwxbZFiKZ188iQxqGgmnY
    Account: os-warren
    Branch: the card thread's own branch, named at its first push; the seat amends this claim then
    Worktree: objectstack-issue-36290
    Domain: domain:ui
    Seat: repo:objectstack#1
    Area: card thread #36290 (w4-C, rides with #36615)
    Dispatch: the maintainer's ruling in this seat's project thread, 2026-11-23 06:15Z (decision card 「只接 p1,体验类也接」) and 06:16Z verbatim 「ux 直接 p1 和 专题卡」: this seat takes area:ux p1 cards and ux epic children (child of ux epic #35590). Released to this seat by seat 2 (7094100854) on Steve's order 2026-11-23T05:20Z 「你没开始开发的都交给 objectstack #1」.
    File surface: ui/packages/app-shell/src/views/record*/** (field 「修改历史」 entry), the list grid cell context menu, the history read it calls; packages/spec/src/data/field.zod.ts hint for #36615; one changeset per moved package (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: opus — dispatch-gates --tier: no path-derived mandate, default tier (M, design judgement); the thread's first report states the served tier, effort: high
    Clause-②: no — if a server-side per-field history read is needed, the claim is amended (yes) before that code
    Metadata-protocol: none
    Responsibility: n/a — a feature card (part ③: card items 3, 4, 5)
    Thread-read: 7094100854
    Premise: parts ① (#36641) and ② (#36613) and PR 1 (#36399) landed; part ③ not started. The card thread measures whether whole-record before/after diffing is enough before adding any server read; a viewer without read on a field gets no entry (ruling 7076513167)
    Serial constraints cleared: no open PR names #36290 or #36615

  9. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 23, 2026
  10. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim amendment · 2026-11-23T08:55Z — the card thread's branch is named; it completes this seat's claim above.
    Branch: claude/project-thread-apg8e0 (from main 3cf6a44b)
    Reading (thread first report): no server or spec shape change; part ③ reads the record's activity and keeps one field's changes, so a reader withheld a field never receives it. #36615 is wording only. Clause-② stays no. Draft PR follows.

  11. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

    Claim amendment · 2026-11-23T10:07Z — amends claim 7095955329 and the branch amendment after it.
    PR: #36661 (draft, head 975c4c55), Fixes #36290 and Fixes #36615
    Clause-②: yes (widening)
    Metadata-protocol: none
    Reading (PR body and file list): new published exports from @object-ui/plugin-detail (the field history card), one optional field in @object-ui/types data-display.ts, new i18n keys in 11 locales, and the tracked authoring-hint text in packages/spec/src/data/field.zod.ts (wording only, no shape change). The claim said no. The widening owes an L2, and the *.zod.ts path puts it at CONTRACT_REVIEW_TIER, which the seat runs before ACCEPT.

  12. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbZFiKZ188iQxqGgmnY
    os-dev-report

    {
      "issue": 36290,
      "status": "done",
      "branch": "claude/project-thread-apg8e0",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36661",
      "session": "session_01JQwxbZFiKZ188iQxqGgmnY",
      "premise_still_valid": true,
      "summary": "Part 3 of #36290 with #36615. One field's change history opens in place, from a history button beside the value on the record page or from a list cell's context menu. The card shows who, when and old to new in the activity stream's own wording, newest first, ten at a time. A never-changed field shows 'No changes recorded' with its creator. The card reads sys_activity by record, never by a change column. Each open or Load more reads at most 4 batches of 50, and if those hold nothing it says 'No changes in the recent activity'. Neither entry is offered for a field the reader may not read, or whose values the writer never records (resolveFieldHistory). The spec 'tracked' hint now names fieldHistory. Contract review round 1 FAIL (7097637110: S1 history-off fields, S2 unbounded scan) was fixed at c429064ab8, and round 2 PASSed (7099294817). The seat ACCEPTed (7099956636) and enqueued the PR.",
      "tests": "At c429064ab8: the 2 new pin files 18/18. Affected packages under os-verify-lock (plugin-detail, plugin-grid, i18n, types, components/renderers/complex, app-shell defaults mirror): VERDICT command-exit 0, 1260 files / 19388 tests. RecordDetailView.harness + i18n call-site parity: 234/234. packages/spec field.test.ts 308/308 at 975c4c5576, and no spec file moved since. type-check exit 0 on plugin-detail, plugin-grid and i18n (components and types at 975c4c5576). Ablations via scripts/ablation-replace.mjs, each restored to blob == HEAD: the read gate removed gave 1 red; the scan forced exhausted gave 1 red; the first change kept gave 3 red; the resolveFieldHistory gate made a no-op gave 3 red; the batch cap removed gave 1 red.",
      "gates": "dispatch-gates at c429064ab8 derived the same 117 commands as at 975c4c5576 (diffed), and all 117 exit 0. overlap-check VERDICT clean. PR check-runs at c429064ab8, as the seat's ACCEPT 7099956636 cites them: 62 success, 11 skipped, 0 failed, every Test UI shard green.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "read-only GitHub MCP only: issue_read, pull_request_read (get_check_runs), subscribe_pr_activity; no write tool",
      "api_writes": "3 relay writes plus 2 pushes: fleet-write pr_create (#36661), fleet-write issue_patch (PR body at c429064ab8), this os-dev-report via post-stamped; git push 975c4c5576 and c429064ab8",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "noted, not filed: seeded showcase rows have no 'created' sys_activity row, so the card shows no creator line on them. This is by design: the card states only what is served and never falls back to created_by. Recorded in the PR body.",
        "carrier: contract review notes, not blocking: the short page on the 4th batch, the id dedupe and the keyboard-opened cell menu each lack a dedicated pin"
      ]
    }
  13. removed
    pm:dispatched
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions