-
Notifications
You must be signed in to change notification settings - Fork 2
feat: improve registries grid responsiveness #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for curate-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe changes introduce a new small breakpoint constant and update the registry grid pagination logic to respond to three viewport sizes instead of two, enabling more granular layout control. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
web/src/styles/breakpoints.ts (1)
1-2: Confirm SM_BREAKPOINT matches your CSS/grid breakpoint
SM_BREAKPOINTat 600 makes sense, but givenLG_BREAKPOINTis explicitly aligned with the UI/Tailwind lg override, it’s worth double‑checking that 600px is the same threshold your grid/layout uses for the “small ↔ medium” transition. If the CSS breakpoint differs, consider either updating this value or renaming the constant to avoid drift between pagination logic and the visual layout.Based on learnings, this keeps TS breakpoints consistent with your Tailwind/ui-components configuration.
web/src/pages/AllLists/RegistriesFetcher.tsx (1)
14-25: Align breakpoint comparisons and consider clarifying the ternaryThe new three‑tier logic (9 / 6 / 3) looks good and matches the responsive goal, but two small tweaks could make it more robust and readable:
- If
LG_BREAKPOINTandSM_BREAKPOINTrepresent the widths at which layouts switch (i.e., min‑width breakpoints), you probably want>=so that widths exactly at 900px/600px fall into the higher tier rather than the lower one:- const registriesPerPage = width > LG_BREAKPOINT ? 9 : width > SM_BREAKPOINT ? 6 : 3; + const registriesPerPage = + width >= LG_BREAKPOINT ? 9 : width >= SM_BREAKPOINT ? 6 : 3;
- Optional: for readability, you might extract this into a small helper or expand to an
if/elseladder instead of a nested ternary, especially if more breakpoints are added later.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/src/pages/AllLists/RegistriesFetcher.tsx(2 hunks)web/src/styles/breakpoints.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kyrers
Repo: kleros/curate-v2 PR: 89
File: web/src/styles/breakpoints.ts:1-1
Timestamp: 2025-11-14T22:12:39.974Z
Learning: In the kleros/curate-v2 repository, the kleros/ui-components-library overrides Tailwind's lg breakpoint to 900px (not the default 1024px). The LG_BREAKPOINT constant in web/src/styles/breakpoints.ts is set to 900 to match this override. This configuration is imported via the source directive in global.css.
📚 Learning: 2025-11-14T22:12:39.974Z
Learnt from: kyrers
Repo: kleros/curate-v2 PR: 89
File: web/src/styles/breakpoints.ts:1-1
Timestamp: 2025-11-14T22:12:39.974Z
Learning: In the kleros/curate-v2 repository, the kleros/ui-components-library overrides Tailwind's lg breakpoint to 900px (not the default 1024px). The LG_BREAKPOINT constant in web/src/styles/breakpoints.ts is set to 900 to match this override. This configuration is imported via the source directive in global.css.
Applied to files:
web/src/pages/AllLists/RegistriesFetcher.tsxweb/src/styles/breakpoints.ts
🧬 Code graph analysis (1)
web/src/pages/AllLists/RegistriesFetcher.tsx (1)
web/src/styles/breakpoints.ts (2)
LG_BREAKPOINT(1-1)SM_BREAKPOINT(2-2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - curate-v2
- GitHub Check: Header rules - curate-v2
- GitHub Check: Pages changed - curate-v2
tractorss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Resolves #91.
PR-Codex overview
This PR introduces a new small breakpoint constant and modifies the logic for determining the number of registries displayed per page based on the window width.
Detailed summary
SM_BREAKPOINTconstant with a value of600inweb/src/styles/breakpoints.ts.web/src/pages/AllLists/RegistriesFetcher.tsxto includeSM_BREAKPOINT.registriesPerPagecalculation to considerSM_BREAKPOINT, adjusting the display logic for smaller widths.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.