From 34bb2d5219d36555dfd9e4b2b35fd5940df8123b Mon Sep 17 00:00:00 2001 From: Horacio Herrera Date: Mon, 13 Apr 2026 19:41:32 +0200 Subject: [PATCH 1/7] feat(ref): add optional message field to Ref blobs 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 --- .../documents/v3alpha/docmodel/docmodel.go | 2 +- backend/api/documents/v3alpha/documents.go | 9 +- .../api/documents/v3alpha/documents_test.go | 3 + backend/blob/blob_capability_test.go | 2 +- backend/blob/blob_ref.go | 9 +- backend/blob/blob_ref_test.go | 2 +- backend/blob/index_visibility_test.go | 2 +- .../documents/v3alpha/documents.pb.go | 34 +- frontend/apps/cli/src/commands/document.ts | 4 + frontend/packages/client/src/ref.ts | 15 + .../documents/v3alpha/comments_connect.ts | 44 +- .../documents/v3alpha/comments_pb.ts | 504 ++++++++---------- .../documents/v3alpha/documents_pb.ts | 16 + proto/documents/v3alpha/documents.proto | 6 + proto/documents/v3alpha/go.gensum | 4 +- proto/documents/v3alpha/js.gensum | 4 +- 16 files changed, 334 insertions(+), 326 deletions(-) diff --git a/backend/api/documents/v3alpha/docmodel/docmodel.go b/backend/api/documents/v3alpha/docmodel/docmodel.go index 577cc49b4..1b3147790 100644 --- a/backend/api/documents/v3alpha/docmodel/docmodel.go +++ b/backend/api/documents/v3alpha/docmodel/docmodel.go @@ -403,7 +403,7 @@ func (dm *Document) Ref(kp *core.KeyPair, visibility blob.Visibility) (ref blob. dm.Generation = maybe.New(head.Ts.UnixMilli()) } - return blob.NewRef(kp, dm.Generation.Value(), genesis, space, path, []cid.Cid{headCID}, head.Ts, visibility) + return blob.NewRef(kp, dm.Generation.Value(), genesis, space, path, []cid.Cid{headCID}, head.Ts, visibility, "") } func (dm *Document) cleanupPatch() (out blob.ChangeBody, err error) { diff --git a/backend/api/documents/v3alpha/documents.go b/backend/api/documents/v3alpha/documents.go index 5b57ddebf..ee37d7caf 100644 --- a/backend/api/documents/v3alpha/documents.go +++ b/backend/api/documents/v3alpha/documents.go @@ -1442,7 +1442,7 @@ func (srv *Server) CreateRef(ctx context.Context, in *documents.CreateRefRequest } } - refBlob, err = blob.NewRef(kp, in.Generation, genesis, ns, in.Path, heads, ts, blob.VisibilityPublic) + refBlob, err = blob.NewRef(kp, in.Generation, genesis, ns, in.Path, heads, ts, blob.VisibilityPublic, in.Message) if err != nil { return nil, err } @@ -1461,7 +1461,7 @@ func (srv *Server) CreateRef(ctx context.Context, in *documents.CreateRefRequest return nil, status.Errorf(codes.InvalidArgument, "failed to parse genesis: %v", err) } - refBlob, err = blob.NewRef(kp, in.Generation, genesis, ns, in.Path, nil, ts, blob.VisibilityPublic) + refBlob, err = blob.NewRef(kp, in.Generation, genesis, ns, in.Path, nil, ts, blob.VisibilityPublic, in.Message) if err != nil { return nil, err } @@ -1506,7 +1506,7 @@ func (srv *Server) CreateRef(ctx context.Context, in *documents.CreateRefRequest Republish: rt.Redirect.Republish, } - refBlob, err = blob.NewRefRedirect(kp, in.Generation, genesis, ns, in.Path, target, ts) + refBlob, err = blob.NewRefRedirect(kp, in.Generation, genesis, ns, in.Path, target, ts, in.Message) if err != nil { return nil, err } @@ -1667,6 +1667,7 @@ func refToProto(c cid.Cid, ref *blob.Ref) (*documents.Ref, error) { Genesis: ref.GenesisBlob.String(), Generation: ref.Generation, }, + Message: ref.Message, } switch { @@ -1725,7 +1726,7 @@ func (srv *Server) ensureProfileGenesis(ctx context.Context, kp *core.KeyPair) e return err } - ebr, err := blob.NewRef(kp, 0, ebc.CID, space, path, []cid.Cid{ebc.CID}, blob.ZeroUnixTime(), blob.VisibilityPublic) + ebr, err := blob.NewRef(kp, 0, ebc.CID, space, path, []cid.Cid{ebc.CID}, blob.ZeroUnixTime(), blob.VisibilityPublic, "") if err != nil { return err } diff --git a/backend/api/documents/v3alpha/documents_test.go b/backend/api/documents/v3alpha/documents_test.go index 9687cc9d6..6d36b45b3 100644 --- a/backend/api/documents/v3alpha/documents_test.go +++ b/backend/api/documents/v3alpha/documents_test.go @@ -1840,6 +1840,7 @@ func TestPrepareChangeAndSubmit(t *testing.T) { []cid.Cid{signedChange.CID}, time.Now().Round(blob.ClockPrecision), blob.VisibilityPublic, + "", ) require.NoError(t, err) @@ -1926,6 +1927,7 @@ func TestPrepareChangeBlockReordering(t *testing.T) { []cid.Cid{signedChange.CID}, time.Now().Round(blob.ClockPrecision), blob.VisibilityPublic, + "", ) require.NoError(t, err) @@ -1991,6 +1993,7 @@ func TestPrepareChangeMetadataUpdate(t *testing.T) { []cid.Cid{signedChange.CID}, time.Now().Round(blob.ClockPrecision), blob.VisibilityPublic, + "", ) require.NoError(t, err) diff --git a/backend/blob/blob_capability_test.go b/backend/blob/blob_capability_test.go index 3c216d208..66abf7b31 100644 --- a/backend/blob/blob_capability_test.go +++ b/backend/blob/blob_capability_test.go @@ -28,7 +28,7 @@ func TestOutOfOrderCapability(t *testing.T) { }, clock.MustNow()) require.NoError(t, err) - ref, err := NewRef(bob, 0, change.CID, alice.Principal(), "", []cid.Cid{change.CID}, clock.MustNow(), VisibilityPublic) + ref, err := NewRef(bob, 0, change.CID, alice.Principal(), "", []cid.Cid{change.CID}, clock.MustNow(), VisibilityPublic, "") require.NoError(t, err) cpb, err := NewCapability(alice, bob.Principal(), alice.Principal(), "", "WRITER", "", clock.MustNow()) diff --git a/backend/blob/blob_ref.go b/backend/blob/blob_ref.go index ed22d0232..9c5edc955 100644 --- a/backend/blob/blob_ref.go +++ b/backend/blob/blob_ref.go @@ -47,10 +47,11 @@ type Ref struct { Redirect *RedirectTarget `refmt:"redirect,omitempty"` Generation int64 `refmt:"generation,omitempty"` Visibility Visibility `refmt:"visibility,omitempty"` + Message string `refmt:"message,omitempty"` } // NewRef creates a new Ref blob. -func NewRef(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Principal, path string, heads []cid.Cid, ts time.Time, visibility Visibility) (eb Encoded[*Ref], err error) { +func NewRef(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Principal, path string, heads []cid.Cid, ts time.Time, visibility Visibility, message string) (eb Encoded[*Ref], err error) { ru := &Ref{ BaseBlob: BaseBlob{ Type: TypeRef, @@ -62,6 +63,7 @@ func NewRef(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Prin Heads: heads, Generation: generation, Visibility: visibility, + Message: message, } if !kp.Principal().Equal(space) { @@ -76,7 +78,7 @@ func NewRef(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Prin } // NewRefRedirect creates a new Ref blob that redirects to another document. -func NewRefRedirect(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Principal, path string, rt RedirectTarget, ts time.Time) (eb Encoded[*Ref], err error) { +func NewRefRedirect(kp *core.KeyPair, generation int64, genesis cid.Cid, space core.Principal, path string, rt RedirectTarget, ts time.Time, message string) (eb Encoded[*Ref], err error) { // If we redirect within the same space, we don't need to specify the space in the redirect target. if space.Equal(rt.Space) { rt.Space = nil @@ -92,6 +94,7 @@ func NewRefRedirect(kp *core.KeyPair, generation int64, genesis cid.Cid, space c GenesisBlob: genesis, Redirect: &rt, Generation: generation, + Message: message, } if !kp.Principal().Equal(space) { @@ -180,6 +183,7 @@ func indexRef(ictx *indexingCtx, _ int64, eb Encoded[*Ref]) error { RedirectTarget string `json:"redirect,omitempty"` Republish bool `json:"republish,omitempty"` Visibility Visibility `json:"visibility,omitempty"` + Message string `json:"message,omitempty"` } // We decided not to allow redirects or tombstones for home documents for now. @@ -214,6 +218,7 @@ func indexRef(ictx *indexingCtx, _ int64, eb Encoded[*Ref]) error { meta := Meta{ Generation: v.Generation, Visibility: v.Visibility, + Message: v.Message, } switch { diff --git a/backend/blob/blob_ref_test.go b/backend/blob/blob_ref_test.go index 98d560935..26711a6d0 100644 --- a/backend/blob/blob_ref_test.go +++ b/backend/blob/blob_ref_test.go @@ -44,7 +44,7 @@ func TestRefCausality(t *testing.T) { time.Sleep(time.Millisecond) // Create a Ref pointing to c2. - ref, err := NewRef(alice.Account, 0, c1.CID, alice.Account.Principal(), "/test-doc", []cid.Cid{c2.CID}, clock.MustNow(), VisibilityPublic) + ref, err := NewRef(alice.Account, 0, c1.CID, alice.Account.Principal(), "/test-doc", []cid.Cid{c2.CID}, clock.MustNow(), VisibilityPublic, "") require.NoError(t, err) blobs := colx.SlicePermutations([]struct { diff --git a/backend/blob/index_visibility_test.go b/backend/blob/index_visibility_test.go index 2c1d12b2f..849e6c906 100644 --- a/backend/blob/index_visibility_test.go +++ b/backend/blob/index_visibility_test.go @@ -124,7 +124,7 @@ func TestRefVisibilityPropagationSingleRef(t *testing.T) { }, clock.MustNow()) require.NoError(t, err) - ref, err := NewRef(alice.Account, 0, c1.CID, alice.Account.Principal(), "/test-doc", []cid.Cid{c4.CID, c3.CID}, clock.MustNow(), VisibilityPrivate) + ref, err := NewRef(alice.Account, 0, c1.CID, alice.Account.Principal(), "/test-doc", []cid.Cid{c4.CID, c3.CID}, clock.MustNow(), VisibilityPrivate, "") require.NoError(t, err) input := []namedBlock{ diff --git a/backend/genproto/documents/v3alpha/documents.pb.go b/backend/genproto/documents/v3alpha/documents.pb.go index 95a7edbd9..f5b392688 100644 --- a/backend/genproto/documents/v3alpha/documents.pb.go +++ b/backend/genproto/documents/v3alpha/documents.pb.go @@ -2546,7 +2546,9 @@ type CreateRefRequest struct { // or will create a fresh generation number if there are no existing Refs for this path. Generation int64 `protobuf:"varint,7,opt,name=generation,proto3" json:"generation,omitempty"` // Output only. Visibility of the document. - Visibility ResourceVisibility `protobuf:"varint,8,opt,name=visibility,proto3,enum=com.seed.documents.v3alpha.ResourceVisibility" json:"visibility,omitempty"` + Visibility ResourceVisibility `protobuf:"varint,8,opt,name=visibility,proto3,enum=com.seed.documents.v3alpha.ResourceVisibility" json:"visibility,omitempty"` + // Optional. A human-readable message describing this publish, similar to a git commit message. + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2637,6 +2639,13 @@ func (x *CreateRefRequest) GetVisibility() ResourceVisibility { return ResourceVisibility_RESOURCE_VISIBILITY_UNSPECIFIED } +func (x *CreateRefRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + // Request to get a Ref by ID. type GetRefRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3815,8 +3824,10 @@ type Ref struct { Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Information about the generation of the Ref. GenerationInfo *GenerationInfo `protobuf:"bytes,8,opt,name=generation_info,json=generationInfo,proto3" json:"generation_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Optional. A human-readable message attached to this Ref by the publisher. + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Ref) Reset() { @@ -3905,6 +3916,13 @@ func (x *Ref) GetGenerationInfo() *GenerationInfo { return nil } +func (x *Ref) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + // Description of where the Ref points to. type RefTarget struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -4610,7 +4628,7 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "\aaccount\x18\x01 \x01(\tR\aaccount\x12\x12\n" + "\x04path\x18\x02 \x01(\tR\x04path\x12\x17\n" + "\ais_read\x18\x03 \x01(\bR\x06isRead\x12!\n" + - "\fis_recursive\x18\x04 \x01(\bR\visRecursive\"\xf3\x02\n" + + "\fis_recursive\x18\x04 \x01(\bR\visRecursive\"\x8d\x03\n" + "\x10CreateRefRequest\x12\x18\n" + "\aaccount\x18\x01 \x01(\tR\aaccount\x12\x12\n" + "\x04path\x18\x02 \x01(\tR\x04path\x12=\n" + @@ -4625,7 +4643,8 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "generation\x12N\n" + "\n" + "visibility\x18\b \x01(\x0e2..com.seed.documents.v3alpha.ResourceVisibilityR\n" + - "visibility\"\x1f\n" + + "visibility\x12\x18\n" + + "\amessage\x18\t \x01(\tR\amessage\"\x1f\n" + "\rGetRefRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\"{\n" + "\x0fListRefsRequest\x12\x18\n" + @@ -4746,7 +4765,7 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "\n" + "null_value\x18\x06 \x01(\v2\x16.google.protobuf.EmptyH\x00R\tnullValueB\a\n" + "\x05valueB\x04\n" + - "\x02op\"\xc9\x02\n" + + "\x02op\"\xe3\x02\n" + "\x03Ref\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + "\aaccount\x18\x02 \x01(\tR\aaccount\x12\x12\n" + @@ -4757,7 +4776,8 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "capability\x18\x06 \x01(\tR\n" + "capability\x128\n" + "\ttimestamp\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12S\n" + - "\x0fgeneration_info\x18\b \x01(\v2*.com.seed.documents.v3alpha.GenerationInfoR\x0egenerationInfo\"\xa3\x03\n" + + "\x0fgeneration_info\x18\b \x01(\v2*.com.seed.documents.v3alpha.GenerationInfoR\x0egenerationInfo\x12\x18\n" + + "\amessage\x18\t \x01(\tR\amessage\"\xa3\x03\n" + "\tRefTarget\x12I\n" + "\aversion\x18\x01 \x01(\v2-.com.seed.documents.v3alpha.RefTarget.VersionH\x00R\aversion\x12L\n" + "\bredirect\x18\x02 \x01(\v2..com.seed.documents.v3alpha.RefTarget.RedirectH\x00R\bredirect\x12O\n" + diff --git a/frontend/apps/cli/src/commands/document.ts b/frontend/apps/cli/src/commands/document.ts index f085e48c9..5cb5933fd 100644 --- a/frontend/apps/cli/src/commands/document.ts +++ b/frontend/apps/cli/src/commands/document.ts @@ -319,6 +319,7 @@ export function registerDocumentCommands(program: Command) { .option('--grobid-url ', 'GROBID server URL for PDF extraction') .option('--dry-run', 'Preview extracted content without publishing') .option('--force', 'Overwrite existing document at the same path (creates new lineage)') + .option('-m, --message ', 'Publish message (like a git commit message)') .option('-k, --key ', 'Signing key name or account ID') .option('-a, --account ', 'Target space/account UID (publish under a different account using a capability)') .action(async (options, cmd) => { @@ -427,6 +428,7 @@ export function registerDocumentCommands(program: Command) { version: changeBlock.cid.toString(), generation, capability, + message: options.message, }, signer, ) @@ -491,6 +493,7 @@ export function registerDocumentCommands(program: Command) { .option('--import-tags ', 'Import tags (comma-separated)') .option('--parent ', 'Parent block ID for new content (default: root)') .option('--delete-blocks ', 'Comma-separated block IDs to delete') + .option('-m, --message ', 'Publish message (like a git commit message)') .option('-k, --key ', 'Signing key name or account ID') .action(async (id: string, options, cmd) => { const globalOpts = cmd.optsWithGlobals() @@ -590,6 +593,7 @@ export function registerDocumentCommands(program: Command) { version: changeBlock.cid.toString(), generation, capability, + message: options.message, }, signer, ) diff --git a/frontend/packages/client/src/ref.ts b/frontend/packages/client/src/ref.ts index 65f04bba6..69a3a52e6 100644 --- a/frontend/packages/client/src/ref.ts +++ b/frontend/packages/client/src/ref.ts @@ -23,6 +23,8 @@ export type CreateVersionRefInput = { capability?: string /** Optional CBOR visibility value (e.g., "Private"). Omit or leave empty for public. */ visibility?: string + /** Optional human-readable publish message, similar to a git commit message. */ + message?: string } export type CreateTombstoneRefInput = { @@ -36,6 +38,8 @@ export type CreateTombstoneRefInput = { generation: number /** Optional capability CID string */ capability?: string + /** Optional human-readable publish message, similar to a git commit message. */ + message?: string } export type CreateRedirectRefInput = { @@ -55,6 +59,8 @@ export type CreateRedirectRefInput = { republish?: boolean /** Optional capability CID string */ capability?: string + /** Optional human-readable publish message, similar to a git commit message. */ + message?: string } function bytesEqual(a: Uint8Array, b: Uint8Array): boolean { @@ -77,6 +83,7 @@ function buildUnsignedRef({ generation, capability, visibility, + message, }: { signerKey: Uint8Array space: string @@ -85,6 +92,7 @@ function buildUnsignedRef({ generation: number capability?: string visibility?: string + message?: string }): Record { const signerBytes = new Uint8Array(signerKey) const spaceBytes = new Uint8Array(base58btc.decode(space)) @@ -118,6 +126,10 @@ function buildUnsignedRef({ unsigned.visibility = visibility } + if (message) { + unsigned.message = message + } + return unsigned } @@ -137,6 +149,7 @@ export async function createVersionRef(input: CreateVersionRefInput, signer: HMS generation: input.generation, capability: input.capability, visibility: input.visibility, + message: input.message, }) // Parse version string into CID array @@ -164,6 +177,7 @@ export async function createTombstoneRef( genesis: input.genesis, generation: input.generation, capability: input.capability, + message: input.message, }) // Tombstone: empty heads @@ -189,6 +203,7 @@ export async function createRedirectRef(input: CreateRedirectRefInput, signer: H genesis: input.genesis, generation: input.generation, capability: input.capability, + message: input.message, }) // Redirect refs have no heads diff --git a/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_connect.ts index 626ec69b9..fb65c6b5d 100644 --- a/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_connect.ts +++ b/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_connect.ts @@ -3,23 +3,8 @@ /* eslint-disable */ // @ts-nocheck -import { - BatchGetCommentsRequest, - BatchGetCommentsResponse, - Comment, - CreateCommentRequest, - DeleteCommentRequest, - GetCommentReplyCountRequest, - GetCommentReplyCountResponse, - GetCommentRequest, - ListCommentsByAuthorRequest, - ListCommentsRequest, - ListCommentsResponse, - ListCommentVersionsRequest, - ListCommentVersionsResponse, - UpdateCommentRequest, -} from './comments_pb' -import {Empty, MethodKind} from '@bufbuild/protobuf' +import { BatchGetCommentsRequest, BatchGetCommentsResponse, Comment, CreateCommentRequest, DeleteCommentRequest, GetCommentReplyCountRequest, GetCommentReplyCountResponse, GetCommentRequest, ListCommentsByAuthorRequest, ListCommentsRequest, ListCommentsResponse, ListCommentVersionsRequest, ListCommentVersionsResponse, UpdateCommentRequest } from "./comments_pb"; +import { Empty, MethodKind } from "@bufbuild/protobuf"; /** * Comments service allows users to add comments to documents. @@ -27,7 +12,7 @@ import {Empty, MethodKind} from '@bufbuild/protobuf' * @generated from service com.seed.documents.v3alpha.Comments */ export const Comments = { - typeName: 'com.seed.documents.v3alpha.Comments', + typeName: "com.seed.documents.v3alpha.Comments", methods: { /** * Creates a new comment. @@ -35,7 +20,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.CreateComment */ createComment: { - name: 'CreateComment', + name: "CreateComment", I: CreateCommentRequest, O: Comment, kind: MethodKind.Unary, @@ -46,7 +31,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.GetComment */ getComment: { - name: 'GetComment', + name: "GetComment", I: GetCommentRequest, O: Comment, kind: MethodKind.Unary, @@ -57,7 +42,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.BatchGetComments */ batchGetComments: { - name: 'BatchGetComments', + name: "BatchGetComments", I: BatchGetCommentsRequest, O: BatchGetCommentsResponse, kind: MethodKind.Unary, @@ -68,7 +53,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.ListComments */ listComments: { - name: 'ListComments', + name: "ListComments", I: ListCommentsRequest, O: ListCommentsResponse, kind: MethodKind.Unary, @@ -79,7 +64,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.ListCommentsByAuthor */ listCommentsByAuthor: { - name: 'ListCommentsByAuthor', + name: "ListCommentsByAuthor", I: ListCommentsByAuthorRequest, O: ListCommentsResponse, kind: MethodKind.Unary, @@ -90,7 +75,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.UpdateComment */ updateComment: { - name: 'UpdateComment', + name: "UpdateComment", I: UpdateCommentRequest, O: Comment, kind: MethodKind.Unary, @@ -101,7 +86,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.DeleteComment */ deleteComment: { - name: 'DeleteComment', + name: "DeleteComment", I: DeleteCommentRequest, O: Empty, kind: MethodKind.Unary, @@ -112,7 +97,7 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.GetCommentReplyCount */ getCommentReplyCount: { - name: 'GetCommentReplyCount', + name: "GetCommentReplyCount", I: GetCommentReplyCountRequest, O: GetCommentReplyCountResponse, kind: MethodKind.Unary, @@ -123,10 +108,11 @@ export const Comments = { * @generated from rpc com.seed.documents.v3alpha.Comments.ListCommentVersions */ listCommentVersions: { - name: 'ListCommentVersions', + name: "ListCommentVersions", I: ListCommentVersionsRequest, O: ListCommentVersionsResponse, kind: MethodKind.Unary, }, - }, -} as const + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_pb.ts index 83f947fa1..db274577d 100644 --- a/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_pb.ts +++ b/frontend/packages/shared/src/client/.generated/documents/v3alpha/comments_pb.ts @@ -3,16 +3,9 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from '@bufbuild/protobuf' -import {Message, proto3, protoInt64, Timestamp} from '@bufbuild/protobuf' -import {BlockNode} from './documents_pb' +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64, Timestamp } from "@bufbuild/protobuf"; +import { BlockNode } from "./documents_pb"; /** * Request to create a comment. @@ -25,21 +18,21 @@ export class CreateCommentRequest extends Message { * * @generated from field: string target_account = 1; */ - targetAccount = '' + targetAccount = ""; /** * Required. Path within the account where the comment is applied. * * @generated from field: string target_path = 2; */ - targetPath = '' + targetPath = ""; /** * Required. Version of the document at the time of the comment. * * @generated from field: string target_version = 3; */ - targetVersion = '' + targetVersion = ""; /** * Optional. When current comment is a reply to another comment, @@ -48,21 +41,21 @@ export class CreateCommentRequest extends Message { * * @generated from field: string reply_parent = 4; */ - replyParent = '' + replyParent = ""; /** * Required. Content of the comment. * * @generated from field: repeated com.seed.documents.v3alpha.BlockNode content = 5; */ - content: BlockNode[] = [] + content: BlockNode[] = []; /** * Required. Name of the key to use for signing the comment. * * @generated from field: string signing_key_name = 6; */ - signingKeyName = '' + signingKeyName = ""; /** * Optional. ID of the capability that allows publishing comments for the target account and path. @@ -70,42 +63,39 @@ export class CreateCommentRequest extends Message { * * @generated from field: string capability = 7; */ - capability = '' + capability = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.CreateCommentRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.CreateCommentRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'target_account', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 2, name: 'target_path', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 3, name: 'target_version', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 4, name: 'reply_parent', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 5, name: 'content', kind: 'message', T: BlockNode, repeated: true}, - {no: 6, name: 'signing_key_name', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 7, name: 'capability', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "target_account", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "target_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "reply_parent", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "content", kind: "message", T: BlockNode, repeated: true }, + { no: 6, name: "signing_key_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "capability", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateCommentRequest { - return new CreateCommentRequest().fromBinary(bytes, options) + return new CreateCommentRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): CreateCommentRequest { - return new CreateCommentRequest().fromJson(jsonValue, options) + return new CreateCommentRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): CreateCommentRequest { - return new CreateCommentRequest().fromJsonString(jsonString, options) + return new CreateCommentRequest().fromJsonString(jsonString, options); } - static equals( - a: CreateCommentRequest | PlainMessage | undefined, - b: CreateCommentRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(CreateCommentRequest, a, b) + static equals(a: CreateCommentRequest | PlainMessage | undefined, b: CreateCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateCommentRequest, a, b); } } @@ -122,36 +112,33 @@ export class GetCommentRequest extends Message { * * @generated from field: string id = 1; */ - id = '' + id = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.GetCommentRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.GetCommentRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetCommentRequest { - return new GetCommentRequest().fromBinary(bytes, options) + return new GetCommentRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): GetCommentRequest { - return new GetCommentRequest().fromJson(jsonValue, options) + return new GetCommentRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): GetCommentRequest { - return new GetCommentRequest().fromJsonString(jsonString, options) + return new GetCommentRequest().fromJsonString(jsonString, options); } - static equals( - a: GetCommentRequest | PlainMessage | undefined, - b: GetCommentRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(GetCommentRequest, a, b) + static equals(a: GetCommentRequest | PlainMessage | undefined, b: GetCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetCommentRequest, a, b); } } @@ -167,36 +154,33 @@ export class BatchGetCommentsRequest extends Message { * * @generated from field: repeated string ids = 1; */ - ids: string[] = [] + ids: string[] = []; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.BatchGetCommentsRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.BatchGetCommentsRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'ids', kind: 'scalar', T: 9 /* ScalarType.STRING */, repeated: true}, - ]) + { no: 1, name: "ids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): BatchGetCommentsRequest { - return new BatchGetCommentsRequest().fromBinary(bytes, options) + return new BatchGetCommentsRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): BatchGetCommentsRequest { - return new BatchGetCommentsRequest().fromJson(jsonValue, options) + return new BatchGetCommentsRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): BatchGetCommentsRequest { - return new BatchGetCommentsRequest().fromJsonString(jsonString, options) + return new BatchGetCommentsRequest().fromJsonString(jsonString, options); } - static equals( - a: BatchGetCommentsRequest | PlainMessage | undefined, - b: BatchGetCommentsRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(BatchGetCommentsRequest, a, b) + static equals(a: BatchGetCommentsRequest | PlainMessage | undefined, b: BatchGetCommentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(BatchGetCommentsRequest, a, b); } } @@ -211,36 +195,33 @@ export class BatchGetCommentsResponse extends Message * * @generated from field: repeated com.seed.documents.v3alpha.Comment comments = 1; */ - comments: Comment[] = [] + comments: Comment[] = []; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.BatchGetCommentsResponse' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.BatchGetCommentsResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'comments', kind: 'message', T: Comment, repeated: true}, - ]) + { no: 1, name: "comments", kind: "message", T: Comment, repeated: true }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): BatchGetCommentsResponse { - return new BatchGetCommentsResponse().fromBinary(bytes, options) + return new BatchGetCommentsResponse().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): BatchGetCommentsResponse { - return new BatchGetCommentsResponse().fromJson(jsonValue, options) + return new BatchGetCommentsResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): BatchGetCommentsResponse { - return new BatchGetCommentsResponse().fromJsonString(jsonString, options) + return new BatchGetCommentsResponse().fromJsonString(jsonString, options); } - static equals( - a: BatchGetCommentsResponse | PlainMessage | undefined, - b: BatchGetCommentsResponse | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(BatchGetCommentsResponse, a, b) + static equals(a: BatchGetCommentsResponse | PlainMessage | undefined, b: BatchGetCommentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(BatchGetCommentsResponse, a, b); } } @@ -255,60 +236,57 @@ export class ListCommentsRequest extends Message { * * @generated from field: string target_account = 1; */ - targetAccount = '' + targetAccount = ""; /** * Required. Path within the account to list the comments for. * * @generated from field: string target_path = 2; */ - targetPath = '' + targetPath = ""; /** * Optional. The maximum number of comments to return. * * @generated from field: int32 page_size = 3; */ - pageSize = 0 + pageSize = 0; /** * Optional. The page token obtained from a previous request (if any). * * @generated from field: string page_token = 4; */ - pageToken = '' + pageToken = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.ListCommentsRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.ListCommentsRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'target_account', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 2, name: 'target_path', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 3, name: 'page_size', kind: 'scalar', T: 5 /* ScalarType.INT32 */}, - {no: 4, name: 'page_token', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "target_account", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentsRequest { - return new ListCommentsRequest().fromBinary(bytes, options) + return new ListCommentsRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentsRequest { - return new ListCommentsRequest().fromJson(jsonValue, options) + return new ListCommentsRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): ListCommentsRequest { - return new ListCommentsRequest().fromJsonString(jsonString, options) + return new ListCommentsRequest().fromJsonString(jsonString, options); } - static equals( - a: ListCommentsRequest | PlainMessage | undefined, - b: ListCommentsRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(ListCommentsRequest, a, b) + static equals(a: ListCommentsRequest | PlainMessage | undefined, b: ListCommentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentsRequest, a, b); } } @@ -323,52 +301,49 @@ export class ListCommentsByAuthorRequest extends Message) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.ListCommentsByAuthorRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.ListCommentsByAuthorRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'author', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 2, name: 'page_size', kind: 'scalar', T: 5 /* ScalarType.INT32 */}, - {no: 3, name: 'page_token', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentsByAuthorRequest { - return new ListCommentsByAuthorRequest().fromBinary(bytes, options) + return new ListCommentsByAuthorRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentsByAuthorRequest { - return new ListCommentsByAuthorRequest().fromJson(jsonValue, options) + return new ListCommentsByAuthorRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): ListCommentsByAuthorRequest { - return new ListCommentsByAuthorRequest().fromJsonString(jsonString, options) + return new ListCommentsByAuthorRequest().fromJsonString(jsonString, options); } - static equals( - a: ListCommentsByAuthorRequest | PlainMessage | undefined, - b: ListCommentsByAuthorRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(ListCommentsByAuthorRequest, a, b) + static equals(a: ListCommentsByAuthorRequest | PlainMessage | undefined, b: ListCommentsByAuthorRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentsByAuthorRequest, a, b); } } @@ -383,44 +358,41 @@ export class ListCommentsResponse extends Message { * * @generated from field: repeated com.seed.documents.v3alpha.Comment comments = 1; */ - comments: Comment[] = [] + comments: Comment[] = []; /** * Token to retrieve the next page of comments (if necessary). * * @generated from field: string next_page_token = 2; */ - nextPageToken = '' + nextPageToken = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.ListCommentsResponse' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.ListCommentsResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'comments', kind: 'message', T: Comment, repeated: true}, - {no: 2, name: 'next_page_token', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "comments", kind: "message", T: Comment, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentsResponse { - return new ListCommentsResponse().fromBinary(bytes, options) + return new ListCommentsResponse().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentsResponse { - return new ListCommentsResponse().fromJson(jsonValue, options) + return new ListCommentsResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): ListCommentsResponse { - return new ListCommentsResponse().fromJsonString(jsonString, options) + return new ListCommentsResponse().fromJsonString(jsonString, options); } - static equals( - a: ListCommentsResponse | PlainMessage | undefined, - b: ListCommentsResponse | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(ListCommentsResponse, a, b) + static equals(a: ListCommentsResponse | PlainMessage | undefined, b: ListCommentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentsResponse, a, b); } } @@ -435,42 +407,42 @@ export class Comment extends Message { * * @generated from field: string id = 1; */ - id = '' + id = ""; /** * Account ID that this comment targets. * * @generated from field: string target_account = 2; */ - targetAccount = '' + targetAccount = ""; /** * Path within the account this comment targets. * * @generated from field: string target_path = 3; */ - targetPath = '' + targetPath = ""; /** * Version of the document this comment targets. * * @generated from field: string target_version = 4; */ - targetVersion = '' + targetVersion = ""; /** * Optional. The ID of the top-level non-reply comment of the conversation thread. * * @generated from field: string thread_root = 5; */ - threadRoot = '' + threadRoot = ""; /** * Optional. Version of the thread root comment (if this is a reply). * * @generated from field: string thread_root_version = 12; */ - threadRootVersion = '' + threadRootVersion = ""; /** * Optional. The ID of the comment to which this comment is a direct reply. @@ -478,56 +450,56 @@ export class Comment extends Message { * * @generated from field: string reply_parent = 6; */ - replyParent = '' + replyParent = ""; /** * Optional. Version of the parent comment (if this is a reply). * * @generated from field: string reply_parent_version = 13; */ - replyParentVersion = '' + replyParentVersion = ""; /** * Account ID of the author of the comment. * * @generated from field: string author = 7; */ - author = '' + author = ""; /** * Content of the comment. * * @generated from field: repeated com.seed.documents.v3alpha.BlockNode content = 8; */ - content: BlockNode[] = [] + content: BlockNode[] = []; /** * Timestamp when the comment was created. * * @generated from field: google.protobuf.Timestamp create_time = 9; */ - createTime?: Timestamp + createTime?: Timestamp; /** * Optional. ID of the capability this comment was created with, if any. * * @generated from field: string capability = 10; */ - capability = '' + capability = ""; /** * Version of this comment. * * @generated from field: string version = 11; */ - version = '' + version = ""; /** * Timestamp when the comment was last updated. * * @generated from field: google.protobuf.Timestamp update_time = 14; */ - updateTime?: Timestamp + updateTime?: Timestamp; /** * Visibility of the comment, inherited from the target document at creation time. @@ -535,50 +507,47 @@ export class Comment extends Message { * * @generated from field: string visibility = 15; */ - visibility = '' + visibility = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.Comment' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.Comment"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 2, name: 'target_account', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 3, name: 'target_path', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 4, name: 'target_version', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 5, name: 'thread_root', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 12, name: 'thread_root_version', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 6, name: 'reply_parent', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 13, name: 'reply_parent_version', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 7, name: 'author', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 8, name: 'content', kind: 'message', T: BlockNode, repeated: true}, - {no: 9, name: 'create_time', kind: 'message', T: Timestamp}, - {no: 10, name: 'capability', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 11, name: 'version', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 14, name: 'update_time', kind: 'message', T: Timestamp}, - {no: 15, name: 'visibility', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target_account", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "target_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "target_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "thread_root", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 12, name: "thread_root_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "reply_parent", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 13, name: "reply_parent_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "content", kind: "message", T: BlockNode, repeated: true }, + { no: 9, name: "create_time", kind: "message", T: Timestamp }, + { no: 10, name: "capability", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 14, name: "update_time", kind: "message", T: Timestamp }, + { no: 15, name: "visibility", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Comment { - return new Comment().fromBinary(bytes, options) + return new Comment().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Comment { - return new Comment().fromJson(jsonValue, options) + return new Comment().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Comment { - return new Comment().fromJsonString(jsonString, options) + return new Comment().fromJsonString(jsonString, options); } - static equals( - a: Comment | PlainMessage | undefined, - b: Comment | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(Comment, a, b) + static equals(a: Comment | PlainMessage | undefined, b: Comment | PlainMessage | undefined): boolean { + return proto3.util.equals(Comment, a, b); } } @@ -595,44 +564,41 @@ export class UpdateCommentRequest extends Message { * * @generated from field: com.seed.documents.v3alpha.Comment comment = 1; */ - comment?: Comment + comment?: Comment; /** * Required. Name of the key to use for signing the comment update. * * @generated from field: string signing_key_name = 2; */ - signingKeyName = '' + signingKeyName = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.UpdateCommentRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.UpdateCommentRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'comment', kind: 'message', T: Comment}, - {no: 2, name: 'signing_key_name', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "comment", kind: "message", T: Comment }, + { no: 2, name: "signing_key_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): UpdateCommentRequest { - return new UpdateCommentRequest().fromBinary(bytes, options) + return new UpdateCommentRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): UpdateCommentRequest { - return new UpdateCommentRequest().fromJson(jsonValue, options) + return new UpdateCommentRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): UpdateCommentRequest { - return new UpdateCommentRequest().fromJsonString(jsonString, options) + return new UpdateCommentRequest().fromJsonString(jsonString, options); } - static equals( - a: UpdateCommentRequest | PlainMessage | undefined, - b: UpdateCommentRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(UpdateCommentRequest, a, b) + static equals(a: UpdateCommentRequest | PlainMessage | undefined, b: UpdateCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateCommentRequest, a, b); } } @@ -647,44 +613,41 @@ export class DeleteCommentRequest extends Message { * * @generated from field: string id = 1; */ - id = '' + id = ""; /** * Required. Name of the key to use for signing the comment deletion. * * @generated from field: string signing_key_name = 2; */ - signingKeyName = '' + signingKeyName = ""; constructor(data?: PartialMessage) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.DeleteCommentRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.DeleteCommentRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - {no: 2, name: 'signing_key_name', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "signing_key_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): DeleteCommentRequest { - return new DeleteCommentRequest().fromBinary(bytes, options) + return new DeleteCommentRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): DeleteCommentRequest { - return new DeleteCommentRequest().fromJson(jsonValue, options) + return new DeleteCommentRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): DeleteCommentRequest { - return new DeleteCommentRequest().fromJsonString(jsonString, options) + return new DeleteCommentRequest().fromJsonString(jsonString, options); } - static equals( - a: DeleteCommentRequest | PlainMessage | undefined, - b: DeleteCommentRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(DeleteCommentRequest, a, b) + static equals(a: DeleteCommentRequest | PlainMessage | undefined, b: DeleteCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteCommentRequest, a, b); } } @@ -700,36 +663,33 @@ export class GetCommentReplyCountRequest extends Message) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.GetCommentReplyCountRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.GetCommentReplyCountRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetCommentReplyCountRequest { - return new GetCommentReplyCountRequest().fromBinary(bytes, options) + return new GetCommentReplyCountRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): GetCommentReplyCountRequest { - return new GetCommentReplyCountRequest().fromJson(jsonValue, options) + return new GetCommentReplyCountRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): GetCommentReplyCountRequest { - return new GetCommentReplyCountRequest().fromJsonString(jsonString, options) + return new GetCommentReplyCountRequest().fromJsonString(jsonString, options); } - static equals( - a: GetCommentReplyCountRequest | PlainMessage | undefined, - b: GetCommentReplyCountRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(GetCommentReplyCountRequest, a, b) + static equals(a: GetCommentReplyCountRequest | PlainMessage | undefined, b: GetCommentReplyCountRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetCommentReplyCountRequest, a, b); } } @@ -744,36 +704,33 @@ export class GetCommentReplyCountResponse extends Message) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.GetCommentReplyCountResponse' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.GetCommentReplyCountResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'reply_count', kind: 'scalar', T: 3 /* ScalarType.INT64 */}, - ]) + { no: 1, name: "reply_count", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetCommentReplyCountResponse { - return new GetCommentReplyCountResponse().fromBinary(bytes, options) + return new GetCommentReplyCountResponse().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): GetCommentReplyCountResponse { - return new GetCommentReplyCountResponse().fromJson(jsonValue, options) + return new GetCommentReplyCountResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): GetCommentReplyCountResponse { - return new GetCommentReplyCountResponse().fromJsonString(jsonString, options) + return new GetCommentReplyCountResponse().fromJsonString(jsonString, options); } - static equals( - a: GetCommentReplyCountResponse | PlainMessage | undefined, - b: GetCommentReplyCountResponse | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(GetCommentReplyCountResponse, a, b) + static equals(a: GetCommentReplyCountResponse | PlainMessage | undefined, b: GetCommentReplyCountResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetCommentReplyCountResponse, a, b); } } @@ -788,36 +745,33 @@ export class ListCommentVersionsRequest extends Message) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.ListCommentVersionsRequest' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.ListCommentVersionsRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, - ]) + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentVersionsRequest { - return new ListCommentVersionsRequest().fromBinary(bytes, options) + return new ListCommentVersionsRequest().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentVersionsRequest { - return new ListCommentVersionsRequest().fromJson(jsonValue, options) + return new ListCommentVersionsRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): ListCommentVersionsRequest { - return new ListCommentVersionsRequest().fromJsonString(jsonString, options) + return new ListCommentVersionsRequest().fromJsonString(jsonString, options); } - static equals( - a: ListCommentVersionsRequest | PlainMessage | undefined, - b: ListCommentVersionsRequest | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(ListCommentVersionsRequest, a, b) + static equals(a: ListCommentVersionsRequest | PlainMessage | undefined, b: ListCommentVersionsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentVersionsRequest, a, b); } } @@ -832,35 +786,33 @@ export class ListCommentVersionsResponse extends Message) { - super() - proto3.util.initPartial(data, this) + super(); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'com.seed.documents.v3alpha.ListCommentVersionsResponse' + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v3alpha.ListCommentVersionsResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - {no: 1, name: 'versions', kind: 'message', T: Comment, repeated: true}, - ]) + { no: 1, name: "versions", kind: "message", T: Comment, repeated: true }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentVersionsResponse { - return new ListCommentVersionsResponse().fromBinary(bytes, options) + return new ListCommentVersionsResponse().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentVersionsResponse { - return new ListCommentVersionsResponse().fromJson(jsonValue, options) + return new ListCommentVersionsResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): ListCommentVersionsResponse { - return new ListCommentVersionsResponse().fromJsonString(jsonString, options) + return new ListCommentVersionsResponse().fromJsonString(jsonString, options); } - static equals( - a: ListCommentVersionsResponse | PlainMessage | undefined, - b: ListCommentVersionsResponse | PlainMessage | undefined, - ): boolean { - return proto3.util.equals(ListCommentVersionsResponse, a, b) + static equals(a: ListCommentVersionsResponse | PlainMessage | undefined, b: ListCommentVersionsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentVersionsResponse, a, b); } } + diff --git a/frontend/packages/shared/src/client/.generated/documents/v3alpha/documents_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v3alpha/documents_pb.ts index 043b7e7e4..aa690fe2b 100644 --- a/frontend/packages/shared/src/client/.generated/documents/v3alpha/documents_pb.ts +++ b/frontend/packages/shared/src/client/.generated/documents/v3alpha/documents_pb.ts @@ -2253,6 +2253,13 @@ export class CreateRefRequest extends Message { */ visibility = ResourceVisibility.UNSPECIFIED; + /** + * Optional. A human-readable message describing this publish, similar to a git commit message. + * + * @generated from field: string message = 9; + */ + message = ""; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2269,6 +2276,7 @@ export class CreateRefRequest extends Message { { no: 6, name: "timestamp", kind: "message", T: Timestamp }, { no: 7, name: "generation", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, { no: 8, name: "visibility", kind: "enum", T: proto3.getEnumType(ResourceVisibility) }, + { no: 9, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateRefRequest { @@ -3545,6 +3553,13 @@ export class Ref extends Message { */ generationInfo?: GenerationInfo; + /** + * Optional. A human-readable message attached to this Ref by the publisher. + * + * @generated from field: string message = 9; + */ + message = ""; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -3561,6 +3576,7 @@ export class Ref extends Message { { no: 6, name: "capability", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 7, name: "timestamp", kind: "message", T: Timestamp }, { no: 8, name: "generation_info", kind: "message", T: GenerationInfo }, + { no: 9, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Ref { diff --git a/proto/documents/v3alpha/documents.proto b/proto/documents/v3alpha/documents.proto index 250f39aab..2dbeb3bea 100644 --- a/proto/documents/v3alpha/documents.proto +++ b/proto/documents/v3alpha/documents.proto @@ -651,6 +651,9 @@ message CreateRefRequest { // Output only. Visibility of the document. ResourceVisibility visibility = 8; + + // Optional. A human-readable message describing this publish, similar to a git commit message. + string message = 9; } // Request to get a Ref by ID. @@ -1004,6 +1007,9 @@ message Ref { // Information about the generation of the Ref. GenerationInfo generation_info = 8; + + // Optional. A human-readable message attached to this Ref by the publisher. + string message = 9; } // Description of where the Ref points to. diff --git a/proto/documents/v3alpha/go.gensum b/proto/documents/v3alpha/go.gensum index 5a1fd8fd8..fb39964c2 100644 --- a/proto/documents/v3alpha/go.gensum +++ b/proto/documents/v3alpha/go.gensum @@ -1,2 +1,2 @@ -srcs: 109dd54ec1ad7e8f2f460ba49a4e3bc1 -outs: f303dc90c6b8d3a3ab2f6b54158dc771 +srcs: 87e9863d1e305fdefa47fcc461d01516 +outs: 09ae7206736b287dc94ce47e3e9eb455 diff --git a/proto/documents/v3alpha/js.gensum b/proto/documents/v3alpha/js.gensum index df41932d6..7963dd794 100644 --- a/proto/documents/v3alpha/js.gensum +++ b/proto/documents/v3alpha/js.gensum @@ -1,2 +1,2 @@ -srcs: 109dd54ec1ad7e8f2f460ba49a4e3bc1 -outs: 0a19c12cb99045c93b969a91d2695e79 +srcs: 87e9863d1e305fdefa47fcc461d01516 +outs: 32c946c16694ebc9e30dead0a5be134a From 507928482d7baa9c1c4c6bf3b23695ce2d853faf Mon Sep 17 00:00:00 2001 From: Horacio Herrera Date: Tue, 14 Apr 2026 18:42:43 +0200 Subject: [PATCH 2/7] feat(publish): surface ref message field through full stack 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 --- .../documents/v3alpha/docmodel/docmodel.go | 4 +- backend/api/documents/v3alpha/documents.go | 2 +- .../documents/v3alpha/documents.pb.go | 16 ++- .../src/components/publish-draft-button.tsx | 21 ++++ frontend/apps/desktop/src/models/documents.ts | 4 +- .../desktop/src/utils/publish-document.ts | 2 + frontend/packages/client/src/change.ts | 3 + frontend/packages/client/src/client.ts | 4 + .../documents/v3alpha/documents_pb.ts | 8 ++ .../shared/src/create-web-universal-client.ts | 2 + .../shared/src/models/activity-service.ts | 21 ++-- .../packages/shared/src/universal-client.ts | 2 + frontend/packages/ui/src/feed.tsx | 119 +++++++++--------- proto/documents/v3alpha/documents.proto | 3 + proto/documents/v3alpha/go.gensum | 4 +- proto/documents/v3alpha/js.gensum | 4 +- 16 files changed, 140 insertions(+), 79 deletions(-) diff --git a/backend/api/documents/v3alpha/docmodel/docmodel.go b/backend/api/documents/v3alpha/docmodel/docmodel.go index 1b3147790..0d6f74c00 100644 --- a/backend/api/documents/v3alpha/docmodel/docmodel.go +++ b/backend/api/documents/v3alpha/docmodel/docmodel.go @@ -382,7 +382,7 @@ func (dm *Document) CreateChange(signer core.Signer, at time.Time) (hb blob.Enco } // Ref creates a Ref blob for the current heads. -func (dm *Document) Ref(kp *core.KeyPair, visibility blob.Visibility) (ref blob.Encoded[*blob.Ref], err error) { +func (dm *Document) Ref(kp *core.KeyPair, visibility blob.Visibility, message string) (ref blob.Encoded[*blob.Ref], err error) { // TODO(hm24): make genesis detection more reliable. genesis := dm.crdt.cids[0] @@ -403,7 +403,7 @@ func (dm *Document) Ref(kp *core.KeyPair, visibility blob.Visibility) (ref blob. dm.Generation = maybe.New(head.Ts.UnixMilli()) } - return blob.NewRef(kp, dm.Generation.Value(), genesis, space, path, []cid.Cid{headCID}, head.Ts, visibility, "") + return blob.NewRef(kp, dm.Generation.Value(), genesis, space, path, []cid.Cid{headCID}, head.Ts, visibility, message) } func (dm *Document) cleanupPatch() (out blob.ChangeBody, err error) { diff --git a/backend/api/documents/v3alpha/documents.go b/backend/api/documents/v3alpha/documents.go index ee37d7caf..a83287aa6 100644 --- a/backend/api/documents/v3alpha/documents.go +++ b/backend/api/documents/v3alpha/documents.go @@ -247,7 +247,7 @@ func (srv *Server) CreateDocumentChange(ctx context.Context, in *documents.Creat return nil, status.Errorf(codes.InvalidArgument, "unknown visibility value: %v", in.Visibility) } - ref, err := doc.Ref(kp, visibility) + ref, err := doc.Ref(kp, visibility, in.Message) if err != nil { return nil, err } diff --git a/backend/genproto/documents/v3alpha/documents.pb.go b/backend/genproto/documents/v3alpha/documents.pb.go index f5b392688..dab8a6da8 100644 --- a/backend/genproto/documents/v3alpha/documents.pb.go +++ b/backend/genproto/documents/v3alpha/documents.pb.go @@ -440,7 +440,9 @@ type CreateDocumentChangeRequest struct { // Optional. Visibility of the document. // Can only be specified here when creating the document for the first time, // i.e. when `base_version` is empty. - Visibility ResourceVisibility `protobuf:"varint,8,opt,name=visibility,proto3,enum=com.seed.documents.v3alpha.ResourceVisibility" json:"visibility,omitempty"` + Visibility ResourceVisibility `protobuf:"varint,8,opt,name=visibility,proto3,enum=com.seed.documents.v3alpha.ResourceVisibility" json:"visibility,omitempty"` + // Optional. A human-readable message describing this publish, similar to a git commit message. + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -531,6 +533,13 @@ func (x *CreateDocumentChangeRequest) GetVisibility() ResourceVisibility { return ResourceVisibility_RESOURCE_VISIBILITY_UNSPECIFIED } +func (x *CreateDocumentChangeRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + // Request to prepare an unsigned document change for client-side signing. type PrepareChangeRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -4473,7 +4482,7 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "\x1bBatchGetDocumentInfoRequest\x12N\n" + "\brequests\x18\x01 \x03(\v22.com.seed.documents.v3alpha.GetDocumentInfoRequestR\brequests\"f\n" + "\x1cBatchGetDocumentInfoResponse\x12F\n" + - "\tdocuments\x18\x01 \x03(\v2(.com.seed.documents.v3alpha.DocumentInfoR\tdocuments\"\x88\x03\n" + + "\tdocuments\x18\x01 \x03(\v2(.com.seed.documents.v3alpha.DocumentInfoR\tdocuments\"\xa2\x03\n" + "\x1bCreateDocumentChangeRequest\x12\x18\n" + "\aaccount\x18\x01 \x01(\tR\aaccount\x12\x12\n" + "\x04path\x18\x02 \x01(\tR\x04path\x12!\n" + @@ -4486,7 +4495,8 @@ const file_documents_v3alpha_documents_proto_rawDesc = "" + "\ttimestamp\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12N\n" + "\n" + "visibility\x18\b \x01(\x0e2..com.seed.documents.v3alpha.ResourceVisibilityR\n" + - "visibility\"\x9d\x02\n" + + "visibility\x12\x18\n" + + "\amessage\x18\t \x01(\tR\amessage\"\x9d\x02\n" + "\x14PrepareChangeRequest\x12\x18\n" + "\aaccount\x18\x01 \x01(\tR\aaccount\x12\x12\n" + "\x04path\x18\x02 \x01(\tR\x04path\x12!\n" + diff --git a/frontend/apps/desktop/src/components/publish-draft-button.tsx b/frontend/apps/desktop/src/components/publish-draft-button.tsx index dee116879..8068a32f9 100644 --- a/frontend/apps/desktop/src/components/publish-draft-button.tsx +++ b/frontend/apps/desktop/src/components/publish-draft-button.tsx @@ -97,6 +97,9 @@ export default function PublishDraftButton() { // Inline error shown below the path input when publish fails during first publish const [publishError, setPublishError] = useState(null) + // Optional publish message (like a git commit message) + const [publishMessage, setPublishMessage] = useState('') + // Parent auto-link state for first publish type ParentPublishInfo = { parentId: UnpackedHypermediaId @@ -268,6 +271,7 @@ export default function PublishDraftButton() { draft: draft.data, destinationId, accountId, + message: publishMessage || undefined, }) const resultPath = entityQueryPathToHmIdPath(res.path) @@ -499,6 +503,23 @@ export default function PublishDraftButton() { + {/* Publish message (optional) */} +
+ +