Skip to content

记录页「历史」时间线把 sys_audit_log.action 原始值大写后当徽章(UPDATED / CREATED),应显示字段选项的翻译标签 #28894

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_6eb9ec2e0e3f410b91239dab7a337b9e

立卡门类别:① 已复现缺陷(reach: 界面实测,见「已实测」)

Reader: domain:ui 车道,ui/packages/plugin-detail/src/HistoryTimeline.tsx:255-257。

Dedupe: repo:objectstack-ai/objectstack is:issue HistoryTimeline total=8(#8147 #27055 #4366 等,不同题);历史 UPDATED CREATED 英文 total=7,均为席位卡。同类问题在 Setup › 审计日志页另立一卡(不同组件、不同读者)。

业务理由:每个用户打开任何记录的「历史」tab,都会看到英文大写的 UPDATED / CREATED。翻译其实已经存在,只是没有用上。

来源

2026-11-02 staging 浏览器全量测试:cloud main 70e746ce,objectstack pin 6cbdef1e。控制面 https://cloud.objectos.app(组织 Release Check 1001,团队版,所有者账号),环境 https://os-2ph4c1.objectos.app(HotCRM 6.0.0)。维护者在会话里说:「把套餐页按钮缺陷和其余体验问题立成卡(先查重,按分诊规范)」「具体的问题清单列给我,用fable审核之后再立卡」。本卡的落点经第二个审核会话按 origin/main 核对过。

已实测

  • HotCRM 线索记录页 › 历史 tab:每条记录的操作徽章显示「UPDATED」「CREATED」,同一行的描述是中文(「更新了 线索 …:职位」)。

落点

  • HistoryTimeline.tsx:255-257:<Badge className="… uppercase">{entry.action}</Badge> 直接打印原始 action 值,再用 CSS 转大写;:84-99 只把 action 映射到徽章样式,不映射标签。
  • 正确来源:sys_audit_log.action 是带选项标签的 select(packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts:283-298),zh 翻译已存在(plugin-audit/src/translations/zh-CN.objects.generated.ts:26-40:update=更新,create=创建)。

验收

  1. 中文界面下历史徽章显示「更新」「创建」等选项标签,不显示英文大写原始值。
  2. 没有对应选项标签的值回退为原始值。
  3. 去掉 uppercase 对已翻译标签的影响(英文界面可保留现有样式)。

🤖 Generated with Claude Code

Activity

  1. added
    bug
    domain:ui
    area:i18n
    pm:queue
    on Nov 2, 2026
  2. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: p2 (priority added) · 2026-11-02T03:57Z

    ⛔ Not a claim.

    • Read fresh. The coordinator seat filed this as a reproduced ① defect with a measured UI reach and a named file, routed to domain:ui and queued. A user-visible defect with no protocol change: p2. Routing and the pm state are unchanged.

    Generated by Claude Code

  3. added
    priority:p2
    on Nov 2, 2026
  4. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y

    Claim: PM loop round 9 · 2026-11-02T04:09Z
    Session: session_01QsR2jR9wsxdgKzces31XWg (card thread, os-dev); dispatched by seat session session_01QsR2jR7ZFkpqmm4U8S1f9y
    Account: zhuangjianguo
    Branch: claude/project-thread-ci0v4j (platform-assigned to the card thread; it can push only this branch)
    Worktree: objectstack-issue-28894
    Domain: domain:ui
    Seat: domain:ui#4
    File surface: ui/packages/plugin-detail/src/HistoryTimeline.tsx (the action badge), its tests, and a changeset (stop on breach; explain in the report)
    Container & model: S, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: default
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the record page's 历史 badge prints the raw sys_audit_log.action value upper-cased (UPDATED / CREATED) | the action is a select with declared options and zh translations already served | every user opening any record's history tab
    Thread-read: 6568681767
    Premise: holds (at origin/main 9a9823d9, HistoryTimeline.tsx renders {entry.action} inside an uppercase Badge)
    Serial constraints cleared: none in flight on this file; #28895 (this seat) edits the Setup audit log page, not this file


    Generated by Claude Code

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 2, 2026
  6. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y

    Claim amended · 2026-11-02T04:11Z · file surface widened by one file, and the label source corrected by the dev's measurement. Branch, session and declaration lines are unchanged (Clause-②: no, Metadata-protocol: none).

    File surface (added):

    • ui/packages/plugin-detail/src/renderers/record-history.tsx: its self-fetch passes the source field of the action.

    Reading (the dev's premise check at origin/main 9a9823d9, HotCRM d4ffe99): the reproduced 历史 badge is an authored record:history block. It self-fetches sys_activity and maps action: r.type, so UPDATED / CREATED are sys_activity.type values (updated / created), not sys_audit_log.action (update / create). The badge therefore shows the declared option label of the field its entries come from, through the served translations (sys_activity.type here, 已更新 / 已创建 in zh-CN). HistoryTimeline takes an optional { object, field } source and resolves the label with useSafeFieldLabel().fieldOptionLabel. An entry with no declared source shows the raw value, and uppercase applies only to a raw value. The card's intent stands: no map in the ui, and the raw value as fallback.


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR9wsxdgKzces31XWg
    os-dev-report

    {
      "issue": 28894,
      "status": "done",
      "branch": "claude/project-thread-ci0v4j",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/28989",
      "head": "9ec21e47",
      "session": "session_01QsR2jR9wsxdgKzces31XWg",
      "premise_still_valid": true,
      "summary": "The record History badge shows the action's option label instead of the stored value upper-cased. HistoryTimeline takes an optional actionField ({ object, field }) and labels each badge with useSafeFieldLabel().fieldOptionLabel, falling back to the stored value; uppercase applies only to a stored value. record:history's self-fetch names sys_activity.type, so zh shows 已更新 / 已创建. Premise held in part: the reproduced badge reads sys_activity.type (updated / created), not sys_audit_log.action as the card says; the seat ruled route A and amended the claim (6568854052).",
      "tests": "At f7a834c5: all 363 plugin-detail test files in three locked batches, Test Files 362 passed + 1 skipped, Tests 3195 passed + 18 skipped. New files HistoryTimeline.actionLabel-28894 (4 cases) and record-history.actionLabel-28894 (2 cases). Ablations via scripts/ablation-replace.mjs, blob restored to HEAD and git diff HEAD empty each time: drop the record-history source = 1 red; drop the fieldOptionLabel read = 2 red; unconditional uppercase = 2 red. At 64c9ef50 (main merged): the 6 history test files 45/45 green; turbo type-check @object-ui/plugin-detail 48/48 (includes tsconfig.test.json). Real server: pnpm dev:crm --fresh at f7a834c5, GET /api/v1/i18n/translations/zh-CN serves objects.sys_activity.fields.type.options created=已创建, updated=已更新 (en serves each value as itself). NOT MEASURED: browser run of the built console History tab (needs console:build).",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 34 derived commands, all exit 0 at f7a834c5 and again at 64c9ef50 (PR-body gates run with GITHUB_EVENT_PATH carrying the final body). --ran at 64c9ef50: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Includes check-sdui-manifest.mjs (exit 0, manifest intact), check-changeset-no-major --base origin/main, check-adr-0087-registration, check-closing-keyword-parity, check:type-check-debt, check:query-options-erasure, pnpm --dir ui exec vitest run scripts/ (169 passed, 2 skipped files; 4900 passed, 2 skipped tests). check-partof-closing-keyword with PR_BODY: exit 0. Head 9ec21e47 merges main 00d0668d with no file under plugin-detail, i18n or react; nothing re-run there. CI check-runs: in_progress at report time.",
      "line_budget": "5 files, +229 / -4 = 233 changed lines (dispatch-gates count), under 3000",
      "files_changed": [
        ".changeset/28894-history-badge-option-label.md",
        "ui/packages/plugin-detail/src/HistoryTimeline.tsx",
        "ui/packages/plugin-detail/src/__tests__/HistoryTimeline.actionLabel-28894.test.tsx",
        "ui/packages/plugin-detail/src/renderers/__tests__/record-history.actionLabel-28894.test.tsx",
        "ui/packages/plugin-detail/src/renderers/record-history.tsx"
      ],
      "deviations": [
        "Label source corrected from the card's sys_audit_log.action to sys_activity.type, by the claim amendment 6568854052 (named in the PR body).",
        "Two new test files beside the existing ones (claim: its tests).",
        "HistoryTimelineProps, an exported type, gains one optional member (actionField); the claim's Clause-② no is copied verbatim for the seat to judge. HistoryActionField is not added to the package entry (index.tsx is outside the surface).",
        "No PR subscription and no assignee or reviewer: the dispatch contract (brief rule 10, os-dev.md) overrides the platform's PR-open posture."
      ],
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "4 — mcp__github__issue_read x3 (get, get_comments x2) on #28894, all reads; get_session (not GitHub). No MCP write.",
      "api_writes": "2 — relay pr_create (fleet-write run 41396155521, #28989, read-back identical) and this os-dev-report comment via post-stamped; git push is not a REST write",
      "open_questions": [],
      "out_of_scope_findings": [
        "class: none (observation) · DetailView's own history tab (schema.history.entries) names no source field, so its badges keep the stored value · carrier: none",
        "class: none (observation) · HistoryTimeline ACTION_VARIANT keys are sys_audit_log actions (update, create, delete…); every sys_activity entry (updated, created, deleted) gets the neutral outline tone, unchanged by this PR · carrier: none"
      ]
    }
  8. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y

    Claim amended · 2026-11-02T05:50Z · the Clause-② line corrected, and the file surface widened by one line of the package entry. Branch and session are unchanged.

    Clause-②: yes (widening)
    Metadata-protocol: none

    Reading (the seat's, on PR #28989 at 9ec21e47): HistoryTimelineProps is exported from @object-ui/plugin-detail (src/index.ts:169). It gains an optional actionField?: HistoryActionField. That is a new optional member of a published type, so the declaration is Clause-②: yes (widening). The seat's earlier amendment kept no in error. No published schema or governed text moves, so the review owed is the lane seat's own TIER_DEFAULT record of record (contract-review.md).

    File surface (added):

    • ui/packages/plugin-detail/src/index.ts: HistoryActionField joins the export type { HistoryTimelineProps, HistoryEntry } line, so a host can name the type of the prop it passes.

    Generated by Claude Code

  9. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y

    ACCEPT · 2026-11-02T06:25Z · PR #28989 at cb4cac0c, record 6570626586; contract review (TIER_DEFAULT) PASS 6570613806 on the same head. Ordinary queue landing follows.


    Generated by Claude Code

  10. objectstack-fleet commented on Nov 2, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y

    Landed · 2026-11-02T06:57Z · PR #28989 merged through the merge queue as 474b40e7. Records: ACCEPT 6570626586 and contract review (TIER_DEFAULT) PASS 6570613806, both at cb4cac0c.

    probe before (474b40e7~1) now (origin/main)
    actionField in plugin-detail/src/HistoryTimeline.tsx 0 5
    HistoryActionField in the same file 0 2
    HistoryActionField in the export type line of plugin-detail/src/index.tsx 0 1

    The card closed through Fixes. pm:dispatched comes off with this note.


    Generated by Claude Code

  11. removed
    pm:dispatched
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:i18nbugdomain:uipriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions