Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

feat(dashboard): accordion sidebar + OmniProxy section + pin behavior

diegosouzapwa5f33017fdc7
diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json
index 3034e3752c..63876ae8d8 100644
--- a/src/i18n/messages/ar.json
+++ b/src/i18n/messages/ar.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/bg.json b/src/i18n/messages/bg.json
index 5942c1ded3..5d75f585ec 100644
--- a/src/i18n/messages/bg.json
+++ b/src/i18n/messages/bg.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/bn.json b/src/i18n/messages/bn.json
index 09c249ad00..4e4c8b8971 100644
--- a/src/i18n/messages/bn.json
+++ b/src/i18n/messages/bn.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/cs.json b/src/i18n/messages/cs.json
index b644275721..be1233bbce 100644
--- a/src/i18n/messages/cs.json
+++ b/src/i18n/messages/cs.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/da.json b/src/i18n/messages/da.json
index e70a96142f..2a30990d8c 100644
--- a/src/i18n/messages/da.json
+++ b/src/i18n/messages/da.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json
index 2541847721..4210750080 100644
--- a/src/i18n/messages/de.json
+++ b/src/i18n/messages/de.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index 0d22c7cd43..5bfc743521 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -778,7 +778,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "Webhooks",
diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json
index 2d5110c8b5..9f6f5c5a9b 100644
--- a/src/i18n/messages/es.json
+++ b/src/i18n/messages/es.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/fa.json b/src/i18n/messages/fa.json
index 57a35d96e1..fd1a44cdc4 100644
--- a/src/i18n/messages/fa.json
+++ b/src/i18n/messages/fa.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/fi.json b/src/i18n/messages/fi.json
index b2615ee5ba..6f4d9957d3 100644
--- a/src/i18n/messages/fi.json
+++ b/src/i18n/messages/fi.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json
index 6398dc61c0..2cf9df9ca0 100644
--- a/src/i18n/messages/fr.json
+++ b/src/i18n/messages/fr.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/gu.json b/src/i18n/messages/gu.json
index 980d534517..f6f7ea3937 100644
--- a/src/i18n/messages/gu.json
+++ b/src/i18n/messages/gu.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/he.json b/src/i18n/messages/he.json
index d1a846d4bd..7902a242e9 100644
--- a/src/i18n/messages/he.json
+++ b/src/i18n/messages/he.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/hi.json b/src/i18n/messages/hi.json
index e6c04a9b74..9630d1056b 100644
--- a/src/i18n/messages/hi.json
+++ b/src/i18n/messages/hi.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/hu.json b/src/i18n/messages/hu.json
index 6426b56b1d..27a96826ae 100644
--- a/src/i18n/messages/hu.json
+++ b/src/i18n/messages/hu.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/id.json b/src/i18n/messages/id.json
index 11beaa6ecc..89fca0b651 100644
--- a/src/i18n/messages/id.json
+++ b/src/i18n/messages/id.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/in.json b/src/i18n/messages/in.json
index 7e0f038e4a..726c9ae1e1 100644
--- a/src/i18n/messages/in.json
+++ b/src/i18n/messages/in.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/it.json b/src/i18n/messages/it.json
index e3ee81d40e..7d633bae31 100644
--- a/src/i18n/messages/it.json
+++ b/src/i18n/messages/it.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json
index 9cfe229a7c..0079677ad4 100644
--- a/src/i18n/messages/ja.json
+++ b/src/i18n/messages/ja.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json
index 1f53d8403d..2855e2b348 100644
--- a/src/i18n/messages/ko.json
+++ b/src/i18n/messages/ko.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/mr.json b/src/i18n/messages/mr.json
index b9c61e4bdb..c79314fe08 100644
--- a/src/i18n/messages/mr.json
+++ b/src/i18n/messages/mr.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ms.json b/src/i18n/messages/ms.json
index d34f6abb2e..c449dd0d10 100644
--- a/src/i18n/messages/ms.json
+++ b/src/i18n/messages/ms.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/nl.json b/src/i18n/messages/nl.json
index 07dd6d99d4..fda0e7c651 100644
--- a/src/i18n/messages/nl.json
+++ b/src/i18n/messages/nl.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/no.json b/src/i18n/messages/no.json
index c6168f536d..deaf3991ef 100644
--- a/src/i18n/messages/no.json
+++ b/src/i18n/messages/no.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/phi.json b/src/i18n/messages/phi.json
index 1dcf6ae5ee..3bfaae2938 100644
--- a/src/i18n/messages/phi.json
+++ b/src/i18n/messages/phi.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/pl.json b/src/i18n/messages/pl.json
index a5bf5324e9..3efdf8610d 100644
--- a/src/i18n/messages/pl.json
+++ b/src/i18n/messages/pl.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/pt-BR.json b/src/i18n/messages/pt-BR.json
index 097a06d3fc..aa15a6ae6f 100644
--- a/src/i18n/messages/pt-BR.json
+++ b/src/i18n/messages/pt-BR.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json
index 888b0ce547..b6d31dff58 100644
--- a/src/i18n/messages/pt.json
+++ b/src/i18n/messages/pt.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ro.json b/src/i18n/messages/ro.json
index 1eb75bddb2..58de5e75e3 100644
--- a/src/i18n/messages/ro.json
+++ b/src/i18n/messages/ro.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json
index a1d132fb79..d37aa14d74 100644
--- a/src/i18n/messages/ru.json
+++ b/src/i18n/messages/ru.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/sk.json b/src/i18n/messages/sk.json
index afe15949f4..60fe939660 100644
--- a/src/i18n/messages/sk.json
+++ b/src/i18n/messages/sk.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/sv.json b/src/i18n/messages/sv.json
index 2191aec0db..da793201f1 100644
--- a/src/i18n/messages/sv.json
+++ b/src/i18n/messages/sv.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/sw.json b/src/i18n/messages/sw.json
index 7e0f038e4a..726c9ae1e1 100644
--- a/src/i18n/messages/sw.json
+++ b/src/i18n/messages/sw.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ta.json b/src/i18n/messages/ta.json
index 13ca01c095..4001cae94b 100644
--- a/src/i18n/messages/ta.json
+++ b/src/i18n/messages/ta.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/te.json b/src/i18n/messages/te.json
index 638b487f17..f4a3a5980c 100644
--- a/src/i18n/messages/te.json
+++ b/src/i18n/messages/te.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/th.json b/src/i18n/messages/th.json
index 2b71955068..1404784a48 100644
--- a/src/i18n/messages/th.json
+++ b/src/i18n/messages/th.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/tr.json b/src/i18n/messages/tr.json
index 58fb17521b..e93e70353f 100644
--- a/src/i18n/messages/tr.json
+++ b/src/i18n/messages/tr.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/uk-UA.json b/src/i18n/messages/uk-UA.json
index cd098f2c5c..a6c70af804 100644
--- a/src/i18n/messages/uk-UA.json
+++ b/src/i18n/messages/uk-UA.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/ur.json b/src/i18n/messages/ur.json
index c9dde2bbfa..d98c4e39cc 100644
--- a/src/i18n/messages/ur.json
+++ b/src/i18n/messages/ur.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/vi.json b/src/i18n/messages/vi.json
index efe0026965..81153bfbeb 100644
--- a/src/i18n/messages/vi.json
+++ b/src/i18n/messages/vi.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "__MISSING__:Webhooks",
diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json
index ce0ecb2f97..f2c5d8c166 100644
--- a/src/i18n/messages/zh-CN.json
+++ b/src/i18n/messages/zh-CN.json
@@ -776,7 +776,8 @@
"settingsSecurity": "Security",
"settingsRouting": "Routing",
"settingsResilience": "Resilience",
- "settingsAdvanced": "Advanced"
+ "settingsAdvanced": "Advanced",
+ "omniProxySection": "OmniProxy"
},
"webhooks": {
"title": "Webhook",
diff --git a/src/shared/components/Sidebar.tsx b/src/shared/components/Sidebar.tsx
index a045108ac3..7fae857820 100644
--- a/src/shared/components/Sidebar.tsx
+++ b/src/shared/components/Sidebar.tsx
@@ -22,6 +22,7 @@ import {
const isE2EMode = process.env.NEXT_PUBLIC_OMNIROUTE_E2E_MODE === "1";
const DEFAULT_EXPANDED: SidebarSectionId = "routing";
const EXPANDED_SECTIONS_KEY = "sidebar-expanded-sections";
+const PINNED_SECTIONS_KEY = "sidebar-pinned-sections";
type SidebarProps = {
onClose?: () => void;
@@ -32,6 +33,23 @@ type SidebarProps = {
type HoveredItem = { id: string; label: string; x: number; y: number } | null;
+function loadFromStorage<T>(key: string, fallback: T): T {
+ try {
+ const stored = localStorage.getItem(key);
+ if (stored) {
+ const parsed = JSON.parse(stored);
+ if (Array.isArray(parsed)) return parsed as T;
+ }
+ } catch {}
+ return fallback;
+}
+
+function saveToStorage(key: string, value: unknown) {
+ try {
+ localStorage.setItem(key, JSON.stringify(value));
+ } catch {}
+}
+
export default function Sidebar({
onClose,
collapsed = false,
@@ -54,23 +72,17 @@ export default function Sidebar({
const [expandedSections, setExpandedSections] = useState<Set<SidebarSectionId>>(
new Set([DEFAULT_EXPANDED])
);
+ const [pinnedSections, setPinnedSections] = useState<Set<SidebarSectionId>>(new Set());
const [hoveredItem, setHoveredItem] = useState<HoveredItem>(null);
- // Load persisted expanded sections on mount
+ // Load persisted state on mount
useEffect(() => {
- try {
- const stored = localStorage.getItem(EXPANDED_SECTIONS_KEY);
- if (stored) {
- const parsed = JSON.parse(stored) as SidebarSectionId[];
- if (Array.isArray(parsed) && parsed.length > 0) {
- setExpandedSections(new Set(parsed));
- return;
- }
- }
- } catch {
- // ignore parse errors
- }
- setExpandedSections(new Set([DEFAULT_EXPANDED]));
+ const storedExpanded = loadFromStorage<SidebarSectionId[]>(EXPANDED_SECTIONS_KEY, [
+ DEFAULT_EXPANDED,
+ ]);
+ const storedPinned = loadFromStorage<SidebarSectionId[]>(PINNED_SECTIONS_KEY, []);
+ setExpandedSections(new Set(storedExpanded.length > 0 ? storedExpanded : [DEFAULT_EXPANDED]));
+ setPinnedSections(new Set(storedPinned));
}, []);
useEffect(() => {
@@ -88,21 +100,13 @@ export default function Sidebar({
const handleSettingsUpdated = (event: Event) => {
const detail = (event as CustomEvent<Record<string, unknown>>).detail || {};
-
- if ("debugMode" in detail) {
- setShowDebug(detail.debugMode === true);
- }
-
+ if ("debugMode" in detail) setShowDebug(detail.debugMode === true);
if (HIDDEN_SIDEBAR_ITEMS_SETTING_KEY in detail) {
setHiddenSidebarItems(
normalizeHiddenSidebarItems(detail[HIDDEN_SIDEBAR_ITEMS_SETTING_KEY])
);
}
-
- if ("instanceName" in detail) {
- setCustomAppName((detail.instanceName as string) || null);
- }
-
+ if ("instanceName" in detail) setCustomAppName((detail.instanceName as string) || null);
if ("customLogoBase64" in detail) {
setCustomLogo((detail.customLogoBase64 as string) || null);
} else if ("customLogoUrl" in detail) {
@@ -111,13 +115,11 @@ export default function Sidebar({
};
window.addEventListener(SIDEBAR_SETTINGS_UPDATED_EVENT, handleSettingsUpdated as EventListener);
-
- return () => {
+ return () =>
window.removeEventListener(
SIDEBAR_SETTINGS_UPDATED_EVENT,
handleSettingsUpdated as EventListener
);
- };
}, []);
const getSidebarLabel = (key: string, fallback: string) =>
@@ -141,7 +143,7 @@ export default function Sidebar({
visibleSections.flatMap((section) => section.items)
);
- // Auto-expand the section containing the active page
+ // Auto-expand the section containing the active page (without closing others)
useEffect(() => {
if (collapsed) return;
for (const section of visibleSections) {
@@ -150,9 +152,7 @@ export default function Sidebar({
if (prev.has(section.id as SidebarSectionId)) return prev;
const next = new Set(prev);
next.add(section.id as SidebarSectionId);
- try {
- localStorage.setItem(EXPANDED_SECTIONS_KEY, JSON.stringify([...next]));
- } catch {}
+ saveToStorage(EXPANDED_SECTIONS_KEY, [...next]);
return next;
});
break;
@@ -161,17 +161,48 @@ export default function Sidebar({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeHref, collapsed]);
- const toggleSection = useCallback((sectionId: SidebarSectionId) => {
- setExpandedSections((prev) => {
+ // Accordion toggle: opening a section closes all non-pinned sections
+ const toggleSection = useCallback(
+ (sectionId: SidebarSectionId) => {
+ setExpandedSections((prev) => {
+ const isOpen = prev.has(sectionId);
+ let next: Set<SidebarSectionId>;
+ if (isOpen) {
+ // Close this section
+ next = new Set(prev);
+ next.delete(sectionId);
+ } else {
+ // Accordion: keep only pinned sections + the new one
+ next = new Set<SidebarSectionId>();
+ for (const id of pinnedSections) {
+ next.add(id);
+ }
+ next.add(sectionId);
+ }
+ saveToStorage(EXPANDED_SECTIONS_KEY, [...next]);
+ return next;
+ });
+ },
+ [pinnedSections]
+ );
+
+ const togglePin = useCallback((sectionId: SidebarSectionId) => {
+ setPinnedSections((prev) => {
const next = new Set(prev);
if (next.has(sectionId)) {
next.delete(sectionId);
} else {
next.add(sectionId);
+ // Ensure the section is expanded when pinned
+ setExpandedSections((prevExp) => {
+ if (prevExp.has(sectionId)) return prevExp;
+ const nextExp = new Set(prevExp);
+ nextExp.add(sectionId);
+ saveToStorage(EXPANDED_SECTIONS_KEY, [...nextExp]);
+ return nextExp;
+ });
}
- try {
- localStorage.setItem(EXPANDED_SECTIONS_KEY, JSON.stringify([...next]));
- } catch {}
+ saveToStorage(PINNED_SECTIONS_KEY, [...next]);
return next;
});
}, []);
@@ -181,7 +212,7 @@ export default function Sidebar({
try {
await fetch("/api/shutdown", { method: "POST" });
} catch (e) {
- // Expected to fail as server shuts down; ignore error
+ // Expected to fail as server shuts down
}
setIsShuttingDown(false);
setShowShutdownModal(false);
@@ -198,9 +229,7 @@ export default function Sidebar({
setIsRestarting(false);
setShowRestartModal(false);
setIsDisconnected(true);
- setTimeout(() => {
- globalThis.location.reload();
- }, 3000);
+ setTimeout(() => globalThis.location.reload(), 3000);
};
const handleMouseEnter = useCallback(
@@ -218,9 +247,7 @@ export default function Sidebar({
[collapsed]
);
- const handleMouseLeave = useCallback(() => {
- setHoveredItem(null);
- }, []);
+ const handleMouseLeave = useCallback(() => setHoveredItem(null), []);
const renderNavLink = (item) => {
const active = !item.external && activeHref === item.href;
@@ -241,7 +268,6 @@ export default function Sidebar({
{!collapsed && <span className="text-sm font-medium truncate">{item.label}</span>}
</>
);
-
const sharedProps = {
onMouseEnter: (e: React.MouseEvent<HTMLElement>) => handleMouseEnter(e, item.id, item.label),
onMouseLeave: handleMouseLeave,
@@ -284,9 +310,7 @@ export default function Sidebar({
"flex h-full min-h-0 flex-col border-r border-black/5 bg-sidebar transition-all duration-300 ease-in-out dark:border-white/5",
collapsed ? "w-16" : "w-[220px]"
)}
- style={{
- paddingTop: isMacElectron ? "var(--desktop-safe-top)" : undefined,
- }}
+ style={{ paddingTop: isMacElectron ? "var(--desktop-safe-top)" : undefined }}
>
<a
href="#main-content"
@@ -294,6 +318,7 @@ export default function Sidebar({
>
Skip to content
</a>
+
{(onToggleCollapse || !isMacElectron) && (
<div
className={cn(
@@ -365,14 +390,17 @@ export default function Sidebar({
collapsed ? "px-2 space-y-0.5" : "px-3"
)}
>
- {visibleSections.map((section) => {
- const showTitle = section.showTitleInSidebar !== false;
- const isExpanded = expandedSections.has(section.id as SidebarSectionId);
+ {visibleSections.map((section, idx) => {
+ const sectionId = section.id as SidebarSectionId;
+ const isExpanded = expandedSections.has(sectionId);
+ const isPinned = pinnedSections.has(sectionId);
+ const isFirst = idx === 0;
+ // Collapsed (mini) mode: flat items with dividers
if (collapsed) {
return (
<div key={section.id}>
- {showTitle && (
+ {!isFirst && (
<div className="border-t border-black/5 dark:border-white/5 my-1.5" />
)}
{section.items.map(renderNavLink)}
@@ -380,33 +408,48 @@ export default function Sidebar({
);
}
- if (!showTitle) {
- return (
- <div key={section.id} className="space-y-0.5">
- {section.items.map(renderNavLink)}
- </div>
- );
- }
-
+ // Expanded mode: collapsible section with pin
return (
- <div key={section.id} className="mt-3">
- <button
- onClick={() => toggleSection(section.id as SidebarSectionId)}
- aria-expanded={isExpanded}
- className="w-full flex items-center justify-between px-3 py-1 rounded-md hover:bg-surface/30 transition-colors group/section"
- >
- <span className="text-[10px] font-semibold text-text-muted/60 uppercase tracking-wider">
- {section.title}
- </span>
- <span
+ <div key={section.id} className={isFirst ? "space-y-0.5" : "mt-2"}>
+ <div className="flex items-center gap-0.5 group/header">
+ <button
+ onClick={() => toggleSection(sectionId)}
+ aria-expanded={isExpanded}
+ className="flex-1 flex items-center justify-between px-3 py-1 rounded-md hover:bg-surface/30 transition-colors group/toggle"
+ >
+ <span className="text-[10px] font-semibold text-text-muted/60 uppercase tracking-wider group-hover/toggle:text-text-muted/90 transition-colors">
+ {section.title}
+ </span>
+ <span
+ className={cn(
+ "material-symbols-outlined text-[14px] text-text-muted/40 transition-all duration-200 group-hover/toggle:text-text-muted/70",
+ isExpanded && "rotate-180"
+ )}
+ >
+ expand_more
+ </span>
+ </button>
+
+ {/* Pin button — visible on hover or when pinned */}
+ <button
+ onClick={() => togglePin(sectionId)}
+ title={isPinned ? "Unpin section" : "Pin section open"}
className={cn(
- "material-symbols-outlined text-[14px] text-text-muted/40 transition-transform duration-200 group-hover/section:text-text-muted/70",
- isExpanded && "rotate-180"
+ "p-1 rounded-md transition-all",
+ isPinned
+ ? "text-primary opacity-100"
+ : "text-text-muted/30 opacity-0 group-hover/header:opacity-100 hover:text-text-muted/70"
)}
>
- expand_more
- </span>
- </button>
+ <span
+ className="material-symbols-outlined text-[12px]"
+ style={isPinned ? { fontVariationSettings: "'FILL' 1" } : undefined}
+ >
+ push_pin
+ </span>
+ </button>
+ </div>
+
{isExpanded && (
<div className="mt-0.5 space-y-0.5">{section.items.map(renderNavLink)}</div>
)}
@@ -453,7 +496,7 @@ export default function Sidebar({
</div>
</aside>
- {/* Styled tooltip for collapsed sidebar */}
+ {/* Styled tooltip for collapsed (mini) sidebar */}
{collapsed && hoveredItem && (
<div
className="fixed z-[200] pointer-events-none flex items-center"
diff --git a/src/shared/constants/sidebarVisibility.ts b/src/shared/constants/sidebarVisibility.ts
index 5c48a1ef72..3dd63519d4 100644
--- a/src/shared/constants/sidebarVisibility.ts
+++ b/src/shared/constants/sidebarVisibility.ts
@@ -312,10 +312,9 @@ const HELP_SIDEBAR_ITEMS: readonly SidebarItemDefinition[] = [
export const SIDEBAR_SECTIONS: readonly SidebarSectionDefinition[] = [
{
id: "routing",
- titleKey: "routingSection",
- titleFallback: "Routing",
+ titleKey: "omniProxySection",
+ titleFallback: "OmniProxy",
items: ROUTING_SIDEBAR_ITEMS,
- showTitleInSidebar: false,
},
{
id: "protocols",