From af3010abaa37f7db4144820469422bdbb432adfc Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 27 Dec 2025 16:30:11 +0200 Subject: feat: add customizable tag styles (#2312) * feat: add customizable tag styles * add tag lang setting * ui settings cleanup * fix migration * change look of the field * more fixes * fix tests --- packages/trpc/models/users.ts | 6 ++++++ packages/trpc/routers/users.test.ts | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'packages/trpc') diff --git a/packages/trpc/models/users.ts b/packages/trpc/models/users.ts index 0653349b..d8a84ffa 100644 --- a/packages/trpc/models/users.ts +++ b/packages/trpc/models/users.ts @@ -439,6 +439,8 @@ export class User { readerFontFamily: true, autoTaggingEnabled: true, autoSummarizationEnabled: true, + tagStyle: true, + inferredTagLang: true, }, }); @@ -461,6 +463,8 @@ export class User { readerFontFamily: settings.readerFontFamily, autoTaggingEnabled: settings.autoTaggingEnabled, autoSummarizationEnabled: settings.autoSummarizationEnabled, + tagStyle: settings.tagStyle ?? "as-generated", + inferredTagLang: settings.inferredTagLang, }; } @@ -488,6 +492,8 @@ export class User { readerFontFamily: input.readerFontFamily, autoTaggingEnabled: input.autoTaggingEnabled, autoSummarizationEnabled: input.autoSummarizationEnabled, + tagStyle: input.tagStyle, + inferredTagLang: input.inferredTagLang, }) .where(eq(users.id, this.user.id)); } diff --git a/packages/trpc/routers/users.test.ts b/packages/trpc/routers/users.test.ts index 21f05f5b..38ce2353 100644 --- a/packages/trpc/routers/users.test.ts +++ b/packages/trpc/routers/users.test.ts @@ -167,6 +167,8 @@ describe("User Routes", () => { // AI Settings autoSummarizationEnabled: null, autoTaggingEnabled: null, + inferredTagLang: null, + tagStyle: "lowercase-hyphens", }); // Update settings @@ -184,6 +186,8 @@ describe("User Routes", () => { // AI Settings autoSummarizationEnabled: true, autoTaggingEnabled: true, + inferredTagLang: "en", + tagStyle: "lowercase-underscores", }); // Verify updated settings @@ -204,6 +208,8 @@ describe("User Routes", () => { // AI Settings autoSummarizationEnabled: true, autoTaggingEnabled: true, + inferredTagLang: "en", + tagStyle: "lowercase-underscores", }); // Test invalid update (e.g., empty input, if schema enforces it) -- cgit v1.2.3-70-g09d2