Skip to content

feat(publish): add optional message field to Ref blobs across the stack#458

Open
horacioh wants to merge 7 commits into
mainfrom
publish-custom-message
Open

feat(publish): add optional message field to Ref blobs across the stack#458
horacioh wants to merge 7 commits into
mainfrom
publish-custom-message

Conversation

@horacioh
Copy link
Copy Markdown
Collaborator

@horacioh horacioh commented Apr 14, 2026

publish message

Summary

  • Adds an optional message field to Ref blobs (proto, Go blob model, and CBOR encoding), analogous to a git commit message
  • Surfaces the message field through CreateDocumentChangeRequest, CreateRefRequest, and the Ref response proto
  • Threads the message through the full backend stack: blob.NewRef, blob.NewRefRedirect, docmodel.Document.Ref, and all indexing paths
  • Exposes message in the frontend client types (PublishDocumentInput, CreateVersionRefInput, CreateTombstoneRefInput, CreateRedirectRefInput, SignDocumentChangeInput)
  • Adds a publish message textarea to the desktop PublishDraftButton UI
  • Adds -m, --message CLI flag to both publish and update document commands
  • Fetches and displays the message field in the activity feed's doc-update events
  • Updates generated protobuf files for both Go and TypeScript

@horacioh horacioh requested a review from burdiyan April 14, 2026 17:20
@ericvicenti
Copy link
Copy Markdown
Collaborator

I believe we should be adding fields to the Change blob, not the Ref blob, in the case of commit messages.

Also, PLEASE lets allow the API caller to append arbitrary metadata, which can be used for many things in addition to the Change blob. (Specifically I want to add metadata about the Agent and Context which motivated the Change)

@ericvicenti
Copy link
Copy Markdown
Collaborator

cc @burdiyan

@burdiyan
Copy link
Copy Markdown
Collaborator

burdiyan commented May 7, 2026

I agree with Eric. I think descriptions should be added on Changes not on Refs. Just like in Git description is attached to Commits, not on Refs.

Refs in our system are meant to be garbage-collectable, and we don't even expose them in the UI anywhere as thing.

@horacioh
Copy link
Copy Markdown
Collaborator Author

horacioh commented May 8, 2026

@horacioh horacioh force-pushed the publish-custom-message branch from aac7415 to 129d1db Compare May 8, 2026 15:37
@horacioh
Copy link
Copy Markdown
Collaborator Author

@burdiyan I did change this to save the message in the change. please review

@burdiyan burdiyan force-pushed the publish-custom-message branch from 129d1db to b6f59e5 Compare May 14, 2026 07:59
Copy link
Copy Markdown
Collaborator

@burdiyan burdiyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend changes look good. I haven't reviewed the frontend.

Not sure about the relevance of those markdown documents — at the very least they should probably not carry assumptions about the message field being previously on the Refs, because this was never released.

Comment thread docs/publish-message.md Outdated
Comment thread proto/documents/v3alpha/documents.proto Outdated
Comment thread proto/documents/v3alpha/documents.proto Outdated
Comment thread proto/documents/v3alpha/documents.proto Outdated
Comment thread docs/publish-message-decisions.md Outdated
@horacioh horacioh force-pushed the publish-custom-message branch from b6f59e5 to 9be7761 Compare May 14, 2026 14:48
horacioh added 7 commits May 15, 2026 11:22
Add a human-readable message to Ref blobs, similar to a git commit
message. The message field is propagated through the proto definition,
Go blob structs, and TypeScript client types.

- Add `message` field to `Ref` struct and `NewRef`/`NewRefRedirect` signatures
- Update `CreateRefRequest` and `Ref` proto messages with message field
- Expose `-m/--message` CLI option for publish and edit commands
- Add `message` to `CreateVersionRefInput`, `CreateTombstoneRefInput`,
  and `CreateRedirectRefInput` TypeScript types
Add optional publish message (similar to a git commit message) to the
CreateDocumentChange API, propagating it from the proto definition
through backend, client libraries, and frontend UI.

- Add `message` field (field 9) to CreateDocumentChangeRequest proto
- Pass message through docmodel.Ref() and documents.go server handler
- Expose message in PublishDocumentInput and SignDocumentChangeInput
- Add optional message textarea to PublishDraftButton component
- Fetch and expose ref message in activity-service loadRefEvent
Embed a human-readable publish message (like a git commit message) into signed
Change blobs, surface it through ListDocumentChanges/GetDocumentChange, and
thread it from the API through to frontend client types. The message is set by
the publisher, preserved permanently in the signed blob, stored alongside
existing extra attributes, and omitted when empty to keep backwards
compatibility.
Add prevActiveKeyRef guard to skip onActiveResultChange calls when
focused result hasn't changed, preventing unnecessary re-renders.

Fix edit-navigation-popover tests: use native setter for input value
simulation and add toggle click to expand non-blank nav items before
querying form inputs.

Update blob index tests to pass empty string for new message param.
…etector failures

standalone.Handler internally uses protoprint.DefaultPrinter, a
package-level variable in jhump/protoreflect that is not safe for
concurrent use. When Go's test runner executes packages in parallel with
-race, multiple daemon instances call makeGRPCUIHandler simultaneously,
each hitting DefaultPrinter.PrintProtoToString() and producing data
races.

Serialize the call with a sync.Mutex to prevent concurrent access.
…ctor

Adds newly discovered transitive-dep CVEs to pnpm-workspace.yaml
auditConfig (electron 35→39 gap, hono, mermaid, dompurify, vite, and
others with no published fix). Also reformats existing entries with
section banners for readability.

Fixes test selector in edit-navigation-popover to match the ellipsis
character (…) instead of three dots (...).
@horacioh horacioh force-pushed the publish-custom-message branch from ecf3e6c to ac82db5 Compare May 15, 2026 10:42
@horacioh
Copy link
Copy Markdown
Collaborator Author

@burdiyan I did all the recommended changes. let me know if you can check this

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants