Skip to content

refactor(lobby): consolidate server management + lobby polish#347

Merged
91jaeminjo merged 10 commits into
mainfrom
polish/lobby-server-actions
Jun 12, 2026
Merged

refactor(lobby): consolidate server management + lobby polish#347
91jaeminjo merged 10 commits into
mainfrom
polish/lobby-server-actions

Conversation

@WilliamKarolDiCioccio

@WilliamKarolDiCioccio WilliamKarolDiCioccio commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Lobby polish from a design review with Erik. Stacked on feat/onboarding (PR #346) since it builds on those commits.

Changes

Room cards

  • Front the relative "last activity" time (list + grid) with a small muted clock icon + a Last activity tooltip, instead of printing the label on every card.

Server management — one surface

  • Removed the dedicated /servers ServerListScreen (route, sidebar gear, onboarding "All servers" link, AppRoutes.servers, public-path entry).
  • Server actions now live in a per-tile ⋮ menu on the sidebar: Sign in (disconnected) / Log out (connected + auth) / Remove. A connected+auth Remove logs out first; everything else removes outright.
  • The ⋮ reveals on hover and stays shown for the selected tile (so it's reachable without a mouse); the slot is reserved so the title doesn't shift.
  • Extracted the platform-conditional logout logic into a shared auth/server_logout.dart (logoutServer + friendlyLogoutError); the tile menu reads the auth providers and surfaces failures inline on the tile (a persistent error icon, never a SnackBar).

Lobby pane tidy-ups

  • Dropped the rooms-pane server-address heading (the selected server is named in the sidebar).
  • Dropped the per-tile auth/identity status subtitle (identity → account block, connection state → ⋮ menu).
  • Below the tablet (600) breakpoint the list/grid toggle is hidden and the view is forced to list; the persisted choice is untouched and honoured again ≥600.

Tests

  • Deleted the two server_list_screen suites; rewired the auth/lobby suites; added ⋮-menu + hover-reveal coverage. Sidebar-tile tests now wrap in a ProviderScope (the menu is a ConsumerWidget).
  • Full suite green; flutter analyze clean.

Open question

The per-tile auth-status subtitle removal is pending a colleague's answer on whether to reinstate that indicator in some form — easy to dial back if so.

🤖 Generated with Claude Code

Base automatically changed from feat/onboarding to main June 12, 2026 21:00
WilliamKarolDiCioccio and others added 3 commits June 12, 2026 16:08
Front the relative "last activity" time on both the list and grid room
cards with a small muted clock icon, wrapped in a "Last activity"
tooltip — so the recency reads at a glance without printing the words on
every card.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Following a design review with Erik, consolidate server management and
tidy the lobby:

- Remove the dedicated /servers ServerListScreen (route, sidebar gear,
  onboarding "All servers" link, AppRoutes.servers, public-path entry).
  Server actions now live in a per-tile vertical-more menu on the
  sidebar: Sign in (disconnected) / Log out (connected + auth) / Remove.
  The menu reveals on hover and stays shown for the selected tile so
  it's reachable without a mouse; the slot is reserved so the title
  doesn't shift.
- Extract the platform-conditional logout logic into a shared
  auth/server_logout.dart (logoutServer + friendlyLogoutError); the tile
  menu reads the auth providers and surfaces failures via SnackBar.
- Drop the rooms-pane server-address heading — the selected server is
  named in the sidebar.
- Drop the per-tile auth/identity status subtitle — identity lives in
  the account block, connection state in the menu.
- Below the tablet (600) breakpoint, hide the list/grid toggle and force
  list view; the persisted choice is untouched and honoured again >=600.

Tests: delete the two server_list_screen suites, rewire the auth/lobby
suites, and add menu + hover-reveal coverage. Sidebar-tile tests now
wrap in a ProviderScope since the menu is a ConsumerWidget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restore the auth-status signal removed in the previous commit as a small
colored leading dot on each sidebar server tile:

- green (success) — auth required and signed in;
- red (danger) — auth required but not signed in (or expired);
- neutral (onSurfaceVariant) — no authentication required.

Derived from the per-entry session signal (no extra API call — /api/user_info
only feeds the account-block name), so the dot lives in a Watch and updates
on sign-in / expiry without a server-map mutation. The tooltip carries the
same status as text for accessibility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@91jaeminjo 91jaeminjo force-pushed the polish/lobby-server-actions branch from 4aba73f to 76738ef Compare June 12, 2026 21:16
91jaeminjo and others added 7 commits June 12, 2026 17:41
…rdance

A failed log-out preserves the local session, so the failure needs to stay
visible. Replace the transient SnackBar with a red error icon in the tile's
trailing slot: its tooltip carries the message, and tapping it opens a dialog
with the full text plus Try again / Dismiss. The dialog is the surface a touch
user reads the error on, since hover tooltips aren't reachable there.

Distinguish the remove path from a plain log-out in both the dialog title and
the debug log — a remove-path failure keeps the server rather than removing it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restate the section-label, status-dot, and activity-clock comments as
present-tense design rationale, and remove the status-dot colour legend that
duplicated the authoritative one on _StatusDot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make logoutServer's platform branch a `web` seam (defaulting to kIsWeb) so the
web and native orderings it exists to protect are both reachable in VM tests,
then pin them: native clears local only after endSession returns and never
pre-fetches discovery; web clears local before navigating and passes the
discovered end_session_endpoint; a failed endSession (native) or discovery
fetch (web) preserves the session. Add friendlyLogoutError formatting cases,
including the generic no-type-name path. Cover the sidebar log-out success and
the log-out-before-remove branch for a connected authenticated server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the log-out failure dialog (Try again / Dismiss) with a popup menu on
the tile — Try again / Show error detail / Remove server — so the trailing
slot stays a menu in every state instead of switching to a dialog. "Remove
server" makes a best-effort sign-out and removes the entry regardless of the
outcome, so a server whose IdP log-out keeps failing can still be removed.

Model the three post-log-out outcomes (keep / remove on success / remove
regardless) as an `_AfterLogout` enum rather than a `removeAfter` bool.

Log when a web sign-out finds no `end_session_endpoint`: local state is
cleared but the IdP session can't be ended, so surface that partial log-out
instead of returning silently.

Tidy a few comments: drop temporal phrasing from the rooms pane and describe
the web log-out as a full-page navigation rather than a sheet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Exercise the log-out failure menu (Try again / Show error detail / Remove
server), the remove-regardless escape hatch when sign-out keeps failing, and
the in-flight gate that replaces the tile menu so a second action can't fire
while a sign-out is outstanding.

Assert that below the tablet breakpoint a persisted grid choice is forced to
list and the view-mode toggle is hidden.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ging

Switch on `_AfterLogout` in the tile menu's logout handler so adding a
disposition is a compile error rather than a silent misclassification by
an `==`/`!=` chain. Log the web "no end_session_endpoint" partial logout
at warning level so the cleared-local-only outcome is visible in
production. Describe the `_AfterLogout` enum by its present outcomes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Log at warning level when an active session has no id_token, since the
RP-initiated logout then omits id_token_hint and the IdP may not end its
session. Rename `_LogoutFailure.wasRemove` to `removalWasIntended` so it
names what it means, and describe the error affordance as widget state
that resets when the menu is disposed. Cover the web no-end_session_endpoint
path: local is still cleared and endSession still runs with a null endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@91jaeminjo 91jaeminjo merged commit bbe2ae3 into main Jun 12, 2026
6 checks passed
@91jaeminjo 91jaeminjo deleted the polish/lobby-server-actions branch June 12, 2026 23:49
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.

2 participants