Skip to content

ref(replays): Migrate responsive styles to container queries - #120643

Merged
priscilawebdev merged 5 commits into
masterfrom
ref/replays-container-queries
Jul 27, 2026
Merged

ref(replays): Migrate responsive styles to container queries#120643
priscilawebdev merged 5 commits into
masterfrom
ref/replays-container-queries

Conversation

@priscilawebdev

@priscilawebdev priscilawebdev commented Jul 27, 2026

Copy link
Copy Markdown
Member

Replay components now respond to the width of their containing surface instead of the viewport. Existing responsive thresholds are mapped to the nearest container-query tokens, and browser/OS icon selection uses the container-scoped responsive value hook.

The reduced-motion media query remains viewport-based because it represents a user media preference rather than available layout width.

Make replay components respond to their available container width while preserving existing layout thresholds.

Refs #120315
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-nh0lzf909.sentry.dev

…gration

Two of the migrated rules can't resolve against a container:

- The timeline event tooltip is portaled to the body, which has no query
  container, so the @container clamp never matched. Restore the media query.
- The replay metadata dl is a flex item, so justify-self never applied on
  either axis. Drop the rule.

Refs #120315
Comment on lines -122 to -125

@media (min-width: ${p => p.theme.breakpoints.md}) {
justify-self: flex-end;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

justify-self has no effect on flex items, and this dl is a direct child of a <Flex>, so the rule never applied.

@priscilawebdev priscilawebdev Jul 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name ?? '',
version && isLargeBreakpoint ? version : undefined
);
const icon = generatePlatformIconName(name ?? '', version ?? undefined);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below lg we dropped the version before resolving the platform icon, but the icon is a fixed 20px glyph at every width. Since the version only picks between the legacy and modern Edge logos, this just meant Edge 12–18 rendered with the wrong logo on narrow screens

@priscilawebdev

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8f348e7. Configure here.

Replaces the two styled components with primitives. The responsive
font-size now rides on Text's `size` prop, which emits the same
@container rule. gray500 becomes the `secondary` content token it
already mapped to, and text-align gives way to Stack's cross-axis
centering.

Refs #120315
The browser and OS columns only passed the version to
generatePlatformIconName above a width threshold. The version selects
between the legacy and modern Edge logos and is used nowhere else, so
narrow layouts rendered legacy Edge (12-18) with the modern logo. The
width check gave nothing back either way - the icon is a fixed 20px
glyph and the tooltip already shows the version unconditionally.

Refs #120315
The title's container query never resolved - stories render outside any
query container, so it was pinned to the 14px base instead of the 20px
the pre-migration media query gave it. Make it a flat xl.

Also nest the two text lines in their own Stack so the 8px gap applies
between them and not below the illustration.

Refs #120315
@priscilawebdev
priscilawebdev marked this pull request as ready for review July 27, 2026 13:48
@priscilawebdev
priscilawebdev requested a review from a team as a code owner July 27, 2026 13:48
@priscilawebdev
priscilawebdev requested a review from a team July 27, 2026 13:48

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around on the preview env and it looks great. And all the code removal is lovely. Thanks for this! 🙌

@priscilawebdev
priscilawebdev merged commit dbe87d6 into master Jul 27, 2026
71 checks passed
@priscilawebdev
priscilawebdev deleted the ref/replays-container-queries branch July 27, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants