fix(settings): align responsive breakpoint to 768px for consistency#59412
Merged
Conversation
Generated-By: PostHog Code Task-Id: fb18fdb8-6b75-4e29-9712-2b2a289d04e2
Contributor
|
Reviews (1): Last reviewed commit: "fix(settings): align responsive breakpoi..." | Re-trigger Greptile |
Contributor
|
Size Change: +6.06 kB (+0.01%) Total Size: 116 MB 📦 View Changed
ℹ️ View Unchanged
|
… query
Switch is now driven by `window.matchMedia('(max-width: 767px)')` rather
than a ResizeObserver on the `.Settings` element. Container-observer
width drifts with scene padding (~32px), so the breakpoint fired closer
to 800px viewport instead of the intended Tailwind `md` (768px).
Contributor
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Settings nav switches between desktop sidebar and mobile drawer using
useResizeBreakpointson the.Settingsdiv. Because the div is ~32px narrower than the viewport (scene + main padding), the 768px element-width threshold actually fires near a viewport width of ~800px. That doesn't match Tailwind'smdbreakpoint (768px), so the Settings nav swap was misaligned with everything else on the page that uses tailwind media queries.Changes
useResizeBreakpoints({ 0:'small', 768:'medium' })with awindow.matchMedia('(max-width: 767px)')listener inSettings.tsx.refplumbing on the root.Settingsdiv — no longer needed.screens.mdincommon/tailwind/tailwind.config.js.How did you test this code?
Agent-authored — no manual browser testing performed.
pnpm --filter=@posthog/frontend typescript:checkbut the localtscprocess OOMed before completing — CI will run the real check.Publish to changelog?
no
🤖 Agent context
useResizeBreakpointsand just bump the threshold. Rejected after confirming the ~32px container/viewport gap means there is no element-width threshold that aligns exactly with Tailwind'smd— the only honest fix is a viewport media query.useMediaQueryand a single inlinematchMedialistener is small enough not to need one.