Skip to content

fix(admin): rebuild match-report review layout, and show completed reports honestly - #266

Merged
diese-tech merged 2 commits into
mainfrom
claude/ui-clutter-scrolling-din3g1
Sep 1, 2026
Merged

fix(admin): rebuild match-report review layout, and show completed reports honestly#266
diese-tech merged 2 commits into
mainfrom
claude/ui-clutter-scrolling-din3g1

Conversation

@diese-tech

@diese-tech diese-tech commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Two related fixes to the admin Match Report screen.


1. The review layout was unusable

The review step put two min-w-[480px] stat tables into a 2xl:grid-cols-2 split of a column that was itself roughly one third of a max-w-7xl page. Each table was therefore rendered narrower than its own minimum width, so correcting a game meant driving two independently side-scrolling panes with the IGN column pushed off the left edge — while typing into inputs 40–64px wide and text-xs/py-0.5 tall.

The Tailwind breakpoints made it worse rather than better: 2xl: is a viewport query, so on a wide monitor it split an already-narrow fixed-width container into two even narrower halves.

Layout

  • New TeamStatEditor replaces both <table>s. It lays the same nine fields out on a container-query grid, so it responds to the card's own width rather than the viewport: one line per player at ≥56rem, a two-line wrap at ≥36rem, three lines below that. Nothing scrolls sideways at any width.
  • The two team cards stack full width instead of splitting the column in half — splitting it was what forced the tables to scroll.
  • The score bar, game tabs and winner picker collapse into one sticky control bar. Setting the winner now happens on the team card it applies to, instead of a third row repeating both team names.
  • Page widened to 1680px; the select/upload/done steps are capped at max-w-3xl so they don't stretch across it.
  • The report list can fold away, so it stops competing with the editor for width once a report is open.

Inputs (shared with the host review screen via stat-inputs.tsx)

  • Sized as real form controls: 36px tall, 14px text, visible focus rings.
  • Number spinners suppressed — they consumed roughly a third of each box and misfire on scroll.
  • Accept className and disabled so callers can size and lock them from their own layout.
  • Every field carries an aria-label, and the unlinked-IGN count is named on the team card header instead of only being an amber row tint.

2. A completed report was a dead end — and a resubmit could lie

Opening a completed report showed a bare score card with no way to see the stats behind it. Underneath that was a real correctness bug.

resolve_match_report_review returns early for a report already in done: it responds already_processed / applied: false with the original scores and writes nothing. The submit route discarded both fields and always answered ok: true with whatever scores came back — so a resubmit of a published report rendered "Result Submitted" while the corrections were silently dropped.

  • Pass applied and code through the submit route; the client now says the report was already published and nothing changed, rather than showing the success screen.
  • Open completed reports onto the published stats read-only, with game tabs and the screenshots — rebuilt from player_match_stats rather than extracted_data, which holds the AI/host extraction and never receives the admin's review corrections.
  • TeamStatEditor gains readOnly, so the published view reuses the same responsive grid with its fields disabled and edit affordances gone.
  • The UI states plainly that published stats cannot be edited here and what the actual path is, instead of presenting a dead end.

Known limitation

Editing stats or adding screenshots to a completed report is refused by the database, not by this UI. resolve_match_report_review short-circuits on status = 'done', and resolve_match_report_review_unpublished additionally requires the match to still be scheduled/live. The upload route's existing 409 on done is consistent with that. Lifting the restriction needs a change to resolve_match_report_review in diese-tech/sal-database — out of scope for this repo. This PR makes the limit visible and honest rather than silently lossy.


Verification

  • npx tsc --noEmit clean; npm run lint reports no new warnings.
  • npm run test781 passed, 26 skipped, 0 failed (up from 775; new coverage for groupPublishedStats/groupRowsByReport and for the not-applied submit path).
  • Driven with Playwright against the real review screen at 1680 / 1200 / 820 / 430px: no horizontal overflow on the document or on any element, and no console errors at any width.
  • Completed-report view verified at 1500px: 70 inputs rendered, all disabled, none editable.

The review step put two `min-w-[480px]` stat tables into a
`2xl:grid-cols-2` split of a column that was itself one third of a
`max-w-7xl` page. Each table was therefore narrower than its own minimum
width, so every game was corrected through two independently
side-scrolling panes with the IGN column pushed off screen, using inputs
that were 10-16px wide and 0.75rem tall.

Layout:
- Replace both tables with TeamStatEditor, a container-query grid: one
  line per player when the card has room, a two-line then three-line wrap
  when it does not. Nothing scrolls sideways at any width.
- Stack the two team cards full width instead of splitting the column in
  half; splitting it was what forced the tables to scroll.
- Collapse the score bar, game tabs and winner picker into one sticky
  control bar. The winner now lives on the team card it applies to,
  instead of a third row repeating both team names.
- Widen the page to 1680px and cap the select/upload/done steps at 3xl so
  they do not stretch.
- Let the report list fold away, so it stops competing with the editor
  for width once a report is open.

Inputs (shared with the host review screen):
- Size them as real form controls: 36px tall, 14px text, focus rings.
- Suppress number spinners, which ate a third of each box.
- Accept a className so callers can size them from their own layout.
- Label every field, and name the unlinked-IGN count on the team header.

Verified with Playwright at 1680/1200/820/430px: no horizontal overflow
on the document or any element, and no console errors.
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sal-draft-league Ready Ready Preview Sep 1, 2026 7:09am UTC

Opening a completed report showed a bare score card with no way to see or
reach the stats behind it. Worse, the submit route could report success
for a write the database never made.

`resolve_match_report_review` returns early for a report already in
"done": it responds `already_processed` / `applied: false` with the
ORIGINAL scores and writes nothing. The route discarded both fields and
always answered `ok: true` with whatever scores came back, so a resubmit
of a published report rendered "Result Submitted" while the corrections
were dropped on the floor.

- Pass `applied` and `code` through the submit route, and have the client
  say the report was already published and nothing changed, instead of
  showing the success screen.
- Open completed reports onto the published stats, read-only, with game
  tabs and the screenshots — rebuilt from `player_match_stats` rather
  than `extracted_data`, which holds the AI/host extraction and never
  receives the admin's review corrections.
- Add `readOnly` to TeamStatEditor so the published view reuses the same
  responsive grid with its fields disabled and its edit affordances gone.
- State plainly in the UI that published stats cannot be edited here and
  what the actual path is, rather than presenting a dead end.

Editing a published report is refused by the database itself, not by this
UI; lifting that needs a change to resolve_match_report_review in
diese-tech/sal-database.
@diese-tech diese-tech changed the title fix(admin): rebuild match-report review layout for readability fix(admin): rebuild match-report review layout, and show completed reports honestly Sep 1, 2026
@diese-tech
diese-tech merged commit 0d6ccb0 into main Sep 1, 2026
17 checks passed
@diese-tech
diese-tech deleted the claude/ui-clutter-scrolling-din3g1 branch September 1, 2026 07:16
diese-tech added a commit that referenced this pull request Sep 1, 2026
The end-to-end suite reached 29 of the app's 38 routes, and the match
report flow had no coverage at all -- which is how its review screen
shipped with two independently side-scrolling stat tables and 40px
inputs (#266).

- match-report.spec.ts covers the area that had none, and drives the
  client into the review step where the stat editors actually render.
  Creating a report is the only Supabase write on that path, so it is
  stubbed; the rest is real client code. That makes four assertions real
  rather than nominal: both editors with ten roster rows, stat inputs
  >=32x36px, nothing under <main> scrolling sideways at 390/768/1440/1920,
  and layout intact after adding a game.
- uncovered-routes.spec.ts covers the token-bound host review and private
  ticket pages, the auth error page, the god draft session page, 404s for
  unknown announcement and scouter ids, and every admin area that had no
  rendering or overflow coverage.
- site.spec.ts asserts the logged-out redirect for all fourteen admin
  routes rather than seven, and opens every nav item.

Two real bugs the new tests caught, both horizontal overflow at 390px:
admin seasons had shrink-0 on a wrapping button group, so a 658px group
ran off a 390px viewport; admin registrations had a filter row that never
wrapped.

397 e2e tests pass, up from 343. The overflow guard was verified by
reintroducing the regression: three of four viewports fail, and 1920
passes because 900px genuinely fits there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant