Skip to content

[Tracker] Responsive web — server-safe breakpoints, mobile components & gestures, RSC #4476

Open

Description

@cixzhang

Problem

Astryx has strong responsive primitives in places — useMediaQuery, an AppShell that collapses to MobileNav, lab:Drawer sheets, @media (hover: hover) guards, dynamic viewport units (dvh) — but there is no cohesive responsive-web system. Breakpoint logic is hand-rolled per consumer with a client hook, so it doesn't hold up under RSC/SSR (server renders the desktop tree, then flips on hydration). Mobile affordances (bottom sheet, swipe/gesture dismissal, safe-area insets, hover→tap conversion, on-screen-keyboard handling) are missing or partial, and there's no documented contract for how components should behave across breakpoints.

This is the Q3 push to make Astryx responsive-first: a server-safe breakpoint system, first-class mobile components and gestures, and the guidance/rubric to keep it healthy over time.

This is a tracker. Each item is (or will be) filed as its own issue and lands via the normal issue → API → PR flow. Checked = shipped; linked issues exist; unlinked items still need filing.

Breakpoint system (server-safe, CSS-first)

The core architectural bet: default to CSS-first breakpoints (@media / @container in StyleX, declarative hideBelow/showBelow-style props) so responsive layout renders correctly on the server with no hydration flash, and reserve the useMediaQuery JS hook for genuinely behavioral cases in small client islands.

Mobile components & gestures

Hover, touch & pointer behavior

Modals & dialogs on mobile

  • Responsive Dialog — auto-adapt to a bottom-sheet/fullscreen presentation below a breakpoint (Dialog has a fullscreen variant today but no automatic mobile adaptation)

Responsiveness on RSC

  • Make the breakpoint system server-safe end to end (see Breakpoint system above)
  • Audit AppShell's useMediaQuery-driven mobile split for hydration flash

Theme

  • Mobile theme — exploration

Maintenance

  • Mobile responsiveness rubric — preserve responsive guidance over time for new components and situations (docs + review checklist)

Related (tracked separately, not owned here)

Deliverables from the responsive-web plan: breakpoint system incl. targeting layouts · mobile theme (exploration) · bottom sheet · hover-behavior guidance · gestures/swipes · modals & dialogs on mobile · responsiveness on RSC · mobile maintenance rubric.

Activity

  1. added this to the Q3 2026 milestone on Jul 28, 2026
  2. added
    enhancement
    on Jul 28, 2026
  3. cixzhang commented on Aug 11, 2026

    @cixzhang
    ContributorAuthor

    Audit reference: coarse-pointer target size (rubric A10)

    From the AlertDialog component audit — #4887, Component Audit Rubric A10. Recording it here rather than against the component, because the root cause is system-level sizing and not an AlertDialog defect.

    Measured: both AlertDialog footer buttons render 32×32 CSS px at a 390px viewport with touch emulation (pointer: coarse), driven through real Chromium. That clears the WCAG 2.5.8 floor of 24×24, but nothing expands toward a 44px comfortable target under a coarse pointer — not in Button, and so not in anything that composes it.

    What it implies for this tracker: a documented minimum target size, plus an expansion path for interactive controls under pointer: coarse, starting at Button. Added as an item under Hover, touch & pointer behavior.

    Note for the next audit: A10 is listed as semi/manual in the rubric's Not yet in force table until a Playwright pass measuring interactive bounding boxes at 320px and under pointer: coarse lands in the rtl-audit harness.

  4. duytbp commented on Oct 28, 2026

    @duytbp
    Contributor

    Data for the last item ("Audit AppShell's useMediaQuery-driven mobile split for hydration flash") (code read on 0.7.4 and main 84e8552).

    AppShell chooses between the wide and the phone layout in JS:

    const isBelowBreakpoint = useMediaQuery(
      breakpointQuery,
      sideNavBreakpoint === 'none' ? false : mobileNavConfig?.defaultIsMobile,
    );

    useMediaQuery is a useSyncExternalStore whose server snapshot is serverDefault (false unless the app passes mobileNav={{defaultIsMobile}}). So the server render, and the hydration pass, always produce the wide layout: the inline SideNav panel, the TopNav in desktop mode, and no top bar or MobileNavToggle. The phone layout appears only after hydration.

    A react-dom/server renderToString check of an AppShell with a SideNav only (run on 0.7.1; the AppShell code is unchanged in 0.7.4):

    • mobileNav unset: inline side-nav panel rendered, no toggle, no mobile top bar.
    • mobileNav={{defaultIsMobile: true}}: no inline panel, toggle and mobile top bar rendered.

    On a phone, the first paint therefore shows the SideNav squeezed beside the page and the top nav items in the bar until hydration, and the layout then jumps.

    defaultIsMobile is a workable hint where the server knows the device (User-Agent, Sec-CH-UA-Mobile), but a wrong guess flips the other way, and statically rendered or cached pages have no request to read it from. The CSS-first direction in this tracker would fix it at the source: render the layout with @media / @container rules so the server markup is correct for any viewport, and keep the JS state only for the drawer's open state. If useful, I can file this as its own issue or an RFC for the CSS-first AppShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions