From b6d428ba358463986ed59f4b43fc896d9f8374cc Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:23:20 +0000 Subject: [PATCH] Add pinned and archived flags to Conversation Why: the approved task-centric sidebar (proposal 2026-09-30, option A) needs server-authoritative pin and archive state on conversations; client-side storage would be fake state against the event-sourced model. Evidence: go test ./... passes; omitempty keeps wire format and golden samples byte-identical for zero values (backward compatible). Impact: additive optional fields; consumers ignoring unknown fields are unaffected (forward-compat principle). Backend consumes via submodule bump. Refs: Agent-System-Documents docs/proposals/2026-09-30-ui-redesign-and-auth.md (P6/P8, R1) --- model.go | 2 ++ ts/types.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/model.go b/model.go index b69c892..c64f24e 100644 --- a/model.go +++ b/model.go @@ -31,6 +31,8 @@ type Conversation struct { Owner ID `json:"owner,omitempty"` // 冗余自项目,查询过滤用 Title string `json:"title"` ProfileID ID `json:"profileId,omitempty"` // 空为默认画像 + Pinned bool `json:"pinned,omitempty"` // 侧栏置顶(方案 A P6/P8:本端组织偏好,服务端权威) + Archived bool `json:"archived,omitempty"` // 归档:列表默认隐藏,数据保留 CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } diff --git a/ts/types.ts b/ts/types.ts index f713e6b..96b638a 100644 --- a/ts/types.ts +++ b/ts/types.ts @@ -13,6 +13,7 @@ export interface Project { export interface Conversation { id: ID; projectId: ID; owner?: ID; title: string; profileId?: ID; + pinned?: boolean; archived?: boolean; createdAt: string; updatedAt: string; } -- 2.54.0