Repository navigation
feat(record-page): one field's change history, from the field and from a list cell's menu - #36661
Conversation
…m a list cell's menu The tracked authoring hint names fieldHistory. Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY Co-Authored-By: Claude <noreply@anthropic.com>
…oints and the cell column; docs and changeset Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY Co-Authored-By: Claude <noreply@anthropic.com>
…activity does Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5009f7f80bbde450a2e558d5b6e9b1928cd1d316 && git checkout 5009f7f80bbde450a2e558d5b6e9b1928cd1d316
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a731859def47e2c8cefcab4d635a1c45c60c2c1 c429064ab87fd8f123091fc95cb472087639762c && git checkout -B drift-repro 6a731859def47e2c8cefcab4d635a1c45c60c2c1 && git merge --no-ff c429064ab87fd8f123091fc95cb472087639762c
node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1
|
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: FAIL |
…e recorded, and bound the scan per click The record page's history button and the list cell's 「Change history」 are now gated by resolveFieldHistory, the predicate the audit writer keeps old → new by: a field with fieldHistory: false, an object with enable.fieldHistory: false, a credential field, or a default-off type that does not opt in offers neither, where the card could only have said 「No changes recorded」 of a field that was changed. Opening the card, and each 「Load more」, now reads at most four batches of the record's activity rows. When they hold no change of the field and older rows remain, the card says 「No changes in the recent activity」 and offers 「Load more」 to read on; 「No changes recorded」 needs every row read. A row repeated by a shifted $skip is kept once. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读记录页上每个字段、列表格子的右键菜单里,现在都能看到「这一个字段」的历次修改(谁、什么时候、旧值 → 新值)。看不到的字段值不会发到浏览器,不记录历史的字段不显示入口。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
Requested by Warren · project thread
Fixes #36290
Fixes #36615
Clause-②: yes (widening)
Metadata-protocol: none
Part 3 of the card, the last one: the per-field change history, its two entry points and the read-permission rule (card items 3, 4 and the 修改历史 half of item 5). Part 1 (#36399) made the server serve each changed field's old → new values narrowed per reader; part 2 (#36613) drew them under the record's activity entries; part 1 of the Studio producers (#36641) moved them to
fieldHistory. Ruling-ref: 7076513167 — a value the viewer cannot read is never sent to the browser, and thesys_audit_loggrant is never widened. #36615 rides along: it is the one sentence inpackages/specthat still told authors to writetrackHistory: true.维护者速读
What changes
The card (
ui/packages/plugin-detail/src/FieldHistory.tsx, new)FieldHistoryCardlists one field's changes on one record:who · whenoverold → new, newest first, the newest ten with Load more. The values are worded exactly as the activity lines word them — an option by the field's option label in the reader's language, a yes/no by the pack's word, an empty side by the pack's word for empty — through one new shared hook (fieldChangeText.ts,useFieldChangeWording), whichRecordActivityTimelinenow reads too, so the two surfaces cannot word the same change apart.createdactivity row.useFieldHistoryreadssys_activityby record, newest first, fifty rows at a time ($skip/$top), keeping the rows whose served change code names the field. One user action — the open, or one Load more — reads at mostFIELD_HISTORY_SCAN_BATCHES_PER_LOAD(4) batches: it stops sooner when it has the page it shows or the rows run out, and otherwise stops there and offers Load more to read on. When those batches held no change of the field and older rows remain, the card says No changes in the recent activity (new keydetail.fieldHistoryNoneRecent); No changes recorded needs every row read. A row repeated by a$skipshifted under a concurrent write is kept once. It reads no change column, because a query naming one is refused for a reader withheld any field of the object (parent-field-query-guard.ts), and it never readssys_audit_log.The two entry points
FieldHistoryButton, a history icon beside the value inDetailSection, revealed on hover and on keyboard focus like the copy button, opening the card in a popover. Drawn only for a field the object declares, on the page's own record, and only whenfieldHistoryOfferedsays so: not a platform record column (id,created_at, …), not a field whose old → new values the writer never records (resolveFieldHistory(field, object)from@objectstack/spec/data, the one predicate plugin-audit'schangeValuesShownForkeeps values by — false forfieldHistory: false, objectenable.fieldHistory: false, a credential field, and a default-off type such as image, file or JSON that does not opt in), and not a field the reader may not read (checkField(object, field, 'read')).data-tablenow names the data cell a context menu opened on to its host (context.column, a new optional member of the contextrenderRowContextMenureceives — adata-cell-columnattribute on the cell),ObjectGridadds Change history for a cell of a declared field thatfieldHistoryOfferedaccepts (recorded and readable, the same gate as the record page) when its data source can read activity, and choosing it opens the same card at the pointer (FieldHistoryPopover).FieldChangeItemdraws no label forlabel: '', so the card can name the field once above its lines.packages/spec— the unknown-key guidance row for the mistyped field keytrackednow namesfieldHistory: false(andenable.fieldHistory: falseon the object) instead oftrackHistory: true, which after #36399 changes nothing for most field types. Wording only:trackedstays rejected, no key, shape or default moves.Language packs —
detail.fieldHistory,detail.fieldHistoryNoneanddetail.fieldHistoryNoneRecentin all 11 locales@object-ui/i18nships, mirrored byte-identically inDETAIL_DEFAULT_TRANSLATIONS.Tests
New pins at head
c429064ab8:ui/packages/plugin-detail/src/__tests__/FieldHistory-36290.test.tsx(13): only this field's changes, newest first, with actor and timestamp; a save of two fields gives this field's line alone; the read names no change column ($filteris the record, and the params hold nochanged_fields/metadata); an option side reads as its label and an empty side asEmpty; the newest ten, then Load more to the rest; paging past a full batch of another field's rows to find this field's changes (two reads, the second$skipped); one open reads exactly 4 batches on a record whose field change lies past them, saysNo changes in the recent activity(notNo changes recorded), reads nothing more without a click, and Load more reads the fifth batch at$skip200 and finds the change; never changed →No changes recordedwith the creator and the creation time; a refused read. For the entry point: every declared field offers it andcreated_atdoes not, nothing is read until it is opened, a field the reader may not read has no entry (CONTROL: the readable sibling keeps it), a field whose values are not recorded has no entry —fieldHistory: false, ajsonfield, apasswordfield (CONTROL: ajsonfield withfieldHistory: truekeeps it) — an object withenable.fieldHistory: falseoffers none (CONTROL: the same object without it offers both), and a section not drawing the page's record offers none.ui/packages/plugin-grid/src/__tests__/fieldHistoryCellMenu-36290.test.tsx(5): the cell's menu item opens that record's changes of that field (and the read is scoped to that record); a field the reader may not read has no column, so no cell offers it (CONTROL: a readable field's cell still does); a host-joined column the object does not declare offers none; a cell of afieldHistory: falsefield opens no row menu at all on a table with no row actions (CONTROL: a recorded field's cell offers it); a data source that cannot read activity offers none.ui/packages/components/src/renderers/complex/__tests__/data-table-row-context-menu-28434.test.tsx: the existing host-renderer pin now assertscolumn, plus one new case — the column of the data cell the menu opened on, and no column off a data cell (the row's "⋮" cell).Runs
Ablations through
scripts/ablation-replace.mjs(anchor hit and blob move printed by the tool; each restored,git diff HEADempty and the file's blob equal to itsHEADblob afterwards):fieldHistoryOfferedremoveda field the reader may not read has no entrypages past rows of other fields until it finds this field's changesresolveFieldHistorygate infieldHistoryOfferedmade a no-opneedsRead = wantsMore)one open reads at most 4 batches, then "Load more" reads onAcceptance notes
resolveFieldHistory, so a field whose values are never recorded offers no history instead of a card that would say 「No changes recorded」 of a changed field; S2 the scan is bounded per user action as described above, and this body now says what the code does; the changeset's Clause-② line names the exported constants and the third key. The two notes taken as well: a row repeated by a shifted$skipis kept once. Not taken: the keyboard-opened cell menu path stays unpinned (as the review noted); a data source that ignores$skipnow stops after four reads per click instead of looping until the card closes.parent-field-query-guard.tsrefuses for exactly the readers this feature is for. So the card reads the record's rows in batches of fifty, at most four batches (200 rows) per open or 「Load more」. On a record with thousands of activity rows and a field changed rarely, each click reads the next 200; a server-side per-field door would be a separate Feature card, not this one.FieldChangeItemline inside the card clamps each side to its line and offers Show all, as the activity lines do.ui/AGENTS.md✨ Set up Copilot instructions #2's second half: the two package READMEs and the twocontent/docs/frontend/plugins/*.mdxpages are updated in this PR.examples/app-showcase+apps/console) as the seeded admin, onshowcase_account. GitHub's image store takes uploads only from the browser, andui/AGENTS.md🔗 Broken links detected in documentation #185 forbids committing screenshots into the tree, so they are described here and handed to the requester in the thread; the frames themselves are in the project files.Screenshots
Taken at
975c4c5576. The rework leaves these frames as they are: every field shown is a text or email field, whose values are recorded, so the gate still offers it; the batch cap shows only on a record with more than 200 activity rows. Driven at 1440×900,deviceScaleFactor: 2, record Stark Industries, field Billing Email (edited three times:ap@…→accounts.payable@…→billing@…).1-field-history-button.png, crop…-crop.png).Billing Email/Change history, thenDev Admin · Nov 23, 2026, 10:01 AMoveraccounts.payable…struck through→ billing@sta…with Show all, and the older change under it, newest first (2-field-history-card.png).Account Namecell of Stark Industries lists Change history between Open in new tab and Edit, with the same history icon (3-cell-context-menu.png).Account Name, listing that record's four changes of that field, newest first (4-cell-field-history-card.png).No changes recordedoverCreated by Dev Admin · Nov 23, 2026, 10:03 AM(5-never-changed.png).A note worth having on the record: on a seeded row the same empty card shows
No changes recordedwith no creator line, because the seed writes nocreatedactivity row and the card states only what the server served it — it does not fall back tocreated_by, which is a column the reader may be withheld.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY