Skip to content

fix(web): show the dashboard resize handle exactly where widget sizes apply - #4844

Merged
Quick104 merged 1 commit into
mainfrom
fix/admin-widget-resize-rem-breakpoint
Nov 21, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/admin-widget-resize-rem-breakpoint

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Other clients: N/A (the customizable admin dashboard exists only in the web app)

When the browser's default font size isn't 16px, the admin dashboard's widget resize handle and the grid it resizes switch at different window widths. At a smaller font size the handle shows on a grid that ignores widget sizes, so resizing appears to work but changes nothing. At a larger one the grid applies widget sizes but shows no handle, so widgets can't be resized, and the Health Strip overflows into its neighbours. This change makes the handle, the grid, and Now Playing switch at the same width.

The handle in DashboardGrid.tsx showed from Tailwind's lg breakpoint (64rem). The .admin-widget-grid rules in app.css applied widget spans and fixed row heights from 1024px, and Now Playing chose how many sessions to mount with the same 1024px query in JS. A rem width in a media query follows the browser's default font size, so lg is 768px at 12px (Chrome's "Small") and 1280px at 20px ("Large"):

  • 12px default, 768–1023px wide: in Customize mode every widget shows its resize handle while the grid is two content-sized columns. Dragging updates the size badge, announces "resized", and saves the new span and row count, but the widget doesn't change.
  • 20px default, 1024–1279px wide: the 12-column grid with fixed rows is active, but the handle is hidden, so neither pointer nor keyboard can resize. The one-row Health Strip's own lg: layout hasn't applied yet at that width either, so its cells wrap to two rows and draw over the stat tiles and Now Playing.

Approach

The 12-column layout now needs both 64rem and 1024px, and the three places that decide it use that pair: the grid's media query, the handle's class (lg:min-[1024px]:block), and Now Playing's fixed-rows query. The two-column rule keeps its 640px lower bound and drops its upper bound; the 12-column rule comes after it and overrides everything it sets, which a comment pins.

Where the layout starts at each browser font size:

Default font 12-column layout starts at
12px 1024px (as on main)
16px 1024px (unchanged)
20px 1280px
24px 1536px

Neither breakpoint works alone. With only 64rem, at a small font the 12-column layout would start at 768px, where the fixed 240px sidebar and the widgets' px-sized text leave too little room: the Health Strip overflowed its row and stat tiles clipped in testing. With only 1024px, a large font would keep the Health Strip overlap above. Comments that described the grid as switching at lg now say "the 12-column layout" and point to the rule in app.css.

Validation

  • Reproduced on a dev sandbox built from main, then checked on one built from this commit, in headless Chromium with the default font size set the way Chrome's font size setting sets it (CDP Page.setFontSizes). Before: at 12px and 900px the grid had 2 columns while all 15 handles showed and took keyboard focus; at 20px and 1200px it had 12 columns and no handle was shown or reachable. After: the column count and the handles change together on both sides of every switch point measured (12px at 767/768/1023/1024, 16px at 1023/1024, 20px at 1279/1280, 24px at 1535/1536).
  • On main, a drag at 12px and 900px saved span 4, rows 2 (read back from GET /api/v2/admin/dashboard/layout) while the widget stayed 301 × 87px. After, the same drag and a keyboard resize at 12px and 1024px resize the widget and announce the new size.
  • The Health Strip's content fits its row at every size measured after the change. On main it overflowed by 33px above and below at 20px and 1100px.
  • The production build compiles the 12-column rule to (min-width:64rem) and (min-width:1024px) and the handle's class to the same pair, nested.
  • Web lint (no errors), typecheck, format check, production build, bundle budget, the dashboard tests, and make verify-local-paths pass. make test-web: the files that fail also fail on main (request-deadline, auth-refresh, player, and collections-select tests); none touch the dashboard.
  • No test added: the defect is which width a media query matches, which jsdom doesn't evaluate.

Evidence: https://evidence.siloserver.org/r/silo-server/admin-widget-resize-rem/

Risks

None identified. The change is CSS, one class, and one media-query string in the web admin dashboard. At 16px nothing changes; at other font sizes only the width where saved widget sizes apply moves, and the saved layouts themselves are untouched.

Follow-ups:

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Background review: 1 round, last reviewed 153203a

Member Round 1
Sol (gpt-6.2-sol, xhigh) 9/10
Opus (claude-opus-5-5, high) 9/10
Gemini (gemini-4-neon, xhigh) 9/10

Visual review: 2 rounds, final captures from 153203a

Member Round 1 Round 2
Sol better, 6/10 better, 8/10
Opus mixed, 5/10 better, 7/10
Gemini better, 5/10 better, 7.5/10

Fixed: visual round 1 found the first version (64rem only) too cramped at 12px from 768 to about 1000px (Health Strip overflow, clipped tiles, wrapped chart headers), so the 12-column layout now also needs 1024px. Answered: the remaining visual findings are present on main at the same sizes and went to the follow-ups above. Background review: the Health Strip's own six-column switch (Gemini) is #4871; a resize that crosses the breakpoint mid-drag saves the size its badge showed (Sol), which main does at its own breakpoint too; one definition for the 64rem + 1024px pair through a custom variant (Opus, optional) was left out because the JS query would still repeat it and the comments name all three places.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; T3 Code delegated tasks for the plan, visual, and adversarial reviews (Codex, Claude, and Antigravity providers); headless Chromium (Playwright) for captures
  • Model(s): claude-opus-5-5 (implementation, review); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (council); claude-sonnet-5-5 (code-review finder and validation check)
  • Involvement: Fully AI-generated; the agent verified it on a dev sandbox, a person hasn't yet
  • Adversarial review: a multi-agent code review at xhigh found no defects in the first version; on the revised diff it caught a stale comment in types.ts and suggested dropping the two-column rule's upper bound, both applied. The plan round (Sol and Opus; Gemini was out of quota and its premises were checked by hand) moved the queries to plain @media in rem and kept the 640px bound. A simplify pass changed nothing. The visual and background reviews are under Council review.

🤖 Generated with Claude Code

… apply

The resize handle showed from Tailwind's lg (64rem), but the grid applied
widget spans and fixed rows from 1024px. Rem in a media query follows the
browser's default font size, so at any size other than 16px the two
disagreed: at 12px the handle showed over a two-column grid that ignores
spans, and at 20px the 12-column grid had no handle, and its one-row Health
Strip overflowed into its neighbours.

The 12-column layout now needs both 64rem and 1024px, and the handle and Now
Playing's fixed-rows check use the same pair. At 12px it still starts at
1024px, where the fixed sidebar leaves room for it; at 20px it starts at
1280px. Nothing changes at 16px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 005fb080-4720-453a-afe2-e8279315b002
Commits

Reviewing files that changed from the base of the PR and between c1e36dc and 153203a.

Files selected for processing: 6

  • web/src/app.css
  • web/src/components/admin/dashboard/DashboardGrid.tsx
  • web/src/components/admin/dashboard/charts/LineChart.tsx
  • web/src/components/admin/dashboard/charts/StackedColumnChart.tsx
  • web/src/components/admin/dashboard/types.ts
  • web/src/components/admin/dashboard/widgets/NowPlayingWidget.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T03:50:34.979589Z 153203a PR opened
🔒 Security Review ✅ Completed 2026-11-21T03:52:53.156584Z 153203a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Nov 21, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (Gemini 4 Neon, reviewed 153203a)

The grid rule, resize handle, and NowPlayingWidget query now switch together at max(64rem, 1024px), and the compiled CSS preserves source order (@media (min-width: 640px) before @media (min-width: 64rem) and (min-width: 1024px)) and handle utility order (.hidden before nested @media .lg\:min-\[1024px\]\:block). One companion lg: layout in the dashboard was left on plain lg:.

G1 (low) — web/src/components/admin/dashboard/widgets/HealthStripWidget.tsx:72

  • Trigger: Browser default font size under 16px (for example 12px) at viewport widths between 64rem and 1023px (768px–1023px at 12px).
  • Impact: The dashboard grid stays in its two-column, content-sized layout below 1024px because the fixed 240px sidebar and px-sized widget text leave too little width for wide columns (web/src/app.css:2370-2372), yet HealthStripWidget still switches from sm:grid-cols-3 to lg:grid-cols-6 at 64rem. At 12px / 768px, the lg sidebar (240px) and page gutters (48px) leave 480px for the grid, 442px inside CardContent (border + px-6), 66px per cell across six columns with gap-3, and 49px of inner width per CellShell (border + p-2.5). After the 10.5px icon and 4.5px gap, ~34px remain for fixed text-[11px] labels (Postgres, Version, Uptime, Errors · 24h) that have no truncate or overflow-hidden, and text-[15px] values truncate to a few characters. (Pre-existing on main, not introduced by this change.)
  • Evidence: HealthStripWidget.tsx:72 uses sm:grid-cols-3 lg:grid-cols-6, HealthStripWidget.tsx:202-205 renders <Icon className="h-3.5 w-3.5" />{label} in text-[11px], HealthStripWidget.tsx:226 sets min-w-0 without overflow clipping, and AdminLayout.tsx:124,214 enables the 240px sidebar and 2rem gutter at lg: (64rem).
  • Suggested repair: Change lg:grid-cols-6 on HealthStripWidget.tsx:72 to lg:min-[1024px]:grid-cols-6 so the six-column row activates at the same max(64rem, 1024px) threshold as .admin-widget-grid's fixed-row layout. Below 1024px at 12px, rows are content-sized and sm:grid-cols-3 gives each cell 124px+ of inner width; at 16px, 20px, and 24px the transition width is unchanged.

@Quick104
Quick104 merged commit 0d6ee2f into main Nov 21, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/admin-widget-resize-rem-breakpoint branch November 21, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant