fix(webui): reorder appearance settings and trim preview
This commit is contained in:
1 parent
0ce10533d3
commit
c3403e6a6f
14 files changed
+31
-27
No files matched your search
@@ -4,6 +4,13 @@ test.beforeEach(async ({ page }) => {
|
||||
await page.route("**/api/**", (route) => route.abort());
|
||||
});
|
||||
|
||||
test("appearance puts interface settings before activity display", async ({ page }) => {
|
||||
await page.goto("/browser/fixture.html?case=appearance");
|
||||
await expect(page.locator(".appearance-page > section > h2")).toHaveText([
|
||||
"Theme", "Reading", "Interface", "Activity display",
|
||||
]);
|
||||
});
|
||||
|
||||
test("system theme stays live, explicit choices persist, and tabs agree", async ({ page, context }) => {
|
||||
await page.emulateMedia({ colorScheme: "light" });
|
||||
await page.goto("/browser/fixture.html?case=appearance");
|
||||
|
||||
@@ -103,7 +103,7 @@ for (const width of [390, 1440]) for (const locale of ["en", "zh-CN"]) {
|
||||
await page.goto(fixture("settings", "loaded", "§ion=appearance"));
|
||||
const target = page.locator('[data-settings-section="appearance"]');
|
||||
const ready = async () => {
|
||||
await expect(target.locator("[data-reading-preview-content] strong")).toBeVisible();
|
||||
await expect(target.locator("[data-reading-preview-content] .markdown-content p").first()).toBeVisible();
|
||||
await expect(target.locator("[data-reading-preview-content] .markdown-content p").first()).toHaveCSS("font-size", "24px");
|
||||
await settle(page);
|
||||
};
|
||||
|
||||
@@ -67,6 +67,19 @@ export function AppearanceSettingsView({ themePreference, onChangeTheme, localPr
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<SettingsSectionTitle>{t("settings.sections.interface")}</SettingsSectionTitle>
|
||||
<SettingsGroup>
|
||||
<SettingsRow title={t("settings.rows.language")}><LanguageSwitcher /></SettingsRow>
|
||||
<SettingsRow title={t("settings.rows.brandLogos")} description={t("settings.legal.thirdPartyBrands")}>
|
||||
<ToggleButton checked={localPrefs.brandLogos}
|
||||
onChange={(brandLogos) => onChangeLocalPrefs((previous) => ({ ...previous, brandLogos }))}
|
||||
ariaLabel={t("settings.rows.brandLogos")}
|
||||
label={t(localPrefs.brandLogos ? "settings.values.on" : "settings.values.off")} />
|
||||
</SettingsRow>
|
||||
</SettingsGroup>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<SettingsSectionTitle>
|
||||
<SettingsHint description={t("settings.appearance.processHelp")}>{t("settings.appearance.process")}</SettingsHint>
|
||||
@@ -94,18 +107,5 @@ export function AppearanceSettingsView({ themePreference, onChangeTheme, localPr
|
||||
</div>
|
||||
</SettingsGroup>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<SettingsSectionTitle>{t("settings.sections.interface")}</SettingsSectionTitle>
|
||||
<SettingsGroup>
|
||||
<SettingsRow title={t("settings.rows.language")}><LanguageSwitcher /></SettingsRow>
|
||||
<SettingsRow title={t("settings.rows.brandLogos")} description={t("settings.legal.thirdPartyBrands")}>
|
||||
<ToggleButton checked={localPrefs.brandLogos}
|
||||
onChange={(brandLogos) => onChangeLocalPrefs((previous) => ({ ...previous, brandLogos }))}
|
||||
ariaLabel={t("settings.rows.brandLogos")}
|
||||
label={t(localPrefs.brandLogos ? "settings.values.on" : "settings.values.off")} />
|
||||
</SettingsRow>
|
||||
</SettingsGroup>
|
||||
</section>
|
||||
</div>;
|
||||
}
|
||||
@@ -135,9 +135,6 @@ export function ReadingSettings({ preferences, onChange }: {
|
||||
<div className="reading-typography appearance-reading-preview"
|
||||
data-reading-text-size={preferences.readingTextSize}
|
||||
style={{ "--custom-reading-size": `${preferences.customReadingTextSize}px` } as CSSProperties}>
|
||||
<div className="mb-4 flex items-center gap-2 text-caption font-medium text-foreground">
|
||||
<img src="/brand/nanobot_mark.svg" className="h-5 w-5" alt="" />nanobot
|
||||
</div>
|
||||
<div data-reading-preview-content>
|
||||
<MarkdownText>{t("settings.appearance.previewText")}</MarkdownText>
|
||||
<div className="mt-4 overflow-x-auto rounded-control bg-muted/60 px-4 py-3">
|
||||
|
||||
@@ -944,7 +944,7 @@
|
||||
"small": "Small",
|
||||
"standard": "Standard",
|
||||
"large": "Large",
|
||||
"previewText": "**A little room to think.**\n\nClear words, comfortable reading. Make this space your own.",
|
||||
"previewText": "Clear words, comfortable reading. Make this space your own.",
|
||||
"previewPlaceholder": "Where should we begin?",
|
||||
"process": "Activity display",
|
||||
"processHelp": "Choose how much detail appears as nanobot works.",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "Pequeño",
|
||||
"standard": "Estándar",
|
||||
"large": "Grande",
|
||||
"previewText": "**Un poco de espacio para pensar.**\n\nPalabras claras, lectura cómoda. Haz tuyo este espacio.",
|
||||
"previewText": "Palabras claras, lectura cómoda. Haz tuyo este espacio.",
|
||||
"previewPlaceholder": "¿Por dónde empezamos?",
|
||||
"process": "Visualización de actividad",
|
||||
"processHelp": "Elige cuánto detalle se muestra mientras nanobot trabaja.",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "Petit",
|
||||
"standard": "Standard",
|
||||
"large": "Grand",
|
||||
"previewText": "**Un peu d’espace pour réfléchir.**\n\nDes mots clairs, une lecture agréable. Faites de cet espace le vôtre.",
|
||||
"previewText": "Des mots clairs, une lecture agréable. Faites de cet espace le vôtre.",
|
||||
"previewPlaceholder": "Par où commencer ?",
|
||||
"process": "Affichage de l’activité",
|
||||
"processHelp": "Choisissez le niveau de détail affiché pendant que nanobot travaille.",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "Kecil",
|
||||
"standard": "Standar",
|
||||
"large": "Besar",
|
||||
"previewText": "**Sedikit ruang untuk berpikir.**\n\nKata-kata yang jelas, nyaman dibaca. Jadikan ruang ini milik Anda.",
|
||||
"previewText": "Kata-kata yang jelas, nyaman dibaca. Jadikan ruang ini milik Anda.",
|
||||
"previewPlaceholder": "Dari mana kita mulai?",
|
||||
"process": "Tampilan aktivitas",
|
||||
"processHelp": "Pilih seberapa banyak detail yang ditampilkan saat nanobot bekerja.",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "小",
|
||||
"standard": "標準",
|
||||
"large": "大",
|
||||
"previewText": "**考えるための、少しの余白。**\n\n明快な言葉と、心地よい読みやすさ。この空間を、あなたらしく。",
|
||||
"previewText": "明快な言葉と、心地よい読みやすさ。この空間を、あなたらしく。",
|
||||
"previewPlaceholder": "何から始めましょうか?",
|
||||
"process": "処理状況の表示",
|
||||
"processHelp": "nanobot の作業中に表示する詳細の量を選びます。",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "작게",
|
||||
"standard": "표준",
|
||||
"large": "크게",
|
||||
"previewText": "**생각을 위한 작은 여유.**\n\n명확한 글과 편안한 읽기. 이 공간을 나에게 맞게 꾸며 보세요.",
|
||||
"previewText": "명확한 글과 편안한 읽기. 이 공간을 나에게 맞게 꾸며 보세요.",
|
||||
"previewPlaceholder": "어디서부터 시작할까요?",
|
||||
"process": "활동 표시",
|
||||
"processHelp": "nanobot이 작업하는 동안 표시할 세부 정보의 양을 선택하세요.",
|
||||
|
||||
@@ -764,7 +764,7 @@
|
||||
"small": "Pequeno",
|
||||
"standard": "Padrão",
|
||||
"large": "Grande",
|
||||
"previewText": "**Um pouco de espaço para pensar.**\n\nPalavras claras, leitura confortável. Deixe este espaço com a sua cara.",
|
||||
"previewText": "Palavras claras, leitura confortável. Deixe este espaço com a sua cara.",
|
||||
"previewPlaceholder": "Por onde começamos?",
|
||||
"process": "Exibição de atividade",
|
||||
"processHelp": "Escolha o nível de detalhe exibido enquanto o nanobot trabalha.",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "Nhỏ",
|
||||
"standard": "Tiêu chuẩn",
|
||||
"large": "Lớn",
|
||||
"previewText": "**Một chút không gian để suy nghĩ.**\n\nCâu chữ rõ ràng, đọc thật thoải mái. Biến không gian này thành của riêng bạn.",
|
||||
"previewText": "Câu chữ rõ ràng, đọc thật thoải mái. Biến không gian này thành của riêng bạn.",
|
||||
"previewPlaceholder": "Chúng ta nên bắt đầu từ đâu?",
|
||||
"process": "Hiển thị hoạt động",
|
||||
"processHelp": "Chọn mức độ chi tiết hiển thị khi nanobot làm việc.",
|
||||
|
||||
@@ -944,7 +944,7 @@
|
||||
"small": "小",
|
||||
"standard": "标准",
|
||||
"large": "大",
|
||||
"previewText": "**给思考留一点空间。**\n\n清晰的文字,舒服的节奏。让每一个想法,都有自在展开的空间。",
|
||||
"previewText": "清晰的文字,舒服的节奏。让每一个想法,都有自在展开的空间。",
|
||||
"previewPlaceholder": "接下来,想聊点什么?",
|
||||
"process": "过程展示",
|
||||
"processHelp": "选择 nanobot 工作时展示多少细节。",
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
"small": "小",
|
||||
"standard": "標準",
|
||||
"large": "大",
|
||||
"previewText": "**給思考留一點空間。**\n\n清晰的文字,舒服的節奏。讓每一個想法,都有自在展開的空間。",
|
||||
"previewText": "清晰的文字,舒服的節奏。讓每一個想法,都有自在展開的空間。",
|
||||
"previewPlaceholder": "接下來,想聊點什麼?",
|
||||
"process": "過程展示",
|
||||
"processHelp": "選擇 nanobot 工作時展示多少細節。",
|
||||
|
||||
Reference in new issue
Block a user