Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

feat(nav): link to the help documentation from the account menu (#1245)

Tássio Noronhadccf92fed92b
diff --git a/frontend/src/components/workspace-switcher.test.tsx b/frontend/src/components/workspace-switcher.test.tsx
new file mode 100644
index 00000000..5a3edeb4
--- /dev/null
+++ b/frontend/src/components/workspace-switcher.test.tsx
@@ -0,0 +1,55 @@
+import { screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { afterEach, expect, it, vi } from 'vitest'
+
+import { DOCS_URL, WorkspaceSwitcher } from '@/components/workspace-switcher'
+import { renderWithProviders, t } from '@/test/utils'
+
+const WORKSPACE = {
+ id: 'ws-1',
+ name: 'Personal',
+ kind: 'personal',
+ is_archived: false,
+ icon: 'briefcase',
+ color: '#6366F1',
+ role: 'owner',
+}
+
+vi.mock('@/contexts/workspace-context', () => ({
+ useWorkspace: () => ({
+ current: WORKSPACE,
+ workspaces: [WORKSPACE],
+ switchWorkspace: vi.fn(),
+ refresh: vi.fn(),
+ }),
+}))
+
+vi.mock('@/contexts/auth-context', () => ({
+ useAuth: () => ({
+ user: { id: 'user-1', email: '[email protected]', is_superuser: false, is_2fa_enabled: false },
+ logout: vi.fn(),
+ }),
+}))
+
+afterEach(() => vi.restoreAllMocks())
+
+it('opens the help documentation in a new tab from the account menu', async () => {
+ const open = vi.spyOn(window, 'open').mockImplementation(() => null)
+ const user = userEvent.setup()
+ renderWithProviders(
+ <WorkspaceSwitcher
+ onChangePassword={vi.fn()}
+ onTwoFactor={vi.fn()}
+ onPasskeys={vi.fn()}
+ onBackup={vi.fn()}
+ onUpdateAvailable={vi.fn()}
+ agentsEnabled={false}
+ localAuthEnabled
+ />,
+ )
+
+ await user.click(screen.getByRole('button', { name: /Personal/ }))
+ await user.click(await screen.findByRole('menuitem', { name: t('nav.documentation') }))
+
+ expect(open).toHaveBeenCalledWith(DOCS_URL, '_blank', 'noopener,noreferrer')
+})
diff --git a/frontend/src/components/workspace-switcher.tsx b/frontend/src/components/workspace-switcher.tsx
index f68ed8b4..767fbe3f 100644
--- a/frontend/src/components/workspace-switcher.tsx
+++ b/frontend/src/components/workspace-switcher.tsx
@@ -32,6 +32,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog'
import {
+ BookOpen,
Check,
ChevronsUpDown,
Download,
@@ -64,6 +65,9 @@ const ROLE_LABEL_KEY: Record<string, string> = {
// Fallback when a workspace hasn't set its own color yet.
const DEFAULT_COLOR = '#6366F1'
+// The help documentation, opened only when the user asks for it.
+export const DOCS_URL = 'https://docs.usesecuro.com'
+
function workspaceIcon(w: Workspace): string {
return w.icon || WORKSPACE_KIND_ICON[w.kind as WorkspaceKind] || 'briefcase'
}
@@ -294,6 +298,13 @@ export function WorkspaceSwitcher({
<Download size={14} />
{t('update.menuItem')}
</DropdownMenuItem>
+ <DropdownMenuItem
+ onClick={() => window.open(DOCS_URL, '_blank', 'noopener,noreferrer')}
+ className="flex items-center gap-2"
+ >
+ <BookOpen size={14} />
+ {t('nav.documentation')}
+ </DropdownMenuItem>
{/* Language sub-menu */}
<DropdownMenuSub>
diff --git a/frontend/src/locales/cs.json b/frontend/src/locales/cs.json
index dfe841e4..53db7573 100644
--- a/frontend/src/locales/cs.json
+++ b/frontend/src/locales/cs.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Agenti",
"aiAgents": "AI agenti",
+ "documentation": "Dokumentace",
"collapseSidebar": "Sbalit boční panel",
"expandSidebar": "Rozbalit boční panel"
},
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index e7cc3383..0ce00e6b 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -131,6 +131,7 @@
"groupAgents": "KI",
"agents": "Agenten",
"aiAgents": "KI-Agenten",
+ "documentation": "Dokumentation",
"collapseSidebar": "Seitenleiste einklappen",
"expandSidebar": "Seitenleiste ausklappen"
},
diff --git a/frontend/src/locales/el.json b/frontend/src/locales/el.json
index f5458e0b..d9a5d51b 100644
--- a/frontend/src/locales/el.json
+++ b/frontend/src/locales/el.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Βοηθοί",
"aiAgents": "Βοηθοί AI",
+ "documentation": "Τεκμηρίωση",
"collapseSidebar": "Σύμπτυξη πλευρικής γραμμής",
"expandSidebar": "Ανάπτυξη πλευρικής γραμμής"
},
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index ca1a3b04..014c9544 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Agents",
"aiAgents": "AI Agents",
+ "documentation": "Documentation",
"collapseSidebar": "Collapse sidebar",
"expandSidebar": "Expand sidebar"
},
diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json
index 0de0fdf3..e996b85c 100644
--- a/frontend/src/locales/es.json
+++ b/frontend/src/locales/es.json
@@ -131,6 +131,7 @@
"groupAgents": "IA",
"agents": "Agentes",
"aiAgents": "Agentes IA",
+ "documentation": "Documentación",
"collapseSidebar": "Contraer barra lateral",
"expandSidebar": "Expandir barra lateral"
},
diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json
index 694305e2..d19bb396 100644
--- a/frontend/src/locales/fr.json
+++ b/frontend/src/locales/fr.json
@@ -131,6 +131,7 @@
"groupAgents": "IA",
"agents": "Agents",
"aiAgents": "Agents IA",
+ "documentation": "Documentation",
"collapseSidebar": "Réduire la barre latérale",
"expandSidebar": "Développer la barre latérale"
},
diff --git a/frontend/src/locales/hi.json b/frontend/src/locales/hi.json
index 77925a17..9c693969 100644
--- a/frontend/src/locales/hi.json
+++ b/frontend/src/locales/hi.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "एजेंट",
"aiAgents": "AI एजेंट",
+ "documentation": "दस्तावेज़",
"collapseSidebar": "साइडबार छोटा करें",
"expandSidebar": "साइडबार बड़ा करें"
},
diff --git a/frontend/src/locales/hu.json b/frontend/src/locales/hu.json
index fb1fc441..bb587f4c 100644
--- a/frontend/src/locales/hu.json
+++ b/frontend/src/locales/hu.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Ügynökök",
"aiAgents": "AI-ügynökök",
+ "documentation": "Dokumentáció",
"collapseSidebar": "Oldalsáv összecsukása",
"expandSidebar": "Oldalsáv kinyitása"
},
diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json
index 546664b9..91e9f750 100644
--- a/frontend/src/locales/it.json
+++ b/frontend/src/locales/it.json
@@ -131,6 +131,7 @@
"groupAgents": "IA",
"agents": "Agenti",
"aiAgents": "Agenti IA",
+ "documentation": "Documentazione",
"collapseSidebar": "Riduci barra laterale",
"expandSidebar": "Espandi barra laterale"
},
diff --git a/frontend/src/locales/ja.json b/frontend/src/locales/ja.json
index 0efc0f78..11fad15e 100644
--- a/frontend/src/locales/ja.json
+++ b/frontend/src/locales/ja.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "エージェント",
"aiAgents": "AIエージェント",
+ "documentation": "ドキュメント",
"collapseSidebar": "サイドバーを折りたたむ",
"expandSidebar": "サイドバーを展開する"
},
diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json
index 68466900..88c4b7db 100644
--- a/frontend/src/locales/nl.json
+++ b/frontend/src/locales/nl.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Agents",
"aiAgents": "AI-agents",
+ "documentation": "Documentatie",
"collapseSidebar": "Zijbalk inklappen",
"expandSidebar": "Zijbalk uitklappen"
},
diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json
index 186a4c9f..1db10232 100644
--- a/frontend/src/locales/pl.json
+++ b/frontend/src/locales/pl.json
@@ -130,6 +130,7 @@
"groupAgents": "AI",
"agents": "Agenci",
"aiAgents": "Agenci AI",
+ "documentation": "Dokumentacja",
"collapseSidebar": "Zwiń pasek boczny",
"expandSidebar": "Rozwiń pasek boczny",
"collections": "Kolekcje"
diff --git a/frontend/src/locales/pt-BR.json b/frontend/src/locales/pt-BR.json
index f4285546..d70e2358 100644
--- a/frontend/src/locales/pt-BR.json
+++ b/frontend/src/locales/pt-BR.json
@@ -131,6 +131,7 @@
"groupAgents": "IA",
"agents": "Agentes",
"aiAgents": "Agentes IA",
+ "documentation": "Documentação",
"collapseSidebar": "Recolher barra lateral",
"expandSidebar": "Expandir barra lateral"
},
diff --git a/frontend/src/locales/pt-PT.json b/frontend/src/locales/pt-PT.json
index 623aef91..db384ff7 100644
--- a/frontend/src/locales/pt-PT.json
+++ b/frontend/src/locales/pt-PT.json
@@ -131,6 +131,7 @@
"groupAgents": "IA",
"agents": "Agentes",
"aiAgents": "Agentes de IA",
+ "documentation": "Documentação",
"collapseSidebar": "Recolher barra lateral",
"expandSidebar": "Expandir barra lateral"
},
diff --git a/frontend/src/locales/ru.json b/frontend/src/locales/ru.json
index 9bc95fbe..717d9b10 100644
--- a/frontend/src/locales/ru.json
+++ b/frontend/src/locales/ru.json
@@ -131,6 +131,7 @@
"groupAgents": "ИИ",
"agents": "Агенты",
"aiAgents": "ИИ-агенты",
+ "documentation": "Документация",
"collapseSidebar": "Свернуть боковую панель",
"expandSidebar": "Развернуть боковую панель"
},
diff --git a/frontend/src/locales/sk.json b/frontend/src/locales/sk.json
index a2656ee4..48a2a9fb 100644
--- a/frontend/src/locales/sk.json
+++ b/frontend/src/locales/sk.json
@@ -131,6 +131,7 @@
"groupAgents": "AI",
"agents": "Agenti",
"aiAgents": "AI agenti",
+ "documentation": "Dokumentácia",
"collapseSidebar": "Zbaliť bočný panel",
"expandSidebar": "Rozbaliť bočný panel"
},
diff --git a/frontend/src/locales/uk.json b/frontend/src/locales/uk.json
index c111c3be..b1470e01 100644
--- a/frontend/src/locales/uk.json
+++ b/frontend/src/locales/uk.json
@@ -131,6 +131,7 @@
"groupAgents": "ШІ",
"agents": "Агенти",
"aiAgents": "ШІ-агенти",
+ "documentation": "Документація",
"collapseSidebar": "Згорнути бічну панель",
"expandSidebar": "Розгорнути бічну панель"
},