From ebe76656204c98f268dda43449893bf2bb1c86ad Mon Sep 17 00:00:00 2001 From: kongkx Date: Sat, 11 Jul 2026 08:42:39 +0800 Subject: [PATCH] feat(studio): reflect account-voice / series-scope field split Robot-author edit form and detail drop positioning/target_readers (now series-level); persona + styles stay (routed to the account profile via the admin API). Series detail shows positioning/target_readers. Types updated; admin API types regenerated. --- src/api/types.gen.ts | 4 ++-- src/api/types.ts | 6 ++++-- src/features/studio/robot-author-edit-sheet.tsx | 17 +++-------------- src/routes/_authed/studio/robot-authors.tsx | 2 -- src/routes/_authed/studio/series.tsx | 2 ++ 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/api/types.gen.ts b/src/api/types.gen.ts index fe9d48c..5c9c538 100644 --- a/src/api/types.gen.ts +++ b/src/api/types.gen.ts @@ -690,7 +690,7 @@ export interface paths { content: { "application/json": { /** - * @example ios + * @example android * @enum {string|null} */ platform?: "ios" | "android" | "web" | "desktop" | null; @@ -1155,7 +1155,7 @@ export interface paths { content: { "application/json": { /** - * @example dismissed + * @example resolved * @enum {string|null} */ status?: "open" | "resolved" | "dismissed" | null; diff --git a/src/api/types.ts b/src/api/types.ts index 1f7282c..c4db5ae 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -152,9 +152,8 @@ export interface StudioRobotAuthor { avatar?: string | null category_id: string subtopic_id: string | null + /** Account-level voice — stored on the shared profile, flattened into the author. */ persona: string | null - positioning: string | null - target_readers: string | null article_style: Record | null image_style: Record | null publishing_rules: Record | null @@ -173,6 +172,9 @@ export interface StudioSeries { subtopic_id: string | null robot_author_id: string goal: string | null + /** Series-level angle/audience (moved off the author). */ + positioning: string | null + target_readers: string | null reader_journey: string | null target_article_count: number | null planned_articles: unknown[] | null diff --git a/src/features/studio/robot-author-edit-sheet.tsx b/src/features/studio/robot-author-edit-sheet.tsx index 574473f..ed27106 100644 --- a/src/features/studio/robot-author-edit-sheet.tsx +++ b/src/features/studio/robot-author-edit-sheet.tsx @@ -46,8 +46,6 @@ const jsonObject = z.string().refine( const schema = z.object({ persona: z.string(), - positioning: z.string(), - target_readers: z.string(), status: z.enum(STATUSES), article_style: jsonObject, image_style: jsonObject, @@ -75,8 +73,6 @@ export function RobotAuthorEditSheet({ author, onOpenChange }: RobotAuthorEditSh resolver: zodResolver(schema), defaultValues: { persona: '', - positioning: '', - target_readers: '', status: 'pending', article_style: '', image_style: '', @@ -88,8 +84,6 @@ export function RobotAuthorEditSheet({ author, onOpenChange }: RobotAuthorEditSh if (!author) return form.reset({ persona: author.persona ?? '', - positioning: author.positioning ?? '', - target_readers: author.target_readers ?? '', status: author.status, article_style: asText(author.article_style), image_style: asText(author.image_style), @@ -102,8 +96,6 @@ export function RobotAuthorEditSheet({ author, onOpenChange }: RobotAuthorEditSh if (!author) throw new Error('no author') return updateRobotAuthor(author.id, { persona: values.persona.trim() || null, - positioning: values.positioning.trim() || null, - target_readers: values.target_readers.trim() || null, status: values.status, article_style: parseObject(values.article_style), image_style: parseObject(values.image_style), @@ -153,12 +145,9 @@ export function RobotAuthorEditSheet({ author, onOpenChange }: RobotAuthorEditSh