Skip to content

feat(profiles): let each profile hide clubs it doesn't carry - #284

Open
rickyt19 wants to merge 5 commits into
open-flight:mainfrom
rickyt19:feat/per-profile-club-visibility
Open

rickyt19 wants to merge 5 commits into
open-flight:mainfrom
rickyt19:feat/per-profile-club-visibility

Conversation

@rickyt19

@rickyt19 rickyt19 commented Sep 27, 2026 •

Copy link
Copy Markdown

Adds per-profile club visibility (issue #283). Profile.settings gets an enabled_clubs list; the club picker filters against it, defaulting to showing everything for existing profiles.

What does this PR do?

Adds a per-profile club-visibility toggle. Each profile can now hide clubs
it doesn't carry from the club picker; other profiles are unaffected, and
existing profiles with no customization still see every club (unchanged
behavior). Fixes #283.

Why was this required?

We share one kiosk between people with different bags. Everyone had to
scroll past clubs they don't own every time they picked a club. Hiding
unused clubs per-profile makes club selection faster, especially on the
touchscreen.

Automated tests

  • tests/test_profiles.py: new TestSetEnabledClubs class covering
    ProfileStore.set_enabled_clubs — valid ids accepted, invalid ids dropped,
    dedup, unknown profile_id rejected, non-list rejected, empty list and
    full-club-set both treated as "unfiltered", and persistence round-trip.
  • tests/test_server.py: handle_set_profile_clubs broadcasts enabled_clubs
    correctly, and is a no-op on an unknown profile id.
  • ui/src/components/panel/pickerSections.test.ts: filterSectionsByEnabledClubs
    — unchanged on undefined/empty, filters per-section, drops emptied
    sections, ignores unknown ids.
  • ui/src/components/panel/ClubVisibilityDialog.test.tsx: title, club
    listing/grouping, pre-check behavior, Save/Cancel presence.
  • ProfilesPanel.test.tsx: aria-label for the new manage-clubs button per
    profile.

Manual (human) testing

Ran on a Raspberry Pi kiosk (start-kiosk.sh --sim --camera-capture, real
camera hardware) and in a desktop browser against the same server.

  • Opened a profile's club-visibility dialog, unchecked several irons/woods,
    saved, and confirmed the in-game club picker only showed the remaining
    enabled clubs for that profile.
  • Switched to a different profile and confirmed it still showed its own
    (unfiltered) full club list, unaffected by the other profile's setting.
  • Confirmed picker tile size stays constant regardless of how many clubs
    are enabled (previously it visibly resized as the filtered count changed).
  • Verified the manage-clubs icon renders correctly on both the Pi's
    Chromium-fallback kiosk browser and a desktop browser (the original emoji
    icon rendered as a missing-glyph box on the Pi, which has no emoji font).
  • Confirmed the club-visibility grid no longer requires scrolling on the
    Pi's kiosk screen at 800px width.
mcp-Claude_Browser-blob-1790693020566-dg3dbw mcp-Claude_Browser-blob-1790693008443-fxnh7m

Checklist

  • Single feature/fix — this PR is scoped to one thing with a clear story above
  • Automated tests included — new or updated tests cover this change
  • Manual testing described — I documented what I verified by hand above
  • Python tests pass (uv run pytest tests/ -v) — full suite: 1606 passed, 16 pre-existing failures unrelated to this change (camera, cloud-config, desktop-launcher, sim-transport timing tests — none touch profiles/server/club code)
  • Pylint passes (uv run pylint src/openflight/ --fail-under=9) — 9.72/10
  • Ruff passes (uv run ruff check src/openflight/)
  • UI builds (cd ui && npm run build)
  • UI lint passes (cd ui && npm run lint)
  • Updated docs or CHANGELOG if needed — docs/changelog.md
  • No unrelated changes mixed in

rickyt19 and others added 2 commits September 27, 2026 13:49
Adds per-profile club visibility (issue open-flight#283). Profile.settings gets an
enabled_clubs list; the club picker filters against it, defaulting to
showing everything for existing profiles.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
UNKNOWN was included in the valid-id set for set_enabled_clubs, so it
could be accepted as a filter (leaving the picker empty) and it broke
the 'all real clubs present means unfiltered' check against what the
UI's Select All actually sends, since UNKNOWN is never an offered tile.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rickyt19
rickyt19 marked this pull request as ready for review September 28, 2026 00:31
@rickyt19
rickyt19 requested a review from jewbetcha as a code owner September 28, 2026 00:31

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.

Customize which clubs are visible per profile

1 participant