fix(examples): repair filters between sm and md breakpoints (DX-1449)#3440
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… (DX-1449) The examples filter switches from the mobile drawer to the inline desktop sidebar at the `sm` breakpoint (768px), where the Apply button is hidden via `sm:hidden`. The auto-commit effect, however, only propagated selections to the parent at >= 1040px (the `md` breakpoint). This left a dead zone between 768px and 1039px: the desktop sidebar rendered without an Apply button, so checkbox clicks updated local state but never reached the parent, making the filters appear broken (reproducible at ~818px). Align the JS breakpoint with the CSS `sm` breakpoint (768px) via a named constant, and add a regression test at 818px. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cfa51c7 to
2f03ab6
Compare
rainbowFi
left a comment
There was a problem hiding this comment.
Confirm that this fixes the issue on my browser window (I haven't reviewed the code though!)
Summary
Fixes DX-1449: the examples filters stop working on narrow desktop windows (reproducible at ~818px).
Root cause
The filter UI switches from the mobile drawer to the inline desktop sidebar at Tailwind's
smbreakpoint (768px intailwind.config.js), where the Apply button is hidden (sm:hidden). But the auto-commit effect inExamplesFilter.tsxonly propagated selections to the parent at >= 1040px (themdbreakpoint).That left a dead zone between 768px and 1039px: the desktop sidebar rendered with no Apply button, so checkbox clicks updated local state but never reached the parent — the filters appeared completely broken.
Fix
smbreakpoint (768px) via a namedSM_BREAKPOINTconstant (matches the existingMD_BREAKPOINTconvention inHeader.tsx).Manual testing (review app)
Tests
yarn test src/components/Examples— 6/6 passing, including the new 818px regression test.🤖 Generated with Claude Code