Responsive Admin Dashboards
Section titled “Responsive Admin Dashboards”The NutsNews admin area is designed to work on both desktop and mobile. The public reader site is mobile-first, but the admin dashboards are denser because they include operational tables, metrics, filters, and long status values.
This document explains the responsive admin dashboard layer added for mobile support.
The admin dashboards should be usable on a phone without breaking the layout.
The mobile goals are:
- No page-level horizontal overflow.
- Tables remain usable through contained horizontal scrolling.
- Headers shrink cleanly on small screens.
- Cards stack vertically before they become cramped.
- Long URLs, model names, source names, error messages, and email addresses wrap instead of pushing the viewport wider.
- Buttons and quick-nav pills remain large enough for touch.
- Preformatted setup blocks wrap safely.
Protected Admin Wrapper
Section titled “Protected Admin Wrapper”The protected admin layout wraps all protected admin pages with:
<div className="admin-responsive-shell">{children}</div>File:
web/app/admin/(protected)/layout.tsxThis allows shared responsive behavior to apply consistently to:
/admin/admin/articles/admin/ai-usage/admin/feed-health/admin/feeds/admin/home-server/admin/local-ai/admin/shardsShared Responsive CSS
Section titled “Shared Responsive CSS”The shared mobile rules live in:
web/app/globals.cssThe CSS is scoped to:
.admin-responsive-shellThis keeps the changes focused on the protected admin area and avoids changing the public NutsNews reader experience.
What the CSS Fixes
Section titled “What the CSS Fixes”Mobile Page Padding
Section titled “Mobile Page Padding”On small screens, admin pages use tighter page padding:
0.75rem left/right1rem top/bottomThis gives cards and tables more room on phone screens.
Rounded Card and Section Size
Section titled “Rounded Card and Section Size”Large desktop card radiuses and padding are reduced on mobile:
Desktop: large rounded dashboard panelsMobile: smaller rounded panels with tighter paddingThis keeps the dashboards from feeling oversized on phones.
Responsive Headings
Section titled “Responsive Headings”Admin pages often have large dashboard titles. On mobile, headings are clamped so they remain readable without overflowing:
h1: clamp(1.85rem, 9vw, 2.5rem)h2: clamp(1.35rem, 6vw, 1.85rem)h3: clamp(1.45rem, 8vw, 2.1rem)Long Text Wrapping
Section titled “Long Text Wrapping”The responsive shell allows long operational text to wrap:
URLsemail addressesmodel namesfeed nameserror messagesstatus messagespre/code blockstable cell contentTouch-Friendly Controls
Section titled “Touch-Friendly Controls”Admin nav pills, buttons, and hash-link controls keep a minimum 44px height on mobile.
Tables
Section titled “Tables”The dashboards intentionally keep dense tables as tables. On mobile, tables are contained inside horizontal scroll regions rather than forcing the entire page to overflow.
Important behavior:
Only the table region scrolls sideways.The page itself remains fixed to the viewport width.Cells use tighter padding on mobile.Tables use smaller text on mobile.Why This Approach Was Chosen
Section titled “Why This Approach Was Chosen”The admin dashboards contain operational data that is naturally tabular:
article reviewsAI usage runsfeed health rowsfeed management rowsWorker shard statuslatest local AI runshome-server service statusConverting every table to separate mobile card layouts would require larger, riskier page-specific rewrites. The shared responsive layer gives a safer first pass:
- It fixes the biggest mobile usability issues quickly.
- It touches one layout file and one global stylesheet.
- It avoids changing Supabase queries or dashboard data logic.
- It preserves the desktop dashboard design.
- It can be extended later page-by-page if one dashboard needs a custom mobile card layout.
Files Changed
Section titled “Files Changed”web/app/admin/(protected)/layout.tsxweb/app/globals.cssDocumentation files updated:
README.mddocs/README.mddocs/ADMIN_RESPONSIVE_DASHBOARDS.mdValidation
Section titled “Validation”Run from the repo root:
cd /Users/ramideltoro/WebstormProjects/nutsnews2
cd webnpx tsc --noEmitnpm run buildThen test locally:
cd /Users/ramideltoro/WebstormProjects/nutsnews2/webnpm run devOpen these routes on a mobile-sized browser viewport:
http://localhost:3000/adminhttp://localhost:3000/admin/articleshttp://localhost:3000/admin/ai-usagehttp://localhost:3000/admin/feed-healthhttp://localhost:3000/admin/feedshttp://localhost:3000/admin/home-serverhttp://localhost:3000/admin/local-aihttp://localhost:3000/admin/shardsCheck that:
- The page itself does not horizontally overflow.
- Tables scroll inside their table panel.
- Header text does not get cut off.
- Sign-out card does not force the page wider.
- Quick navigation pills wrap cleanly.
- Long error/source/model strings wrap or truncate inside their panels.
Future Improvements
Section titled “Future Improvements”Possible future refinements:
- Page-specific mobile cards for the most important table rows.
- Sticky first columns for dense tables.
- Compact mobile filters for
/admin/articles. - Collapsible sections for long dashboards.
- Per-dashboard mobile screenshots in the docs.
- Automated visual regression checks for mobile admin routes.
