From 31bde0e31dd63cb6e35999e165b6ab279f38eafd Mon Sep 17 00:00:00 2001 From: Sarthak Agrawal Date: Fri, 27 Nov 2026 17:34:08 +0530 Subject: [PATCH] Keep the public feedback footer out of the workspace --- e2e/history.spec.ts | 4 ++++ e2e/public-performance.spec.ts | 3 +++ e2e/resume-builder.spec.ts | 6 +----- src/app/layout.tsx | 19 ++++++++++++------- src/components/workspace-shell.tsx | 9 ++++++++- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/e2e/history.spec.ts b/e2e/history.spec.ts index 1ab593b..19ba3af 100644 --- a/e2e/history.spec.ts +++ b/e2e/history.spec.ts @@ -151,6 +151,8 @@ test('the workspace has three visible page links and History is a separate page' page, }) => { await page.goto('/jobs'); + const footer = page.getByRole('contentinfo'); + await expect(footer).toHaveCount(0); const navigation = page.getByRole('navigation', { name: 'Primary', exact: true }); await expect(navigation.getByRole('link')).toHaveCount(3); await expect(navigation.getByRole('link', { name: 'Jobs', exact: true })).toHaveAttribute( @@ -162,6 +164,7 @@ test('the workspace has three visible page links and History is a separate page' await navigation.getByRole('link', { name: 'History', exact: true }).click(); await expect(page).toHaveURL(/\/history$/); await expect(page.getByRole('heading', { name: 'History', exact: true })).toBeVisible(); + await expect(footer).toHaveCount(0); await expect(navigation.getByRole('link', { name: 'History', exact: true })).toHaveAttribute( 'aria-current', 'page' @@ -173,6 +176,7 @@ test('the workspace has three visible page links and History is a separate page' await navigation.getByRole('link', { name: 'Resume Builder', exact: true }).click(); await expect(page).toHaveURL(/\/resume-builder$/); await expect(page.getByRole('heading', { name: 'Resume Builder', exact: true })).toBeVisible(); + await expect(footer).toHaveCount(0); await expect( navigation.getByRole('link', { name: 'Resume Builder', exact: true }) ).toHaveAttribute('aria-current', 'page'); diff --git a/e2e/public-performance.spec.ts b/e2e/public-performance.spec.ts index ffdc847..fa23a9d 100644 --- a/e2e/public-performance.spec.ts +++ b/e2e/public-performance.spec.ts @@ -41,6 +41,9 @@ for (const route of ['/pricing', '/tools']) { await page.setViewportSize({ width: 390, height: 844 }); await page.goto(route); await expect(page.getByRole('heading', { level: 1 })).toBeVisible(); + await expect( + page.getByRole('contentinfo').getByRole('heading', { name: 'Help shape RolePatch.' }) + ).toBeVisible(); await expect(page.getByRole('button', { name: 'Sign in', exact: true })).toBeEnabled(); await page.getByRole('button', { name: 'Open menu' }).click(); await expect(page.getByRole('button', { name: 'Close menu' })).toHaveAttribute( diff --git a/e2e/resume-builder.spec.ts b/e2e/resume-builder.spec.ts index 4361899..ccba553 100644 --- a/e2e/resume-builder.spec.ts +++ b/e2e/resume-builder.spec.ts @@ -144,13 +144,11 @@ test('Outline edits, pins and added projects survive reload and legacy links ope } }); -test('appearance persists and portal inputs follow Dark, Light and System without changing the footer', async ({ +test('appearance persists and portal inputs follow Dark, Light and System', async ({ page, }, testInfo) => { await page.goto('/resume-builder'); const workspace = page.locator('.rolepatch-workspace').first(); - const footer = page.getByRole('contentinfo'); - const footerColor = await footer.evaluate((element) => getComputedStyle(element).color); await page.getByRole('radio', { name: 'Light', exact: true }).click(); await page.getByRole('radio', { name: 'Dark', exact: true }).click(); await expect(workspace).toHaveAttribute('data-workspace-theme', 'dark'); @@ -178,6 +176,4 @@ test('appearance persists and portal inputs follow Dark, Light and System withou await expect(workspace).toHaveAttribute('data-workspace-theme', 'dark'); await page.emulateMedia({ colorScheme: 'light' }); await expect(workspace).toHaveAttribute('data-workspace-theme', 'light'); - await expect(footer).toHaveCSS('color', footerColor); - await expect(footer.getByRole('heading', { name: 'Help shape RolePatch.' })).toBeVisible(); }); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ff886be..8370285 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -133,13 +133,18 @@ export default function RootLayout({ - {children} -
- -
- RolePatch -
-
+ + +
+ RolePatch +
+ + } + > + {children} +
diff --git a/src/components/workspace-shell.tsx b/src/components/workspace-shell.tsx index 23f8d72..0a0ebf7 100644 --- a/src/components/workspace-shell.tsx +++ b/src/components/workspace-shell.tsx @@ -37,7 +37,13 @@ function useEndedWorkspaceSession(pathname: string) { return sessionEnded; } -export function WorkspaceShell({ children }: { children: ReactNode }) { +export function WorkspaceShell({ + children, + publicFooter, +}: { + children: ReactNode; + publicFooter: ReactNode; +}) { const pathname = usePathname() ?? ''; const router = useRouter(); const sessionEnded = useEndedWorkspaceSession(pathname); @@ -89,6 +95,7 @@ export function WorkspaceShell({ children }: { children: ReactNode }) { <> {pathname !== '/sign-in' && } {children} + {!isWorkspacePath(pathname) && publicFooter} )}