mirror of
https://github.com/runbear-io/beardrive.git
synced 2026-08-25 08:08:08 +02:00
feat(web): History in the project menu, after Installation
Navigates to the existing /history route; active state follows the URL. 46/46 e2e. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VbiaaVM2ACxeRi8ySG9ybc
This commit is contained in:
co-authored by
Claude Fable 5
parent
bacb528de6
commit
317045cecb
@@ -175,6 +175,9 @@ test("project menu pages each own a URL: Dashboard, Installation, Settings", asy
|
||||
await page.waitForURL(`/${pid}/install`);
|
||||
await expect(page.locator("#crumb")).toHaveText("Installation");
|
||||
await expect(page.locator("#nav-install")).toHaveClass(/active/);
|
||||
await page.click("#nav-history");
|
||||
await page.waitForURL(`/${pid}/history`);
|
||||
await expect(page.locator("#nav-history")).toHaveClass(/active/);
|
||||
await page.click("#nav-settings");
|
||||
await page.waitForURL(`/${pid}/settings`);
|
||||
await expect(page.locator("#crumb")).toHaveText("Project settings");
|
||||
|
||||
@@ -198,9 +198,11 @@ export default function HubApp({ config }: { config: ServerConfig }) {
|
||||
? "dashboard"
|
||||
: route.view === "install"
|
||||
? "install"
|
||||
: route.view === "settings"
|
||||
? "settings"
|
||||
: null,
|
||||
: route.view === "history"
|
||||
? "history"
|
||||
: route.view === "settings"
|
||||
? "settings"
|
||||
: null,
|
||||
// Each page is a URL; explicitly close overlay panels because
|
||||
// same-path navigation doesn't change pathname.
|
||||
onDashboard: () => {
|
||||
@@ -213,6 +215,11 @@ export default function HubApp({ config }: { config: ServerConfig }) {
|
||||
navigate(urlForView("install", current.id));
|
||||
closeSidebarOnMobile();
|
||||
},
|
||||
onHistory: () => {
|
||||
setPanel(null);
|
||||
navigate(urlForView("history", current.id));
|
||||
closeSidebarOnMobile();
|
||||
},
|
||||
onSettings: () => {
|
||||
setPanel(null);
|
||||
navigate(urlForView("settings", current.id));
|
||||
|
||||
@@ -17,9 +17,10 @@ export function projColor(s: string): string {
|
||||
}
|
||||
|
||||
export interface ProjectMenu {
|
||||
active: "dashboard" | "install" | "settings" | null;
|
||||
active: "dashboard" | "install" | "history" | "settings" | null;
|
||||
onDashboard: () => void;
|
||||
onInstall: () => void;
|
||||
onHistory: () => void;
|
||||
onSettings: () => void;
|
||||
}
|
||||
|
||||
@@ -91,6 +92,7 @@ export function ProjectNav({
|
||||
[
|
||||
["dashboard", "Dashboard", "dashboard", menu.onDashboard],
|
||||
["install", "Installation", "terminal", menu.onInstall],
|
||||
["history", "History", "hist", menu.onHistory],
|
||||
["settings", "Settings", "gear", menu.onSettings],
|
||||
] as const
|
||||
).map(([key, label, icon, onClick]) => (
|
||||
|
||||
+7
-7
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>BearDrive</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🐻</text></svg>">
|
||||
<script type="module" crossorigin src="/assets/index-B9q7i7UX.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-T_RFOOBs.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C5jjBsTc.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user