feat(webui): add reading text size preferences (#6325)

* feat(webui): add reading text size preferences

* fix(webui): align loading skeletons with reading typography
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-20 16:33:05 +08:00
1 parent 816c9221a0
commit 282839cc65
48 files changed
+662 -120

No files matched your search

+5
View File
@@ -1,8 +1,10 @@
export type LocalActivityMode = "auto" | "expanded";
export type ReadingTextSize = "small" | "standard" | "large";
export type FileEditDisplayMode = "summary" | "diff" | "collapsed_diff";
export interface LocalPreferences {
activityMode: LocalActivityMode;
readingTextSize: ReadingTextSize;
codeWrap: boolean;
brandLogos: boolean;
browserNotifications: boolean;
@@ -20,6 +22,7 @@ type PersistedLocalPreferences = Partial<LocalPreferences> & {
export const DEFAULT_LOCAL_PREFS: LocalPreferences = {
activityMode: "auto",
readingTextSize: "standard",
codeWrap: true,
brandLogos: true,
browserNotifications: false,
@@ -38,6 +41,8 @@ export function readLocalPreferences(): LocalPreferences {
const parsed = JSON.parse(raw) as PersistedLocalPreferences;
return {
activityMode: parsed.activityMode === "expanded" ? "expanded" : "auto",
readingTextSize: parsed.readingTextSize === "small" || parsed.readingTextSize === "large"
? parsed.readingTextSize : "standard",
codeWrap: parsed.codeWrap !== false,
brandLogos: parsed.schemaVersion === LOCAL_PREFS_SCHEMA_VERSION
? parsed.brandLogos !== false
+3
View File
@@ -6,6 +6,9 @@ const twMerge = extendTailwindMerge({
theme: {
borderRadius: ["mark", "compact", "control", "floating", "panel", "modal", "prominent"],
},
classGroups: {
"font-size": [{ text: ["ui", "ui-label", "ui-heading", "ui-body", "control-label", "caption", "title", "reading", "reading-small", "code", "code-dense", "composer"] }],
},
},
});