fix(board): unify node freshness stamp so agent notes show Created/Edited - #258
Merged
Conversation
…ited Agent-created notes only carry the canonical `meta` (ms numbers), but the sheet card and list view read the legacy top-level `createdAt`/`updatedAt` ISO strings, so agent notes showed no stamp. The mutator also reset `createdAt` on every rewrite, so an edited note never read as "Edited". Add `node-meta` helpers: `freshMeta` (create), `bumpMeta` (edit — preserve createdAt, advance updatedAt, bump version), and `nodeStamp` (read meta first, fall back to the legacy strings). Route the mutator's create/rewrite/ patch/link through them and switch the sheet + list readers to `nodeStamp`.
update_note with neither content nor label was flipping the note to 'Edited' and pushing a needless store/sync op. Skip the write when there is nothing to change.
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.
What
Agent-created notes never showed a "Created"/"Edited" stamp, and human-edited notes never flipped to "Edited". Two disjoint representations of a node's timestamps were the cause:
data.meta(SyncMeta, ms numbers) — what the agent /StoreMutatorwrite;data.createdAt/updatedAt(ISO strings) — older local boards + the REST convert layer.The sheet card and list view read only the legacy strings, so agent notes (which carry only
meta) showed nothing. The mutator also stamped a freshmetaon every rewrite, resettingcreatedAt, so an edited note never read as "Edited".How
New
webui/src/features/board/utils/node-meta.ts:freshMeta()— create stamp (createdAt == updatedAt,v:1).bumpMeta(prev)— edit stamp: preservecreatedAt, advanceupdatedAt, incrementv.nodeStamp(data)— read the display stamp frommetafirst, falling back to the legacy strings; returns{ iso, edited }.StoreMutatornow routes create →freshMeta, rewrite/patch →bumpMeta, link →freshMeta. The sheet view and list view read throughnodeStamp.meta.updatedAtis display-only — sync conflict resolution uses server-sequenced per-field LWW, not this field — so the blast radius is the two readers touched here.Follow-up
Human edits made through the harness UI (e.g. the sheet inline editor's
handleSave) still write viastore.updateNodewithout bumpingmeta; wiring those handlers throughbumpMetais a separate change in the harness layer.Test plan
node-meta.test.tscoversfreshMeta/bumpMeta/nodeStamp(meta-first, legacy fallback, edited detection, unknown/unparseable).board-mutator.test.tsadds: createNote stamps fresh meta; rewriteNote preservescreatedAtand bumpsv; patchNote bumps meta on a content-only edit.npm run check-allpasses.