From d330f4a64ccb249cbc35042d86887d784c9b91ea Mon Sep 17 00:00:00 2001 From: LukeGus Date: Thu, 29 Oct 2026 13:00:15 -0500 Subject: [PATCH] feat: sidebar preference for alternating rows (#1712) --- CHANGELOG.md | 1 + src/types/host-sidebar-preferences.ts | 7 +++++++ src/ui/locales/en.json | 2 ++ src/ui/tests/types/host-sidebar-preferences.test.ts | 2 ++ 4 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b336d9f6..1f56e49ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Plugins can say how they show in the mobile app - The plugin list tells the mobile app which plugin API each plugin needs, so the app can say when it or a plugin needs an update - Hosts can have a color and an icon, which sync to the desktop and mobile apps +- A sidebar setting to turn off alternating row colors ### Fixed diff --git a/src/types/host-sidebar-preferences.ts b/src/types/host-sidebar-preferences.ts index 56ea4bc1a..3040d054c 100644 --- a/src/types/host-sidebar-preferences.ts +++ b/src/types/host-sidebar-preferences.ts @@ -87,6 +87,8 @@ export interface HostSidebarDisplayPreferences extends HostRowFields { openOnDoubleClick: boolean; /** When false, nested folders hide the parent-path breadcrumb before their name. */ showFolderPaths: boolean; + /** When false, rows keep one background instead of alternating. */ + stripedRows: boolean; hostClickBehavior: HostClickBehavior; /** When true, the sidebar closes after a host is opened from it. */ closeOnOpen: boolean; @@ -164,6 +166,7 @@ export function defaultHostSidebarPreferences(): HostSidebarPreferences { statusColorScheme: "accent", openOnDoubleClick: false, showFolderPaths: true, + stripedRows: true, hostClickBehavior: "newTab", closeOnOpen: false, barActions: {}, @@ -272,6 +275,10 @@ export function sanitizeHostSidebarPreferences( typeof displayObj.showFolderPaths === "boolean" ? displayObj.showFolderPaths : defaults.display.showFolderPaths, + stripedRows: + typeof displayObj.stripedRows === "boolean" + ? displayObj.stripedRows + : defaults.display.stripedRows, hostClickBehavior: HOST_CLICK_BEHAVIORS.includes( displayObj.hostClickBehavior as HostClickBehavior, ) diff --git a/src/ui/locales/en.json b/src/ui/locales/en.json index dd208bd5d..8cfd716cd 100644 --- a/src/ui/locales/en.json +++ b/src/ui/locales/en.json @@ -590,6 +590,8 @@ "closeOnOpenDesc": "Close the sidebar after you open a host from it", "showFolderPaths": "Show folder paths", "showFolderPathsDesc": "Show the parent folder path above nested subfolder names. Subfolders stay indented either way.", + "stripedRows": "Alternating row colors", + "stripedRowsDesc": "Shade every other row in the host and login lists", "rowDetailsTitle": "Row details", "rowDetailsDesc": "Choose what shows on each host.", "showAddress": "Address", diff --git a/src/ui/tests/types/host-sidebar-preferences.test.ts b/src/ui/tests/types/host-sidebar-preferences.test.ts index 1491446fa..4bb5bab1a 100644 --- a/src/ui/tests/types/host-sidebar-preferences.test.ts +++ b/src/ui/tests/types/host-sidebar-preferences.test.ts @@ -27,6 +27,7 @@ describe("defaultHostSidebarPreferences", () => { statusColorScheme: "accent", openOnDoubleClick: false, showFolderPaths: true, + stripedRows: true, hostClickBehavior: "newTab", closeOnOpen: false, barActions: {}, @@ -74,6 +75,7 @@ describe("sanitizeHostSidebarPreferences", () => { statusColorScheme: "status", openOnDoubleClick: true, showFolderPaths: false, + stripedRows: true, hostClickBehavior: "focusExistingDoubleClickNew", closeOnOpen: true, barActions: { maintenance: true },