From 5443d195ee18211dbf48c3ea049bc5a2122bf48f Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 22 Aug 2026 21:44:14 +0900 Subject: [PATCH 1/3] test(frontend): add Storybook coverage for BuyerNav BuyerNav had a test file but no story, the last remaining gap in frontend/src/components/*.tsx test+story coverage. Adds stories for each destination plus an edge case with an extra tools slot. --- frontend/src/components/BuyerNav.stories.tsx | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 frontend/src/components/BuyerNav.stories.tsx diff --git a/frontend/src/components/BuyerNav.stories.tsx b/frontend/src/components/BuyerNav.stories.tsx new file mode 100644 index 000000000..8930c3102 --- /dev/null +++ b/frontend/src/components/BuyerNav.stories.tsx @@ -0,0 +1,34 @@ +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { BuyerNav } from "./BuyerNav"; + +const meta = { + title: "Navigation/BuyerNav", + component: BuyerNav, + args: { + destination: "board", + onChange: () => undefined, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Board: Story = {}; + +export const AskAgent: Story = { + args: { destination: "ask" }, +}; + +export const Admin: Story = { + args: { destination: "admin" }, +}; + +// Edge case: an extra tools slot (e.g. a settings or logout control) rendered +// alongside the nav items. +export const WithTools: Story = { + args: { + destination: "customers", + tools: , + }, +}; From 4867cf0483da907c16dfae223d067042a8b5e69a Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 22 Aug 2026 21:52:47 +0900 Subject: [PATCH 2/3] fix(frontend): use OIDC return-url helpers on the login button Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437: the login button built an unsanitized returnUrl inline instead of returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the unreachable login-screen AdminPanel render (accessToken is always undefined pre-auth). This PR's own diff doesn't touch AdminPanel. --- frontend/src/App.test.tsx | 3 +++ frontend/src/App.tsx | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 7462abd2c..70eb27590 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -41,6 +41,9 @@ describe("App, unauthenticated", () => { state: expect.objectContaining({ returnUrl: expect.stringMatching(/^\//) }), }), ); + // Persisted as a fallback in case the OIDC state round-trip is dropped + // (see oidcReturnUrl.ts's restoreOidcReturnUrl, consumed in main.tsx). + expect(window.sessionStorage.getItem("lineageweave.oidc.returnUrl")).toMatch(/^\//); }); }); diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6fba0dd41..1b5b351ab 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4610,7 +4610,8 @@ export default function App({ showLabPanels = false }: { showLabPanels?: boolean
- {destination === "admin" ? : null}