mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-02 17:22:06 +03:00
style(webui): show third-party logos by default
This commit is contained in:
@@ -18,7 +18,7 @@ export const DEFAULT_LOCAL_PREFS: LocalPreferences = {
|
|||||||
density: "comfortable",
|
density: "comfortable",
|
||||||
activityMode: "auto",
|
activityMode: "auto",
|
||||||
codeWrap: true,
|
codeWrap: true,
|
||||||
brandLogos: false,
|
brandLogos: true,
|
||||||
browserNotifications: false,
|
browserNotifications: false,
|
||||||
fileEditDisplayMode: "summary",
|
fileEditDisplayMode: "summary",
|
||||||
};
|
};
|
||||||
@@ -36,7 +36,7 @@ export function readLocalPreferences(): LocalPreferences {
|
|||||||
density: parsed.density === "compact" ? "compact" : "comfortable",
|
density: parsed.density === "compact" ? "compact" : "comfortable",
|
||||||
activityMode: parsed.activityMode === "expanded" ? "expanded" : "auto",
|
activityMode: parsed.activityMode === "expanded" ? "expanded" : "auto",
|
||||||
codeWrap: parsed.codeWrap !== false,
|
codeWrap: parsed.codeWrap !== false,
|
||||||
brandLogos: parsed.brandLogos === true,
|
brandLogos: parsed.brandLogos !== false,
|
||||||
browserNotifications: parsed.browserNotifications === true,
|
browserNotifications: parsed.browserNotifications === true,
|
||||||
fileEditDisplayMode: normalizeFileEditDisplayMode(parsed.fileEditDisplayMode),
|
fileEditDisplayMode: normalizeFileEditDisplayMode(parsed.fileEditDisplayMode),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it } from "vitest";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
DEFAULT_LOCAL_PREFS,
|
DEFAULT_LOCAL_PREFS,
|
||||||
|
LOCAL_PREFS_STORAGE_KEY,
|
||||||
readLocalPreferences,
|
readLocalPreferences,
|
||||||
writeLocalPreferences,
|
writeLocalPreferences,
|
||||||
} from "@/lib/local-preferences";
|
} from "@/lib/local-preferences";
|
||||||
@@ -9,6 +10,17 @@ import {
|
|||||||
describe("local preferences", () => {
|
describe("local preferences", () => {
|
||||||
beforeEach(() => localStorage.clear());
|
beforeEach(() => localStorage.clear());
|
||||||
|
|
||||||
|
it("shows third-party brand logos by default while preserving an explicit opt-out", () => {
|
||||||
|
expect(DEFAULT_LOCAL_PREFS.brandLogos).toBe(true);
|
||||||
|
expect(readLocalPreferences().brandLogos).toBe(true);
|
||||||
|
|
||||||
|
localStorage.setItem(
|
||||||
|
LOCAL_PREFS_STORAGE_KEY,
|
||||||
|
JSON.stringify({ brandLogos: false }),
|
||||||
|
);
|
||||||
|
expect(readLocalPreferences().brandLogos).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("keeps browser notifications opt-in", () => {
|
it("keeps browser notifications opt-in", () => {
|
||||||
expect(DEFAULT_LOCAL_PREFS.browserNotifications).toBe(false);
|
expect(DEFAULT_LOCAL_PREFS.browserNotifications).toBe(false);
|
||||||
expect(readLocalPreferences().browserNotifications).toBe(false);
|
expect(readLocalPreferences().browserNotifications).toBe(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user