Skip to content

Commit 680e6c5

Browse files
Remove scroll-container and references
1 parent 5bce8f8 commit 680e6c5

4 files changed

Lines changed: 10 additions & 18 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
# Layout & accessibility
102102

103-
- Build pages inside the shared `PageContainer`/`ContentPane` so you inherit the skip link, sticky footer, pagination target, and scroll restoration tied to `#scroll-container` (`app/layouts/helpers.tsx`, `app/hooks/use-scroll-restoration.ts`).
103+
- Build pages inside the shared `PageContainer`/`ContentPane` so you inherit the skip link, sticky footer, pagination target, and scroll restoration (`app/layouts/helpers.tsx`, `app/hooks/use-scroll-restoration.ts`).
104104
- Surface page-level buttons and pagination via the `PageActions` and `Pagination` tunnels from `tunnel-rat`; anything rendered through `.In` lands in `.Target` automatically.
105105
- For global loading states, reuse `PageSkeleton`—it keeps the MSW banner and grid layout stable, and `skipPaths` lets you opt-out for routes with custom layouts (`app/components/PageSkeleton.tsx`).
106106
- Enforce accessibility at the type level: use `AriaLabel` type from `app/ui/util/aria.ts` which requires exactly one of `aria-label` or `aria-labelledby` on custom interactive components.

app/components/PageSkeleton.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { useLocation } from 'react-router'
1010

11-
import { PageContainer } from '~/layouts/helpers'
11+
import { ContentPane, PageContainer } from '~/layouts/helpers'
1212
import { classed } from '~/util/classed'
1313

1414
import { MswBanner } from './MswBanner'
@@ -28,8 +28,8 @@ export function PageSkeleton({ skipPaths }: { skipPaths?: RegExp[] }) {
2828
<>
2929
{process.env.MSW_BANNER ? <MswBanner disableButton /> : null}
3030
<PageContainer>
31-
{/* TopBar skeleton */}
32-
<div className="bg-default border-secondary fixed top-0 right-0 left-0 z-(--z-top-bar) grid h-(--top-bar-height) grid-cols-[var(--sidebar-width)_1fr] border-b">
31+
{/* TopBar */}
32+
<div className="bg-default border-secondary fixed inset-x-0 top-0 z-(--z-top-bar) grid h-(--top-bar-height) grid-cols-[var(--sidebar-width)_1fr] border-b">
3333
<div className="border-secondary flex items-center gap-2 border-r p-3">
3434
<Block className="h-8 w-8" />
3535
<Block className="h-4 w-24" />
@@ -42,7 +42,7 @@ export function PageSkeleton({ skipPaths }: { skipPaths?: RegExp[] }) {
4242
</div>
4343
</div>
4444
</div>
45-
{/* Sidebar skeleton */}
45+
{/* Sidebar */}
4646
<div className="border-secondary fixed top-(--top-bar-height) bottom-0 left-0 w-(--sidebar-width) border-r p-4">
4747
<Block className="mb-10 h-4 w-full" />
4848
<div className="mb-6 space-y-2">
@@ -56,8 +56,8 @@ export function PageSkeleton({ skipPaths }: { skipPaths?: RegExp[] }) {
5656
<Block className="h-4 w-14" />
5757
</div>
5858
</div>
59-
{/* Content skeleton */}
60-
<div className="light:bg-raise ml-(--sidebar-width)" />
59+
{/* Content */}
60+
<ContentPane />
6161
</PageContainer>
6262
</>
6363
)

app/layouts/helpers.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ export const PageContainer = classed.div`min-h-full pt-(--top-bar-height)`
1818
export function ContentPane() {
1919
useScrollRestoration()
2020
return (
21-
<div
22-
className="light:bg-raise ml-(--sidebar-width) flex min-h-[calc(100vh-var(--top-bar-height))] flex-col"
23-
id="scroll-container"
24-
data-testid="scroll-container"
25-
>
21+
<div className="light:bg-raise ml-(--sidebar-width) flex min-h-[calc(100vh-var(--top-bar-height))] flex-col">
2622
<div className="flex grow flex-col pb-8">
2723
<SkipLinkTarget />
2824
<main className="*:gutter">

test/e2e/ip-pool-silo-config.e2e.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ test.describe('IP pool configuration: pelerines silo (no defaults)', () => {
330330
await page.getByRole('button', { name: 'Create instance' }).click()
331331

332332
// RHF required validation should show an error on the pool field
333-
await expect(
334-
page.getByTestId('scroll-container').getByText('IPv4 pool is required')
335-
).toBeVisible()
333+
await expect(page.getByText('IPv4 pool is required')).toBeVisible()
336334

337335
// Should still be on the create page
338336
await expect(page).toHaveURL('/projects/adorno-project/instances-new')
@@ -375,9 +373,7 @@ test.describe('IP pool configuration: pelerines silo (no defaults)', () => {
375373
await page.getByRole('button', { name: 'Create instance' }).click()
376374

377375
// RHF required validation should show an error on the pool field
378-
await expect(
379-
page.getByTestId('scroll-container').getByText('IPv6 pool is required')
380-
).toBeVisible()
376+
await expect(page.getByText('IPv6 pool is required')).toBeVisible()
381377

382378
// Should still be on the create page
383379
await expect(page).toHaveURL('/projects/adorno-project/instances-new')

0 commit comments

Comments
 (0)