Skip to content

geoword: filter the Packet page's buzzes by team - #657

Open
dn285 wants to merge 5 commits into
qbreader:mainfrom
dn285:geoword-packet-buzz-filter
Open

dn285 wants to merge 5 commits into
qbreader:mainfrom
dn285:geoword-packet-buzz-filter

Conversation

@dn285

@dn285 dn285 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Players can now narrow the Packet page's buzzes to any set of teams, for example their own team and an opponent. Coming later: player filters, then a simulated head-to-head result for the teams shown, which feeds W-L-T standings.

Summary

  • Team filter: a "Showing" line above the questions.
    • Chosen teams appear as chips, each with an × to remove it. With none chosen, it reads "Showing every buzz".
    • A small ⊕ opens a menu of the division's teams with checkboxes. The viewer's team comes first, marked "(your team)".
    • The menu has a search box, which gets the cursor when the menu opens and clears when it closes. The menu stays open while you tick several teams.
    • "Clear" removes every chosen team.
  • What the filter changes: each question's buzz table, graph and per-clue counts include only the chosen teams' buzzes. Players without a team are hidden while a filter is on.
    • Filtering redraws only those parts of each question, never the <audio> element, so the clip being played isn't touched.
    • It runs in the browser on the buzzes the page already loads. There are no server changes.
  • Combining filters: a buzz is shown if it matches any chosen filter (a union), so player filters can be added later without changing how teams work (client/play/geoword/results/packet/filter.js).
  • Divisions: each division tab has its own filter, since divisions never share teams.
  • Linkable: the selection is kept in the URL as &team=A&team=B via replaceState. Team names that aren't in the packet are dropped from the URL on load.
  • Toolbar: the filter and the question-number links share one bar.
    • From md up, the bar sticks to the top of the screen while scrolling.
    • The number of the question being read is highlighted.
    • Jumping to a question lands its heading just below the bar.
    • On phones the bar wraps onto three lines, so it scrolls away normally instead.
  • Question links are all the same width: wide enough for two digits.
  • Title row: "Back to stats page" moves to the right of the title, which loses its colon. On phones the link sits under the title.

Testing

  • Local setup: the seeded demo from node tools/geoword/upload-packet.js --mode test -n soundtracks --set september --scoring neg5 has 6 teams and 276 buzzes. Log in as soundtracks-admin / password and open /play/geoword/results/packet?packetName=soundtracks.
  • Checked in headless Chrome, scripted, at 1400px and 390px:
    • Loading with team=Solo Act and a team name that doesn't exist shows Solo Act's 10 buzzes, and the URL drops the made-up team.
    • Adding Earworms shows 50 buzzes (40 + 10). Removing the Solo Act chip shows 40. "Clear" shows all 276.
    • At each step the clue counts add up to the number of rows, all 10 graphs redraw, and the URL matches the selection.
    • Search narrows the menu ("deep" → Deep Cuts) and shows "No teams match." when nothing matches.
    • After a chip is removed or "Clear" is used, focus moves to the ⊕ button.
    • Jumping to question 6 on desktop: the bar sticks at the top, question 6 is highlighted, and the heading lands 16px below the bar.
    • Jumping to question 6 on a phone: the bar has scrolled away, and the heading lands 16px from the top of the screen.
    • The page never scrolls sideways at 390px.
    • No console errors.
  • Lint: semistandard is clean.
  • Not tested:
    • Playing audio through a filter change. Audio doesn't load in headless Chrome.
    • More than one division: the demo packet has one.
    • The "(your team)" label: the test account isn't on a team.
    • Screen readers and real touch devices.

🤖 Generated with Claude Code

dn285 and others added 5 commits October 28, 2026 21:14
Players can narrow each question's buzz table, graph and clue counts to any
combination of teams. Chosen teams show as removable chips, added from a
searchable menu, and are kept in the URL (team=...) so a view can be linked.
The filter shares a row with the question links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The toolbar sticks to the top of the screen from md up, and jumping to a
question lands its heading below it. On phones it wraps onto several lines,
so it scrolls away instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The link for the last question whose heading has scrolled up to the toolbar
is marked active, and aria-current for screen readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each link is as wide as a two-digit one, so 1-9 no longer look narrower
than 10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The back link sits to the right of the centered title, which loses its
colon, saving a row above the toolbar. On phones it sits under the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dn285
dn285 force-pushed the geoword-packet-buzz-filter branch from 9bd41f1 to 5021988 Compare October 29, 2026 02:16

This branch has not been deployed

No deployments
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