AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
refactor(settings): restructure reading preferences into sections and surface custom CSS
tianma-ifd4ef0d8f1559
diff --git a/apps/web/src/components/settings/PreferenceCard.test.mjs b/apps/web/src/components/settings/PreferenceCard.test.mjsindex be687e49..1d54d755 100644--- a/apps/web/src/components/settings/PreferenceCard.test.mjs+++ b/apps/web/src/components/settings/PreferenceCard.test.mjs@@ -108,7 +108,10 @@ describe("settings information architecture", () => {const shortcuts = readFileSync(new URL("./ShortcutSettingsItem.tsx", import.meta.url), "utf8");expect(preferenceCard).toContain('t("settings.groups.interface")');+ expect(preferenceCard).toContain('t("settings.groups.readingAppearance")');expect(preferenceCard).toContain('t("settings.groups.reading")');+ expect(preferenceCard).toContain('t("settings.groups.readingElements")');+ expect(preferenceCard.indexOf("editorBodyCssTitle")).toBeLessThan(preferenceCard.indexOf("editorBodyFontTitle"));expect(preferenceCard).toContain('t("settings.groups.editing")');expect(preferenceCard).not.toContain("ShortcutSettingsItem");expect(settingsPane).toContain('t("settings.tabs.shortcuts")');diff --git a/apps/web/src/components/settings/PreferenceCard.tsx b/apps/web/src/components/settings/PreferenceCard.tsxindex 489b8877..bae99f57 100644--- a/apps/web/src/components/settings/PreferenceCard.tsx+++ b/apps/web/src/components/settings/PreferenceCard.tsx@@ -449,286 +449,299 @@ export const PreferenceCard = ({) : null}{section === "reading" ? (- <PreferenceSection title={t("settings.groups.reading")}>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Palette className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyPaletteTitle")}</div>+ <>+ <PreferenceSection title={t("settings.groups.readingAppearance")}>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Palette className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyPaletteTitle")}</div>+ </div></div>- </div>- <div className="flex w-full shrink-0 flex-col gap-2 sm:w-80">- <Select- value={noteProse.palette}- onValueChange={(value) => onNoteProseChange({ palette: value as NoteProsePaletteChoice })}- >- <SelectTrigger aria-label={t("settings.editorBodyPaletteTitle")} className="h-9 bg-card">- <SelectValue>- <span className="flex items-center gap-2">- <NoteProsePaletteSwatch paletteId={noteProse.palette} />- <span>{t(`settings.editorBodyPalettes.${noteProse.palette}`)}</span>- </span>- </SelectValue>- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_PALETTE_CHOICES.map((paletteId) => (- <SelectItem- key={paletteId}- value={paletteId}- className="pr-2.5 [&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:flex-1"- >- <span className="flex w-full items-center justify-between gap-3">- <span>{t(`settings.editorBodyPalettes.${paletteId}`)}</span>- <NoteProsePaletteSwatch paletteId={paletteId} />+ <div className="flex w-full shrink-0 flex-col gap-2 sm:w-80">+ <Select+ value={noteProse.palette}+ onValueChange={(value) => onNoteProseChange({ palette: value as NoteProsePaletteChoice })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyPaletteTitle")} className="h-9 bg-card">+ <SelectValue>+ <span className="flex items-center gap-2">+ <NoteProsePaletteSwatch paletteId={noteProse.palette} />+ <span>{t(`settings.editorBodyPalettes.${noteProse.palette}`)}</span></span>- </SelectItem>- ))}- </SelectContent>- </Select>+ </SelectValue>+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_PALETTE_CHOICES.map((paletteId) => (+ <SelectItem+ key={paletteId}+ value={paletteId}+ className="pr-2.5 [&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:flex-1"+ >+ <span className="flex w-full items-center justify-between gap-3">+ <span>{t(`settings.editorBodyPalettes.${paletteId}`)}</span>+ <NoteProsePaletteSwatch paletteId={paletteId} />+ </span>+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </div></div>- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Heading className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyHeadingStyleTitle")}</div>+ <div className="hidden min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4 lg:flex">+ <div className="flex min-w-0 items-center gap-3">+ <Code2 className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className="flex items-center gap-2">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyCssTitle")}</div>+ {Boolean(noteProse.customCss?.trim()) ? (+ <span className="inline-flex items-center rounded-full bg-emerald-50 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:bg-emerald-950/60 dark:text-emerald-300">+ {t("settings.editorBodyCssConfigured")}+ </span>+ ) : null}+ </div>+ <p className="text-xs leading-5 text-slate-500">{t("settings.accountSyncDescription")}</p>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-auto">+ <Button variant="outline" className="h-9 px-3 text-xs" onClick={openCssDialog}>+ {t("settings.editorBodyCssEdit")}+ </Button></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select- value={noteProseStyle.headingStyle}- onValueChange={(value) => writeNoteProseStylePreference({ headingStyle: value as NoteProseHeadingStyle })}- >- <SelectTrigger aria-label={t("settings.editorBodyHeadingStyleTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_HEADING_STYLES.map((styleId) => (- <SelectItem key={styleId} value={styleId}>- {t(`settings.editorBodyHeadingStyles.${styleId}`)}- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>+ </PreferenceSection>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <BookOpenText className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyFontTitle")}</div>+ <PreferenceSection title={t("settings.groups.reading")}>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <BookOpenText className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyFontTitle")}</div>+ </div></div>+ <FontChoiceFields+ label={t("settings.editorBodyFontTitle")}+ preference={editorBodyFont}+ includeCatalog+ onChange={updateEditorBodyFont}+ /></div>- <FontChoiceFields- label={t("settings.editorBodyFontTitle")}- preference={editorBodyFont}- includeCatalog- onChange={updateEditorBodyFont}- />- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Type className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyFontSizeTitle")}</div>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Type className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyFontSizeTitle")}</div>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select+ value={String(noteProse.fontSize)}+ onValueChange={(value) => onNoteProseChange({ fontSize: Number(value) as ResolvedNoteProse["fontSize"] })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyFontSizeTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_FONT_SIZES.map((size) => (+ <SelectItem key={size} value={String(size)}>{size}</SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select- value={String(noteProse.fontSize)}- onValueChange={(value) => onNoteProseChange({ fontSize: Number(value) as ResolvedNoteProse["fontSize"] })}- >- <SelectTrigger aria-label={t("settings.editorBodyFontSizeTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_FONT_SIZES.map((size) => (- <SelectItem key={size} value={String(size)}>{size}</SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <AlignVerticalSpaceAround className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyLineHeightTitle")}</div>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <AlignVerticalSpaceAround className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyLineHeightTitle")}</div>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select+ value={String(noteProse.lineHeight)}+ onValueChange={(value) => onNoteProseChange({ lineHeight: Number(value) as ResolvedNoteProse["lineHeight"] })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyLineHeightTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_LINE_HEIGHT_OPTIONS.map((option) => (+ <SelectItem key={option.value} value={option.value}>{t(option.labelKey)}</SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select- value={String(noteProse.lineHeight)}- onValueChange={(value) => onNoteProseChange({ lineHeight: Number(value) as ResolvedNoteProse["lineHeight"] })}- >- <SelectTrigger aria-label={t("settings.editorBodyLineHeightTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_LINE_HEIGHT_OPTIONS.map((option) => (- <SelectItem key={option.value} value={option.value}>{t(option.labelKey)}</SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>- {[- {- id: "paragraphSpacing",- title: t("settings.editorParagraphSpacingTitle"),- icon: Pilcrow,- value: String(noteProseStyle.paragraphSpacing),- options: NOTE_PROSE_PARAGRAPH_SPACINGS.map((value) => ({ value: String(value), label: `${value}px` })),- onChange: (value: string) => writeNoteProseStylePreference({ paragraphSpacing: parseNoteProseParagraphSpacing(Number(value)) ?? 8 }),- },- {- id: "textAlign",- title: t("settings.editorTextAlignTitle"),- icon: AlignLeft,- value: noteProseStyle.textAlign,- options: NOTE_PROSE_TEXT_ALIGNS.map((value) => ({ value, label: t(`settings.editorTextAlignOptions.${value}`) })),- onChange: (value: string) => writeNoteProseStylePreference({ textAlign: parseNoteProseTextAlign(value) ?? "left" }),- },- {- id: "letterSpacing",- title: t("settings.editorLetterSpacingTitle"),- icon: MoveHorizontal,- value: noteProseStyle.letterSpacing,- options: NOTE_PROSE_LETTER_SPACINGS.map((value) => ({ value, label: value === "default" ? t("settings.editorLetterSpacingDefault") : value })),- onChange: (value: string) => writeNoteProseStylePreference({ letterSpacing: parseNoteProseLetterSpacing(value) ?? "default" }),- },- ].map((setting) => {- const Icon = setting.icon;- return (- <div key={setting.id} className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Icon className="h-4 w-4 shrink-0 text-slate-500" />- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{setting.title}</div>+ {[+ {+ id: "paragraphSpacing",+ title: t("settings.editorParagraphSpacingTitle"),+ icon: Pilcrow,+ value: String(noteProseStyle.paragraphSpacing),+ options: NOTE_PROSE_PARAGRAPH_SPACINGS.map((value) => ({ value: String(value), label: `${value}px` })),+ onChange: (value: string) => writeNoteProseStylePreference({ paragraphSpacing: parseNoteProseParagraphSpacing(Number(value)) ?? 8 }),+ },+ {+ id: "textAlign",+ title: t("settings.editorTextAlignTitle"),+ icon: AlignLeft,+ value: noteProseStyle.textAlign,+ options: NOTE_PROSE_TEXT_ALIGNS.map((value) => ({ value, label: t(`settings.editorTextAlignOptions.${value}`) })),+ onChange: (value: string) => writeNoteProseStylePreference({ textAlign: parseNoteProseTextAlign(value) ?? "left" }),+ },+ {+ id: "letterSpacing",+ title: t("settings.editorLetterSpacingTitle"),+ icon: MoveHorizontal,+ value: noteProseStyle.letterSpacing,+ options: NOTE_PROSE_LETTER_SPACINGS.map((value) => ({ value, label: value === "default" ? t("settings.editorLetterSpacingDefault") : value })),+ onChange: (value: string) => writeNoteProseStylePreference({ letterSpacing: parseNoteProseLetterSpacing(value) ?? "default" }),+ },+ ].map((setting) => {+ const Icon = setting.icon;+ return (+ <div key={setting.id} className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Icon className="h-4 w-4 shrink-0 text-slate-500" />+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{setting.title}</div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select value={setting.value} onValueChange={setting.onChange}>+ <SelectTrigger aria-label={setting.title} className="h-9 bg-card"><SelectValue /></SelectTrigger>+ <SelectContent>+ {setting.options.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}+ </SelectContent>+ </Select>+ </div></div>- <div className="w-full shrink-0 sm:w-80">- <Select value={setting.value} onValueChange={setting.onChange}>- <SelectTrigger aria-label={setting.title} className="h-9 bg-card"><SelectValue /></SelectTrigger>- <SelectContent>- {setting.options.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}- </SelectContent>- </Select>+ );+ })}+ </PreferenceSection>++ <PreferenceSection title={t("settings.groups.readingElements")}>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Heading className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyHeadingStyleTitle")}</div></div></div>- );- })}-- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Quote className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyQuoteStyleTitle")}</div>+ <div className="w-full shrink-0 sm:w-80">+ <Select+ value={noteProseStyle.headingStyle}+ onValueChange={(value) => writeNoteProseStylePreference({ headingStyle: value as NoteProseHeadingStyle })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyHeadingStyleTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_HEADING_STYLES.map((styleId) => (+ <SelectItem key={styleId} value={styleId}>+ {t(`settings.editorBodyHeadingStyles.${styleId}`)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select- value={noteProseStyle.quoteStyle}- onValueChange={(value) => writeNoteProseStylePreference({ quoteStyle: value as NoteProseQuoteStyle })}- >- <SelectTrigger aria-label={t("settings.editorBodyQuoteStyleTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_QUOTE_STYLES.map((styleId) => (- <SelectItem key={styleId} value={styleId}>- {t(`settings.editorBodyQuoteStyles.${styleId}`)}- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <Highlighter className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyEmphasisStyleTitle")}</div>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Quote className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyQuoteStyleTitle")}</div>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select+ value={noteProseStyle.quoteStyle}+ onValueChange={(value) => writeNoteProseStylePreference({ quoteStyle: value as NoteProseQuoteStyle })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyQuoteStyleTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_QUOTE_STYLES.map((styleId) => (+ <SelectItem key={styleId} value={styleId}>+ {t(`settings.editorBodyQuoteStyles.${styleId}`)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select- value={noteProseStyle.emphasisStyle}- onValueChange={(value) => writeNoteProseStylePreference({ emphasisStyle: value as NoteProseEmphasisStyle })}- >- <SelectTrigger aria-label={t("settings.editorBodyEmphasisStyleTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {NOTE_PROSE_EMPHASIS_STYLES.map((styleId) => (- <SelectItem key={styleId} value={styleId}>- {t(`settings.editorBodyEmphasisStyles.${styleId}`)}- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <LayoutTemplate className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyMagazineCoverTitle")}</div>- <p className="text-xs leading-5 text-slate-500">{t("settings.editorBodyMagazineCoverDescription")}</p>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <Highlighter className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyEmphasisStyleTitle")}</div>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select+ value={noteProseStyle.emphasisStyle}+ onValueChange={(value) => writeNoteProseStylePreference({ emphasisStyle: value as NoteProseEmphasisStyle })}+ >+ <SelectTrigger aria-label={t("settings.editorBodyEmphasisStyleTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {NOTE_PROSE_EMPHASIS_STYLES.map((styleId) => (+ <SelectItem key={styleId} value={styleId}>+ {t(`settings.editorBodyEmphasisStyles.${styleId}`)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-auto">- <Switch- checked={noteProseStyle.showMagazineCover}- aria-label={t("settings.editorBodyMagazineCoverTitle")}- onCheckedChange={(checked) => writeNoteProseStylePreference({ showMagazineCover: checked })}- />- </div>- </div>- <div className="hidden min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4 lg:flex">- <div className="flex min-w-0 items-center gap-3">- <Code2 className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyCssTitle")}</div>- <p className="text-xs leading-5 text-slate-500">{t("settings.accountSyncDescription")}</p>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <LayoutTemplate className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorBodyMagazineCoverTitle")}</div>+ <p className="text-xs leading-5 text-slate-500">{t("settings.editorBodyMagazineCoverDescription")}</p>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-auto">+ <Switch+ checked={noteProseStyle.showMagazineCover}+ aria-label={t("settings.editorBodyMagazineCoverTitle")}+ onCheckedChange={(checked) => writeNoteProseStylePreference({ showMagazineCover: checked })}+ /></div></div>- <div className="w-full shrink-0 sm:w-auto">- <Button variant="outline" className="h-9 px-3 text-xs" onClick={openCssDialog}>- {t("settings.editorBodyCssEdit")}- </Button>- </div>- </div>- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">- <div className="flex min-w-0 items-center gap-3">- <ChartNoAxesCombined className="h-4 w-4 shrink-0 text-slate-500" />- <div className="min-w-0">- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.mermaidThemeTitle")}</div>+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <div className="flex min-w-0 items-center gap-3">+ <ChartNoAxesCombined className="h-4 w-4 shrink-0 text-slate-500" />+ <div className="min-w-0">+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.mermaidThemeTitle")}</div>+ </div>+ </div>+ <div className="w-full shrink-0 sm:w-80">+ <Select value={mermaidThemePreference} onValueChange={(value) => setMermaidTheme(value as typeof mermaidThemePreference)}>+ <SelectTrigger aria-label={t("settings.mermaidThemeTitle")} className="h-9 bg-card">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {MERMAID_THEME_PREFERENCES.map((theme) => (+ <SelectItem key={theme} value={theme}>+ {t(`settings.mermaidThemes.${theme}`)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></div></div>- <div className="w-full shrink-0 sm:w-80">- <Select value={mermaidThemePreference} onValueChange={(value) => setMermaidTheme(value as typeof mermaidThemePreference)}>- <SelectTrigger aria-label={t("settings.mermaidThemeTitle")} className="h-9 bg-card">- <SelectValue />- </SelectTrigger>- <SelectContent>- {MERMAID_THEME_PREFERENCES.map((theme) => (- <SelectItem key={theme} value={theme}>- {t(`settings.mermaidThemes.${theme}`)}- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- </div>- </PreferenceSection>+ </PreferenceSection>+ </>) : null}{section === "editing" ? (diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.tsindex 59772bc8..0aa02891 100644--- a/packages/shared/src/i18n/en-US.ts+++ b/packages/shared/src/i18n/en-US.ts@@ -1040,7 +1040,9 @@ export const enUS = {subtitle: "Preferences, system info, MCP tokens, and sign-in session",groups: {interface: "Interface",- reading: "Reading",+ readingAppearance: "Appearance & Custom Styles",+ reading: "Typography",+ readingElements: "Layout & Extensions",editing: "Editing",},languageTitle: "Interface language",@@ -1208,6 +1210,7 @@ export const enUS = {editorBodyCssPreviewAfter: ".",editorBodyCssPreviewQuote: "A quotation.",editorBodyCssDropped: "Some declarations will not apply and are removed on save.",+ editorBodyCssConfigured: "Configured",editorBodyCssEdit: "Edit styles",editorBodyCssReset: "Reset",editorBodyCssPlaceholder: "p { text-indent: 2em; } h1 { letter-spacing: 0.04em; }",diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.tsindex 25243de6..8b20b208 100644--- a/packages/shared/src/i18n/ja.ts+++ b/packages/shared/src/i18n/ja.ts@@ -1048,7 +1048,9 @@ export const ja = {subtitle: "設定、システム情報、MCP トークン、サインインセッション",groups: {interface: "画面",- reading: "閲覧",+ readingAppearance: "外観とカスタムスタイル",+ reading: "文字・段落",+ readingElements: "レイアウトと拡張",editing: "編集",},languageTitle: "表示言語",@@ -1216,6 +1218,7 @@ export const ja = {editorBodyCssPreviewAfter: "を含めます。",editorBodyCssPreviewQuote: "引用です。",editorBodyCssDropped: "適用されない宣言があり、保存時に除かれます。",+ editorBodyCssConfigured: "設定済み",editorBodyCssEdit: "スタイルを編集",editorBodyCssReset: "初期値に戻す",editorBodyCssPlaceholder: "p { text-indent: 2em; } h1 { letter-spacing: 0.04em; }",diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.tsindex 4685cb47..8e0ac0ab 100644--- a/packages/shared/src/i18n/pl.ts+++ b/packages/shared/src/i18n/pl.ts@@ -1048,7 +1048,9 @@ export const pl = {subtitle: "Preferencje, informacje o systemie, tokeny MCP i sesja logowania",groups: {interface: "Interfejs",- reading: "Czytanie",+ readingAppearance: "Wygląd i własne style",+ reading: "Typografia",+ readingElements: "Układ i rozszerzenia",editing: "Edycja",},languageTitle: "Język interfejsu",@@ -1216,6 +1218,7 @@ export const pl = {editorBodyCssPreviewAfter: ".",editorBodyCssPreviewQuote: "Cytat.",editorBodyCssDropped: "Niektóre deklaracje nie zostaną zastosowane i zostaną usunięte przy zapisie.",+ editorBodyCssConfigured: "Skonfigurowano",editorBodyCssEdit: "Edytuj style",editorBodyCssReset: "Resetuj",editorBodyCssPlaceholder: "p { text-indent: 2em; } h1 { letter-spacing: 0.04em; }",diff --git a/packages/shared/src/i18n/ru.ts b/packages/shared/src/i18n/ru.tsindex 1df8b2f8..03ae6e59 100644--- a/packages/shared/src/i18n/ru.ts+++ b/packages/shared/src/i18n/ru.ts@@ -1059,7 +1059,9 @@ export const ru = {subtitle: "Настройки, сведения о системе, токены MCP и сеанс входа",groups: {interface: "Интерфейс",- reading: "Чтение",+ readingAppearance: "Внешний вид и свои стили",+ reading: "Типографика",+ readingElements: "Макет и расширения",editing: "Редактирование",},languageTitle: "Язык интерфейса",@@ -1227,6 +1229,7 @@ export const ru = {editorBodyCssPreviewAfter: ".",editorBodyCssPreviewQuote: "Цитата.",editorBodyCssDropped: "Некоторые объявления не применятся и будут удалены при сохранении.",+ editorBodyCssConfigured: "Настроено",editorBodyCssEdit: "Изменить стили",editorBodyCssReset: "Сбросить",editorBodyCssPlaceholder: "p { text-indent: 2em; } h1 { letter-spacing: 0.04em; }",diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.tsindex e5d94fc7..3320ef7d 100644--- a/packages/shared/src/i18n/zh-CN.ts+++ b/packages/shared/src/i18n/zh-CN.ts@@ -1059,7 +1059,9 @@ export const zhCN = {subtitle: "个人偏好、系统信息、MCP Token 与登录会话",groups: {interface: "界面",- reading: "阅读",+ readingAppearance: "外观与自定义样式",+ reading: "文字排版",+ readingElements: "版式与扩展",editing: "编辑",},languageTitle: "界面语言",@@ -1227,6 +1229,7 @@ export const zhCN = {editorBodyCssPreviewAfter: "。",editorBodyCssPreviewQuote: "引用一句。",editorBodyCssDropped: "有声明不会生效,保存时会去掉。",+ editorBodyCssConfigured: "已配置",editorBodyCssEdit: "编辑样式",editorBodyCssReset: "恢复预置",editorBodyCssPlaceholder: "例如 p { text-indent: 2em; } h1 { letter-spacing: 0.04em; }",