feat: Allow to disable showing paths to folders (#1274)

https://github.com/Termix-SSH/Support/issues/1274
This commit is contained in:
LukeGus committed 2026-09-20 18:17:29 -05:00
1 parent 6ce5e78165
commit d0c25cf183
7 files changed
+46 -1

No files matched your search

@@ -26,6 +26,7 @@ describe("defaultHostSidebarPreferences", () => {
trayTrigger: "always",
statusColorScheme: "accent",
openOnDoubleClick: false,
showFolderPaths: true,
},
});
});
@@ -63,6 +64,7 @@ describe("sanitizeHostSidebarPreferences", () => {
trayTrigger: "click",
statusColorScheme: "status",
openOnDoubleClick: true,
showFolderPaths: false,
},
};
expect(sanitizeHostSidebarPreferences(valid)).toEqual(valid);
@@ -78,6 +80,16 @@ describe("sanitizeHostSidebarPreferences", () => {
).toBe(false);
});
it("defaults showFolderPaths to true when missing or not a boolean", () => {
expect(
sanitizeHostSidebarPreferences({ display: {} }).display.showFolderPaths,
).toBe(true);
expect(
sanitizeHostSidebarPreferences({ display: { showFolderPaths: "no" } })
.display.showFolderPaths,
).toBe(true);
});
it("falls back to defaults for invalid enum values", () => {
const result = sanitizeHostSidebarPreferences({
sort: { key: "not-a-real-key", pinnedFirst: "yes" },