Skip to content

Launch readiness: player/queue/purchase a11y, color contrast, route audit, onboarding tests - #875

Merged
Akatenvictor merged 10 commits into
AudioBitsStellar:mainfrom
d-plug:launch-readiness/a11y-and-product-audit
Nov 25, 2026
Merged

Akatenvictor merged 10 commits into
AudioBitsStellar:mainfrom
d-plug:launch-readiness/a11y-and-product-audit

Conversation

@d-plug

@d-plug d-plug commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #850, Closes #851, Closes #852, Closes #853

Working through these four pre-launch hardening items turned up two
build-breaking, pre-existing bugs on main that blocked verifying any of
the actual fixes (tsc, the dev server, and the whole test suite), so
those are fixed first; the rest of the PR is the four issues themselves.

Found and fixed along the way (blocking everything else)

  • context/PlaybackContext.tsx had an unresolved "split playback
    contexts" refactor: two conflicting const value declarations in the
    same scope, which is invalid JS, not just a type error — it broke
    Next.js, Vite, and every test that imports the Player, the queue, or
    auth (directly or transitively).
  • lib/stellarExplorer.ts had two unresolved getStellarContractUrl
    implementations spliced together, a syntax error that failed tsc for
    the whole project.

#850 — Screen-reader and keyboard pass on the player, queue, and purchase flow

  • Queue row's "Remove" button was permanently invisible (group-hover
    with no group class on the row) — to everyone, not just keyboard
    users.
  • Shuffle/repeat toggle state was color-only; added aria-pressed.
  • Player's "More options"/speed popovers had no Escape handling or focus
    return.
  • Purchase errors weren't announced (role="alert" added).
  • AuctionBidDialog and ListNFTDialog were hand-rolled, non-trapping
    dialogs; replaced with the shared accessible Modal component.
  • Checklist and defect list: A11Y_PLAYER_QUEUE_PURCHASE_AUDIT.md.

#851 — Color contrast audit

  • bg-surface/bg-surface-input/bg-surface-elevated/bg-surface-hover
    (84 occurrences, 32 files) and the shadcn/ui semantic token set
    (primary, secondary, accent, destructive, card, ring, …)
    were referenced everywhere but never defined — Tailwind v4 silently
    drops an undefined utility, so every one of those panels, inputs, and
    buttons rendered with no color at all. Defined both token families
    with contrast verified against the text already paired with them.
  • Fixed a border-border-muted typo (should've been border-border-dark)
    and one literal text-gray-400 that fails AA in light mode.
  • Report: COLOR_CONTRAST_AUDIT.md.

#852 — Launch scope audit (marketplace, community voting, merch, events)

  • Merch/events/community voting are already correctly flag-gated.
    Marketplace trading (buy/bid/list) was not, despite being just as
    unfinished — useSorobanRelay has no wallet-signing implementation,
    and AuctionBidDialog/ListNFTDialog called hook methods that don't
    exist on it (confirmed via tsc). Added a marketplaceTrading flag
    (same default behavior as the existing flags) and gated all three
    entry points; fixed the two dialogs to call the hook's real API so a
    failure is a readable error instead of a crash.
  • Go/no-go table for every route against docs/api-contract.md:
    LAUNCH_SCOPE_AUDIT.md.

#853 — Onboarding and first-run experience with empty states

  • The onboarding page's six-step flow had no test coverage. Added
    tests/app/OnboardingPage.test.tsx (7 tests) against its existing
    behavior.
  • components/ui/EmptyState.tsx was dead code (never imported) and
    didn't match the app's design tokens or theming strategy; fixed its
    tokens and a pre-existing JSX namespace error so it isn't broken if
    it gets adopted.
  • Audited every first-run list (recently played, followed playlists,
    library, playlists, search, notifications) for empty-state handling:
    ONBOARDING_EMPTY_STATES_AUDIT.md.

Test plan

  • npx tsc --noEmit — error count reduced; remaining errors are
    pre-existing and unrelated (wagmi/msw/@playwright/test not in
    package.json, @creit.tech/stellar-wallets-kit API mismatch,
    etc. — flagged in LAUNCH_SCOPE_AUDIT.md, not touched here).
  • npx vitest run — 997/1082 passing (up from 987/1072 before this
    branch, i.e. the whole suite could not even execute until the
    PlaybackContext.tsx fix); the 85 remaining failures are
    pre-existing and unrelated (confirmed via git stash before/after
    comparison on each one touched by this PR).
  • New/changed behavior has test coverage where the repo has any
    (QueueDrawer, stellarExplorer, featureFlags, CollectionPage,
    the new OnboardingPage tests). PlayerControls/PlayerActions/
    BuyButton/AuctionBidDialog/ListNFTDialog have no existing
    test files to extend — verified by reading the resulting
    markup/behavior directly, noted in the audit docs rather than
    claiming coverage that doesn't exist.

- PlayerControls: expose shuffle/repeat toggle state via aria-pressed
  instead of color alone.
- QueueDrawer: the per-row Remove button relied on group-hover but its
  row never had the `group` class, so it was invisible to everyone and
  unreachable by keyboard focus; add the class and reveal on
  focus-within too.
- PlayerActions: close the More-options and playback-speed popovers on
  Escape and return focus to their trigger, matching the rest of the
  player's menu behavior.
- BuyButton: mark the purchase error message as role="alert" so it's
  announced to screen reader users.
- AuctionBidDialog/ListNFTDialog: replace the hand-rolled, non-trapping
  modal markup with the shared accessible Modal component (focus trap,
  Escape to close, aria-modal, focus restore on close), matching
  BuyButton's existing confirm dialog.
getStellarContractUrl had two unresolved implementations spliced
together (a plain env-based builder and a newer one that validates
the contract ID before building a URL), which was a syntax error that
failed tsc for the entire project. Keep the validating version,
default to the env-configured network when no explicit network is
passed, and let callers pass a network explicitly (as OnChainInfo
already did).

ExplorerLink rendered contract links assuming the builder always
returns a string; it can now return null for a malformed ID, so skip
rendering the link instead.

Also drop lib/__tests__/stellarExplorer.test.ts, a stale pre-validation
duplicate of tests/lib/stellarExplorer.test.ts whose fixture contract
IDs contain characters outside the StrKey alphabet and only passed
before validation was added.
An earlier merge of the "split playback contexts" refactor left two
conflicting implementations in PlaybackProvider: a pre-refactor
useMemo that built the whole context value under the name `value`,
and the refactor's own tail that expects a separate `actions` object
feeding PlaybackActionsContext. The result was `const value` declared
twice in the same scope, `useCallback` used without being imported, and
references to action creators (addToQueue, recordPlay, etc.) that only
ever existed as properties of the stray first object.

This wasn't just a type error: the duplicate `const` is invalid JS, so
Next.js, Vite and every test file that imports PlaybackContext (directly
or transitively through the Player, the queue, auth, etc.) failed to
even transform. Renamed the first block to `actions` (typed as
`PlaybackActions`, which already exists for exactly this purpose),
pointed its crossfade/normalize/gapless members at the standalone
useCallbacks defined just above instead of re-creating them inline,
trimmed its dependency array down to what it actually closes over, and
added the missing `useCallback` import. Also added two imports
(`demoOr`, `demoPlaylist`) the default-playlist line needed but never
had.

Verified with `tsc --noEmit` (previously failed on this file) and the
test suite: 987 passing tests went from unable to run at all to passing
unchanged.
… dropping

Audited the design tokens behind every color utility class in
components/ and app/. Two whole families were referenced everywhere
but never defined in app/globals.css, so Tailwind v4 silently drops
the class with no build error:

- bg-surface / bg-surface-input / bg-surface-elevated / bg-surface-hover:
  84 occurrences across 32 files (modals, dropdowns, inputs, cards,
  the player bar). Every one of those panels was rendering with no
  background at all. Added a fixed dark panel hierarchy, since all of
  it is already paired with literal text-white/border-border-dark
  rather than the theme-aware --foreground.
- The shadcn/ui semantic set (primary, secondary, accent, destructive,
  muted-foreground, input, ring, card, card-foreground) that
  components.json's cssVariables: true implies and that
  components/ui/{button,badge,card,input,tooltip}.tsx depend on.
  Button in particular renders on real pages (transactions,
  all-artists, all-collections, the session-expiry modal) and had no
  intentional color in any variant.

Chose values with verified WCAG AA contrast against the white/gray
text already used alongside them (white-on-surface ~15-19:1,
gray-400-on-surface ~6.8:1, white-on-destructive ~4.8:1,
white-on-primary ~5.4:1).

Also fixed a typo, hover:border-border-muted, the one place that
diverged from the border-border-dark used everywhere else in the
dashboard — it referenced a token that never existed, so the hover
state never showed.
- app/(home)/search/page.tsx: the loading fallback used literal
  text-gray-400 against the page's theme-toggled background, which
  fails AA (~2.5:1) in light mode. Switched to the project's own
  theme-aware text-on-muted token, already used for this purpose
  elsewhere.
- Added COLOR_CONTRAST_AUDIT.md documenting the audit method, the
  token-definition failures fixed in the previous commits, and what
  was checked but left alone (175 other gray-400/500 usages, all
  already on dark backgrounds that clear AA; the dashboard's
  inconsistent-but-individually-fine hardcoded panel colors).
docs/api-contract.md already tracks merch/events/community voting as
unfinished and gated behind flags (AudioBitsStellar#637), but marketplace buying,
bidding, and listing had no flag at all despite being just as
unfinished: useSorobanRelay unconditionally throws "Wallet signing not
yet implemented" right after prepare, and the path it's documented to
call doesn't match any mounted backend route.

It was worse than un-flagged, though: AuctionBidDialog and
ListNFTDialog called useSorobanRelay() with zero arguments and
destructured `relay`/`isPending`, neither of which exists on the hook
(confirmed via tsc — this was a hard compile error). Only BuyButton
called the hook the way it's actually implemented (pass prepare/submit
functions, get back run/status/error). Rewrote both dialogs to the
real API, matching BuyButton's pattern, so they at least fail with a
catchable, user-visible error instead of a TypeError on first click.

Added a `marketplaceTrading` flag (same shape and default behavior as
the existing merch/events/communityVoting flags: off in production, on
in development) and gated all three entry points behind it:
BuyButton renders a disabled "Coming soon" button, the NftCollections
bid button and the collection page's "List for sale" button disable
themselves with an explanatory title instead of opening a dialog that
can only ever error.
- tests/app/OnboardingPage.test.tsx: the onboarding flow's six defined
  steps (auth guard, listener save + redirect, returnTo default,
  artist confirmation step, retry-after-failure, skip) had no test
  coverage at all, only the redirect guard and the localStorage flag
  did. 7 new tests pass against the page's existing behavior.
- components/ui/EmptyState.tsx was never imported anywhere despite
  having illustrations for scenarios already handled elsewhere
  (recently played, followers, collections). Fixed its tokens to
  match the app's actual design system (it used Tailwind's OS-driven
  dark: variant, which this app doesn't configure, and a teal accent
  instead of the brand color) and a pre-existing JSX-namespace tsc
  error, so it's no longer broken if it gets adopted later.
- Added ONBOARDING_EMPTY_STATES_AUDIT.md documenting both the steps
  covered and what was checked and left alone (RecentlyPlayed and
  FollowedPlaylistsList correctly hide rather than show a message when
  empty; notifications' empty state is a backend gap, not a UI one).
@drips-wave

drips-wave Bot commented Nov 20, 2026

Copy link
Copy Markdown

@d-plug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Akatenvictor
Akatenvictor merged commit 1be8d48 into AudioBitsStellar:main Nov 25, 2026
3 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants