mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: Sidebar host click should focus existing tab instead of opening a new connection (#1289)
https://github.com/Termix-SSH/Support/issues/1289
This commit is contained in:
1 parent
f8a8139031
commit
afae2889cb
9 files changed
+109
-12
No files matched your search
@@ -27,6 +27,7 @@ describe("defaultHostSidebarPreferences", () => {
|
||||
statusColorScheme: "accent",
|
||||
openOnDoubleClick: false,
|
||||
showFolderPaths: true,
|
||||
focusExistingTab: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -65,6 +66,7 @@ describe("sanitizeHostSidebarPreferences", () => {
|
||||
statusColorScheme: "status",
|
||||
openOnDoubleClick: true,
|
||||
showFolderPaths: false,
|
||||
focusExistingTab: false,
|
||||
},
|
||||
};
|
||||
expect(sanitizeHostSidebarPreferences(valid)).toEqual(valid);
|
||||
@@ -90,6 +92,16 @@ describe("sanitizeHostSidebarPreferences", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("defaults focusExistingTab to true when missing or not a boolean", () => {
|
||||
expect(
|
||||
sanitizeHostSidebarPreferences({ display: {} }).display.focusExistingTab,
|
||||
).toBe(true);
|
||||
expect(
|
||||
sanitizeHostSidebarPreferences({ display: { focusExistingTab: "no" } })
|
||||
.display.focusExistingTab,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("falls back to defaults for invalid enum values", () => {
|
||||
const result = sanitizeHostSidebarPreferences({
|
||||
sort: { key: "not-a-real-key", pinnedFirst: "yes" },
|
||||
|
||||
Reference in new issue
Block a user