Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions e2e/history.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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'
Expand All @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions e2e/public-performance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions e2e/resume-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
});
19 changes: 12 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,18 @@ export default function RootLayout({
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
<AnalyticsProvider>
<AuthProvider>
<WorkspaceShell>{children}</WorkspaceShell>
<footer className="border-t border-border/60 px-6 py-6 text-sm text-muted-foreground">
<SaaSMakerFeedback />
<div className="mx-auto flex max-w-6xl items-center justify-between gap-4">
<span>RolePatch</span>
</div>
</footer>
<WorkspaceShell
publicFooter={
<footer className="border-t border-border/60 px-6 py-6 text-sm text-muted-foreground">
<SaaSMakerFeedback />
<div className="mx-auto flex max-w-6xl items-center justify-between gap-4">
<span>RolePatch</span>
</div>
</footer>
}
>
{children}
</WorkspaceShell>
</AuthProvider>
<VitalsReporter />
</AnalyticsProvider>
Expand Down
9 changes: 8 additions & 1 deletion src/components/workspace-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -89,6 +95,7 @@ export function WorkspaceShell({ children }: { children: ReactNode }) {
<>
{pathname !== '/sign-in' && <SiteNav />}
{children}
{!isWorkspacePath(pathname) && publicFooter}
</>
)}
</>
Expand Down
Loading