You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2151c88
Browse filesBrowse the repository at this point in the historyBrowse files
fix(AppShell): a second shell on a page gets its own main id (#10199)
* test(AppShell): two shells on a page have unique main ids; the first keeps the fixed id (red)
* fix(AppShell): a second shell on a page gets its own main id; the first keeps the fixed id
useAppShellMainId lets the first mounted shell keep astryx-app-shell-main and
gives each other shell a generated id, which its skip link targets. When the
first shell unmounts, the next takes the fixed id. AppShell FR4 and FR5 state
the rule.
* fix(AppShell): a shell nested in another shell's content never takes the fixed main id
AppShell provides AppShellNestingContext around its content; a nested shell
always uses its generated id and does not claim, so the page's own shell
keeps astryx-app-shell-main even though child layout effects run first.
* Merge main into lane4/appshell-unique-main-id
[fix] Two `AppShell`s on one page no longer share the main region's id. The first mounted shell keeps `id="astryx-app-shell-main"`, so single-shell pages, skip links and selectors that name it keep working. Each other shell's main region gets its own generated id, which its skip link targets.
Copy file name to clipboardExpand all lines: docs/specs/components/AppShell/AppShell.spec.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,8 +174,8 @@ the only component record in the AppShell root.
174
174
| FR1 | The root element carries `app-shell`, the forwarded `ref`, `data-testid`, and other DOM props, and contains, in order: the skip link, the Layout frame (header region, inline side region, content region), then any mobile drawer. | Current source and tests |
175
175
| FR2 | A slot is present when its value is renderable: not `null`, `undefined`, a boolean, or an empty string. A component that renders nothing still counts as present. | Current source and public types |
176
176
| FR3 | The header region renders only when `topNav` or `banner` is present; it carries `app-shell-header` and `role="banner"`, places `banner` above `topNav`, and is never inside another landmark. The sidenav-only mobile top bar (FR9) also carries `app-shell-header` and takes `role="banner"` only when no header region renders. AppShell renders at most one banner landmark. The header region pads its items by `env(safe-area-inset-top, 0px)` at the block start and the physical `env(safe-area-inset-left/right, 0px)` on its inline sides (swapped in right-to-left), while its background still reaches under the status bar and to the screen's sides; the sidenav-only mobile top bar takes the same insets when no header region renders, and only the side insets below one. In `auto`, the sidenav-only mobile top bar below a header region sticks at `env(safe-area-inset-top, 0px)`, not at the block start (FR6). | Current source and tests |
177
-
| FR4 | `children` render in one region with `role="main"` and `id="astryx-app-shell-main"`, programmatically focusable so the skip link can move focus to it; programmatic focus on it draws no focus ring. Its padding is `contentPadding`, default `0`, and its block-end padding adds `env(safe-area-inset-bottom, 0px)`, in the page or in main's own scroller. The region stays border-box, and the inset it publishes to its descendants stays `contentPadding` alone, so a bleed child subtracts only `contentPadding` and the safe area survives below it. Whether it is a sequential tab stop is keyboard access to a scroll region (`spec:AST-025` FR12). Focus that Tab moves onto it while it is a stop draws the standard focus ring, inset, until focus leaves it; in `elevated` with both navs the region takes the surface's rounded top-start corner while that ring shows. | `architecture:container-padding`; current source and tests |
178
-
| FR5 | The skip link is the first focusable element in the shell. It links to `#astryx-app-shell-main`, shows the translated `@astryx.appShell.skipToContent` text, is visually hidden until focused, and on activation moves focus to the main region. | WCAG 2.4.1; current source and tests |
177
+
| FR4 | `children` render in one region with `role="main"` and an id: `astryx-app-shell-main` for the first mounted shell on the page, and a generated unique id for each other shell, so a page has no duplicate ids; programmatically focusable so the skip link can move focus to it; programmatic focus on it draws no focus ring. Its padding is `contentPadding`, default `0`, and its block-end padding adds `env(safe-area-inset-bottom, 0px)`, in the page or in main's own scroller. The region stays border-box, and the inset it publishes to its descendants stays `contentPadding` alone, so a bleed child subtracts only `contentPadding` and the safe area survives below it. Whether it is a sequential tab stop is keyboard access to a scroll region (`spec:AST-025` FR12). Focus that Tab moves onto it while it is a stop draws the standard focus ring, inset, until focus leaves it; in `elevated` with both navs the region takes the surface's rounded top-start corner while that ring shows. | `architecture:container-padding`; current source and tests |
178
+
| FR5 | The skip link is the first focusable element in the shell. It links to its own main region's id (FR4), shows the translated `@astryx.appShell.skipToContent` text, is visually hidden until focused, and on activation moves focus to the main region. | WCAG 2.4.1; current source and tests |
179
179
| FR6 | `fill` sizes the root to `100dvh` and the inline side region and main region scroll on their own. `auto` gives the root a `100dvh` minimum, makes the header sticky at the block start, keeps the inline side region sticky below the measured height of a header present when the shell mounts in `auto`, with its own scrolling, and lets the page scroll. Header height is measured only in `auto`. | Current source and tests |
180
180
| FR7 | Variant backgrounds: `wash` paints body background on the frame, nav areas, and content; `surface` paints surface on all three; `section` paints surface on the frame and divides the nav areas from content, and in `auto` the header paints surface itself; `elevated` paints body background on the frame and nav areas and surface on content (FR16 for the corner). | Current source and tests |
181
181
| FR8 | The mobile layout follows `mobileNav.breakpoint` under `spec:AST-012` FR8 and `architecture:theme-application` INV10; the breakpoint defaults to `md`, and `defaultIsMobile` is ignored when it is `none`. | `spec:AST-012` FR8; tests |
0 commit comments