Skip to content

(fix) harden and polish TigerSpot homepage - #19

Merged
Ammaar-Alam merged 2 commits into
mainfrom
fix/homepage-polish
Aug 14, 2026
Merged

(fix) harden and polish TigerSpot homepage#19
Ammaar-Alam merged 2 commits into
mainfrom
fix/homepage-polish

Conversation

@Ammaar-Alam

@Ammaar-Alam Ammaar-Alam commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • make menu authentication and dashboard data loading resilient to duplicate and partial requests
  • improve responsive header and game-card layouts across phone, tablet, and desktop widths
  • use accessible foreground colors, semantic headings, live loading status, and reduced-motion handling
  • resolve shared icon and stat-card typing while preserving existing fallback behavior in other routes

Testing

  • pnpm --filter tigerspot-new build
  • pnpm --filter tigerspot-new check (retains four pre-existing dynamic-route parameter errors outside this change)

Before

Screenshot_2026-08-14_14-08-55 Screenshot_2026-08-14_14-11-38

After

Screenshot_2026-08-14_14-13-30 Screenshot_2026-08-14_14-14-23

(PR written by Codex)

@Ammaar-Alam
Ammaar-Alam marked this pull request as ready for review August 14, 2026 18:15
Copilot AI lite review requested due to automatic review settings August 14, 2026 18:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c25aa3c12c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +30 to +31
if (this.loadPromise) {
return this.loadPromise;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Force a fresh user load after dev login

If a developer opens and submits the custom dev-login form while the initial /api/auth/me request is still pending, devLoginAs() completes the login POST and calls load(), but this branch reuses the pre-login request instead of fetching the newly authenticated user. The method then reports success and navigates to /menu with user still null, causing an immediate redirect back to the login page. Authentication-changing operations need to bypass or invalidate the in-flight load before refreshing the user.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh not in my scope idc 😇

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the frontend homepage/menu experience by making user/auth and dashboard data loading more resilient, while also polishing responsive layout and accessibility across shared UI components.

Changes:

  • Updated getChallenges() / listTournaments() to return null on failure and adjusted callers to handle fallbacks safely.
  • Added resilient menu loading with partial-failure handling, accessible loading status, and retry UI; deduped concurrent userStore.load() calls.
  • Polished shared UI (Header, cards, icons, colors, reduced motion) for improved responsiveness and accessibility.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/frontend/src/routes/versus/+page.svelte Handles getChallenges() possibly returning null by falling back to empty response.
apps/frontend/src/routes/tournament/+page.svelte Falls back to [] when tournaments API returns null.
apps/frontend/src/routes/menu/+page.svelte Adds resilient parallel loading with status messaging and retry UI.
apps/frontend/src/routes/layout.css Adds --color-orange-ink, improves button foreground contrast, and adds reduced-motion handling.
apps/frontend/src/routes/admin/tournaments/+page.svelte Falls back to [] when tournaments API returns null.
apps/frontend/src/routes/admin/+page.svelte Falls back to [] when tournaments API returns null.
apps/frontend/src/lib/stores/user.svelte.ts Dedupes concurrent user loads via an internal loadPromise.
apps/frontend/src/lib/components/StatCard.svelte Renames valueColorvalueClass and removes incorrect style usage.
apps/frontend/src/lib/components/icons.ts Exports IconDefinition type for reuse.
apps/frontend/src/lib/components/Icon.svelte Uses exported IconDefinition type for stronger typing.
apps/frontend/src/lib/components/Header.svelte Refactors nav items and adds active-route styling / accessibility attributes.
apps/frontend/src/lib/components/GameModeCard.svelte Improves layout wrapping and readability for small screens.
apps/frontend/src/lib/components/Card.svelte Switches variant colors to use CSS variables for consistency.
apps/frontend/src/lib/api/versus.ts Changes getChallenges() to return null on error/missing data.
apps/frontend/src/lib/api/tournament.ts Changes listTournaments() to return null on error/missing data.
Suppressed comments (1)

apps/frontend/src/lib/components/Header.svelte:27

  • After switching to $app/stores, the page import is a store and needs to be referenced as $page in the template. Otherwise page.url will not be the current URL and can cause runtime/compile issues.
					aria-current={page.url.pathname === item.href ? 'page' : undefined}
					class="min-h-11 min-w-11 px-2 font-bold text-sm uppercase transition-colors inline-flex items-center justify-center gap-2 {page
						.url.pathname === item.href
						? 'text-orange-ink'
						: 'hover:text-orange-ink'}"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -1,41 +1,35 @@
<script lang="ts">
import { page } from '$app/state';
Comment on lines +77 to +86
if (statsData) stats = statsData;
if (challengesData) {
pendingChallenges = challengesData.received.length + challengesData.active.length;
}
if (tournamentsData) {
activeTournaments = tournamentsData.filter(
(t) => t.status === 'open' || t.status === 'in_progress'
).length;
}
if (dailyData) dailyCompleted = dailyData.hasPlayed;
@Ammaar-Alam
Ammaar-Alam merged commit 8329502 into main Aug 14, 2026
1 check passed
@Ammaar-Alam
Ammaar-Alam deleted the fix/homepage-polish branch August 14, 2026 18:22
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