Fix tablet responsive breakpoints (768px-1024px)#392
Conversation
- Add tablet-specific spacing and sizing adjustments across all pages - Increase touch targets from 44px to 48px on tablets for better usability - Enhance mobile navigation bar with larger icons and text on tablets (h-24) - Add max-width constraint (4xl) to center content on tablets - Improve typography scaling: headers, labels, and body text - Adjust grid layouts: features grid now 3 columns on tablets - Increase padding and gaps throughout for less crowded layouts - Update PageContainer with tablet-optimized spacing (px-6, py-6, pb-28) - Add tablet-specific styles to global CSS components Fixes Pi-Defi-world#362
|
@willy-de7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
📝 WalkthroughWalkthroughThis PR adds tablet-specific responsive styling (768px–1024px) to the entire app through global CSS media queries and Tailwind's ChangesTablet breakpoint responsive styling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/mobile-nav.tsx (1)
76-78: 💤 Low valueIcon wrapper may not increase actual icon size as expected.
The
spanwrapper setsmd:w-7 md:h-7(28px), but the actual icon components defined at lines 15-24 remain hardcoded atw-5 h-5(20px). This creates a 28px container with a 20px icon centered inside, adding spacing but not increasing the icon visual size.If the intent is to increase icon size at the tablet breakpoint, the icon definitions at lines 15-24 should also receive responsive sizing:
const navItems: NavItem[] = [ - { name: "Home", href: "/", icon: <Home className="w-5 h-5" /> }, + { name: "Home", href: "/", icon: <Home className="w-5 h-5 md:w-6 md:h-6" /> }, // ... repeat for other icons ];If the current behavior (larger container, same icon size) is intentional for consistent spacing, this can be ignored.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/mobile-nav.tsx` around lines 76 - 78, The span wrapper sets md:w-7/md:h-7 but the actual icon JSX (item.icon) remains hardcoded to w-5 h-5, so increase the icon size at the tablet breakpoint by either updating the icon components to accept and apply a className prop or override the rendered icon’s classes when rendering item.icon; for example, when rendering item.icon, use React.cloneElement(item.icon, { className: concatExistingClasses(item.icon.props.className, "w-5 h-5 md:w-7 md:h-7") }) so the visual icon scales to match the md container rather than only centering a smaller icon.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/globals.css`:
- Around line 177-190: The tablet-only media query causes .page-header-row,
.page-title and .touch-target to revert on desktop; change the CSS rule that
targets "`@media` (min-width: 768px) and (max-width: 1024px)" to be unbounded from
the top (e.g., "`@media` (min-width: 768px)") so the increased padding/text
size/touch-targets apply the same way Tailwind's md: utilities used by
PageContainer do; update the selectors for .page-header-row, .page-title, and
.touch-target accordingly so their md-equivalent styles match PageContainer's
md:px/md:py and text sizing on all widths >=768px.
---
Nitpick comments:
In `@components/mobile-nav.tsx`:
- Around line 76-78: The span wrapper sets md:w-7/md:h-7 but the actual icon JSX
(item.icon) remains hardcoded to w-5 h-5, so increase the icon size at the
tablet breakpoint by either updating the icon components to accept and apply a
className prop or override the rendered icon’s classes when rendering item.icon;
for example, when rendering item.icon, use React.cloneElement(item.icon, {
className: concatExistingClasses(item.icon.props.className, "w-5 h-5 md:w-7
md:h-7") }) so the visual icon scales to match the md container rather than only
centering a smaller icon.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5838bfad-c54e-4db0-95f4-d7b3e551b69e
📒 Files selected for processing (6)
app/globals.cssapp/me/page.tsxapp/page.tsxcomponents/app-layout.tsxcomponents/layout/page-container.tsxcomponents/mobile-nav.tsx
| @media (min-width: 768px) and (max-width: 1024px) { | ||
| .page-header-row { | ||
| @apply px-6 py-4; | ||
| } | ||
|
|
||
| .page-title { | ||
| @apply text-xl; | ||
| } | ||
|
|
||
| /* Increase touch targets for tablet */ | ||
| .touch-target { | ||
| @apply min-w-[48px] min-h-[48px]; | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all usages of the global utility classes that have tablet-only media queries
echo "=== Pages using .page-header-row ==="
rg -n --type=tsx --type=ts -C2 'page-header-row'
echo -e "\n=== Pages using .page-title ==="
rg -n --type=tsx --type=ts -C2 'page-title'
echo -e "\n=== Pages using .touch-target ==="
rg -n --type=tsx --type=ts -C2 'touch-target'
echo -e "\n=== Components using PageContainer (affected by spacing mismatch) ==="
rg -n --type=tsx --type=ts -C2 'PageContainer'Repository: Pi-Defi-world/acbu-frontend
Length of output: 377
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== globals.css relevant section ==="
ls -la app/globals.css
sed -n '150,220p' app/globals.css | nl -ba
echo
echo "=== Locate PageContainer implementation ==="
# Find the file that defines PageContainer
fd -a "page-container.*" . || true
fd -a "PageContainer" . || true
# Prefer common path; if not found, fall back to rg
pc_file="$(rg -l --hidden --glob '!*node_modules/*' --glob '!*dist/*' "PageContainer" . || true | head -n 1)"
echo "First match file for 'PageContainer': ${pc_file:-<none>}"
if [[ -n "${pc_file}" ]]; then
echo "=== PageContainer lines around first occurrence ==="
rg -n --glob '*.tsx' --glob '*.ts' --hidden --glob '!*node_modules/*' --glob '!*dist/*' "PageContainer" "$pc_file" || true
sed -n '1,220p' "$pc_file" | nl -ba | head -n 220
fi
echo
echo "=== Search for .page-header-row / .page-title / .touch-target usages (tsx/ts only) ==="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '*.tsx' --glob '*.ts' -C2 'page-header-row' . || true
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '*.tsx' --glob '*.ts' -C2 'page-title' . || true
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '*.tsx' --glob '*.ts' -C2 'touch-target' . || trueRepository: Pi-Defi-world/acbu-frontend
Length of output: 234
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== globals.css tablet media query section ==="
# Show with line numbers using cat -n (nl not available)
cat -n app/globals.css | sed -n '150,220p'
echo
echo "=== Locate PageContainer definition ==="
# Search for definition/exports
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '*.tsx' --glob '*.ts' -S 'PageContainer' app || true
# Try locating the likely file by name first
echo
echo "=== Candidate files containing 'page-container' in name ==="
find app -maxdepth 6 -type f \( -iname '*page-container*' \) 2>/dev/null || true
echo
echo "=== Usage counts (tsx/ts) ==="
for cls in page-header-row page-title touch-target; do
echo "--- $cls ---"
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '*.tsx' --glob '*.ts' -S "${cls}" app || true
doneRepository: Pi-Defi-world/acbu-frontend
Length of output: 15380
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find PageContainer file explicitly by path pattern
find . -type f \( -iname '*page-container*' -o -path '*page-container*' \) | head -n 50
echo
# Print PageContainer component implementation (first match)
pc_file="$(find . -type f \( -iname 'page-container.tsx' -o -iname 'page-container.ts' \) | head -n 1)"
echo "Using: ${pc_file:-<none>}"
if [[ -n "${pc_file:-}" ]]; then
sed -n '1,200p' "$pc_file" | cat -n
echo
rg -n "className=|md:px|px-|md:py|py-" "$pc_file" || true
fi
echo
echo "=== Inspect globals.css around tablet media query (for exact snippet) ==="
cat -n app/globals.css | sed -n '140,210p'Repository: Pi-Defi-world/acbu-frontend
Length of output: 2624
Critical: Tablet-only (max-width) media query makes header styles revert on desktop vs PageContainer’s md:* spacing
In app/globals.css, .page-header-row / .page-title (and .touch-target) are only increased inside @media (min-width: 768px) and (max-width: 1024px). PageContainer uses unbounded md:px-6 md:py-6 ..., so on widths >1024px the content wrapper stays at px-6 while the header row reverts to base px-4 py-3 and the title to base text-lg (e.g., app/rates/page.tsx).
Recommended fix (align with Tailwind `md:` behavior)
- `@media` (min-width: 768px) and (max-width: 1024px) {
+ `@media` (min-width: 768px) {
.page-header-row {
`@apply` px-6 py-4;
}
.page-title {
`@apply` text-xl;
}
/* Increase touch targets for tablet */
.touch-target {
`@apply` min-w-[48px] min-h-[48px];
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @media (min-width: 768px) and (max-width: 1024px) { | |
| .page-header-row { | |
| @apply px-6 py-4; | |
| } | |
| .page-title { | |
| @apply text-xl; | |
| } | |
| /* Increase touch targets for tablet */ | |
| .touch-target { | |
| @apply min-w-[48px] min-h-[48px]; | |
| } | |
| } | |
| `@media` (min-width: 768px) { | |
| .page-header-row { | |
| `@apply` px-6 py-4; | |
| } | |
| .page-title { | |
| `@apply` text-xl; | |
| } | |
| /* Increase touch targets for tablet */ | |
| .touch-target { | |
| `@apply` min-w-[48px] min-h-[48px]; | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/globals.css` around lines 177 - 190, The tablet-only media query causes
.page-header-row, .page-title and .touch-target to revert on desktop; change the
CSS rule that targets "`@media` (min-width: 768px) and (max-width: 1024px)" to be
unbounded from the top (e.g., "`@media` (min-width: 768px)") so the increased
padding/text size/touch-targets apply the same way Tailwind's md: utilities used
by PageContainer do; update the selectors for .page-header-row, .page-title, and
.touch-target accordingly so their md-equivalent styles match PageContainer's
md:px/md:py and text sizing on all widths >=768px.
closes #362
Description
This PR fixes issue #362 by implementing proper responsive design for tablet devices (768px-1024px). Previously, tablets received the desktop layout with no adjustments, causing overcrowded sidebars and tiny touch targets.
Changes Made
Layout & Spacing
Touch Targets & Navigation
Typography
Grid Layouts
Component Updates
Testing Recommendations
Test on devices/viewports in the 768px-1024px range:
Verify:
Summary by CodeRabbit