fix(admin): rebuild match-report review layout, and show completed reports honestly - #266
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This was referenced Sep 1, 2026
Merged
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 a2xl:grid-cols-2split of a column that was itself roughly one third of amax-w-7xlpage. 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 andtext-xs/py-0.5tall.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
TeamStatEditorreplaces 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.max-w-3xlso they don't stretch across it.Inputs (shared with the host review screen via
stat-inputs.tsx)classNameanddisabledso callers can size and lock them from their own layout.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_reviewreturns early for a report already indone: it respondsalready_processed/applied: falsewith the original scores and writes nothing. The submit route discarded both fields and always answeredok: truewith whatever scores came back — so a resubmit of a published report rendered "Result Submitted" while the corrections were silently dropped.appliedandcodethrough the submit route; the client now says the report was already published and nothing changed, rather than showing the success screen.player_match_statsrather thanextracted_data, which holds the AI/host extraction and never receives the admin's review corrections.TeamStatEditorgainsreadOnly, so the published view reuses the same responsive grid with its fields disabled and edit affordances gone.Known limitation
Editing stats or adding screenshots to a completed report is refused by the database, not by this UI.
resolve_match_report_reviewshort-circuits onstatus = 'done', andresolve_match_report_review_unpublishedadditionally requires the match to still bescheduled/live. The upload route's existing 409 ondoneis consistent with that. Lifting the restriction needs a change toresolve_match_report_reviewindiese-tech/sal-database— out of scope for this repo. This PR makes the limit visible and honest rather than silently lossy.Verification
npx tsc --noEmitclean;npm run lintreports no new warnings.npm run test— 781 passed, 26 skipped, 0 failed (up from 775; new coverage forgroupPublishedStats/groupRowsByReportand for the not-applied submit path).