Skip to content

fix(dogfood 2026-06-16-e2e): data-aware dashboard empty state + finding reconciliation (ISSUE-001..005)#151

Merged
engels74 merged 2 commits into
mainfrom
fix/dogfood-findings-2026-06-16-e2e
Jun 18, 2026
Merged

fix(dogfood 2026-06-16-e2e): data-aware dashboard empty state + finding reconciliation (ISSUE-001..005)#151
engels74 merged 2 commits into
mainfrom
fix/dogfood-findings-2026-06-16-e2e

Conversation

@engels74

Copy link
Copy Markdown
Owner

Summary

Triage-first remediation of the 2026-06-16 end-to-end dogfood findings (dogfood-output/report.md, ISSUE-001..005 + INFO-001). The run reported PASS overall with 5 low-severity items. On code inspection, 2 of 5 were contradicted by the source and 1 is by-design, so this change fixes only what is real, satisfies the discoverability intent without regressing a load-bearing invariant, and closes the false positives with evidence rather than padding the diff.

Changes

ISSUE-003 - Dashboard empty-state copy is now data-aware (confirmed bug)

The /dashboard subtitle previously read "Your Plex Wrapped for {year} is ready to explore" unconditionally, including for members with no synced history (whose personal Wrapped then shows an empty state). The subtitle is now gated on the existing wrappedHref signal: data-having members keep the original copy; no-data members get accurate empty-state copy. No new server call and no share_settings mint.

ISSUE-004 - No-data personal-card affordance (resolved by copy; link-gating is by-design)

No-data members now see a static, non-link empty-state personal card explaining where and when their Wrapped will appear. A live personal-Wrapped link is intentionally withheld for 0-play users: getOwnerWrappedHrefIfData returns null by design to prevent SvelteKit hover-preload firing a 404 and to prevent getOrCreateShareSettings lazily minting a share_settings row on every no-data load (the duplicate-row HIGH-severity incident class from #150). The affordance is a <div>, not an <a>, and contains no /wrapped/.../u/... href, hand-constructed or computed.

ISSUE-002 - Confirm-dialog focus behavior (verified, documented)

The bulk-apply confirmation dialog on /admin/settings/privacy already uses the focus-trapping bits-ui AlertDialog.Content primitive. Added source-guard tests pinning that wiring. No production change: a Bun source suite cannot assert runtime focus movement, so this documents and locks the primitive rather than hand-rolling a trap. Escalate to a Playwright assertion only if the trap is ever proven broken.

ISSUE-001 - Console JSON-parse warning (closed as external)

No unguarded client-side JSON.parse runs on /wrapped/2026: the only client parses are try/catch-guarded (sync-status.svelte.ts) or live on other routes (admin logs/sync, onboarding, plex-login). The literal text Unable to parse JSON: "undefined" is not V8/Bun native wording (native begins with Unexpected token), indicating a third-party script - consistent with the Google Identity Services deprecation warning observed on the same page. No code change.

ISSUE-005 - Thumbnail-proxy token TTL (false positive, closed with proof)

The token TTL is already 30 minutes (TOKEN_TTL_SECONDS = 30 * 60, single mint path), not ~1 year. The year:2026 payload field is the Wrapped year, not an expiry. Added a decoded-token proof test asserting exp - mint-time is approximately 1800 seconds.

INFO-001 (public landing lookup disabled) is an intentional config choice and out of scope.

Files changed

  • src/routes/dashboard/+page.svelte - data-aware subtitle and non-link empty-state personal card
  • tests/unit/dashboard/dashboard-empty-state.test.ts (new) - source-guards for the subtitle gate and the no-link affordance
  • tests/unit/admin/dogfood-ui-invariants.test.ts - source-guards for the bits-ui AlertDialog focus-trapping primitive
  • tests/unit/plex/thumbnail-auth.test.ts - decoded-token ~30-minute TTL proof
  • dogfood-output/report.md (gitignored) - status annotations for ISSUE-001..005

Verification

  • bun run check - 0 errors
  • bun run test - 2151 pass / 0 fail, coverage >= 80% line/function
  • bun run check:biome - clean

Notes

  • The net code change is intentionally smaller than the finding count: 3 of 5 items were false positives, external, or by-design.
  • The getOwnerWrappedHrefIfData / getOwnerWrappedHref helper contracts are unchanged, so the admin blast radius (admin/+layout.server.ts shares the helper) and the fix(dogfood 2026-06-16): remediate ISSUE-001/002/003 #150 no-mint/no-preload invariant are preserved.

…ng reconciliation (ISSUE-001..005)

Triage-first remediation of the 2026-06-16 e2e dogfood findings: fix the
confirmed UX bug, satisfy the discoverability intent without regressing a
load-bearing invariant, and close the false positives with proof.

- ISSUE-003 (W1a): dashboard subtitle is now data-aware. No-data members no
  longer see "ready to explore"; they get accurate empty-state copy. Driven by
  the existing wrappedHref signal - no new server call, no share_settings mint.
- ISSUE-004 (W1b): no-data members get a static, NON-LINK empty-state personal
  card explaining where/when their Wrapped appears. A live personal-Wrapped link
  is intentionally withheld for 0-play users: getOwnerWrappedHrefIfData returns
  null by design to avoid hover-preload 404s and share_settings lazy-minting
  (the #150 incident class). Link-gating is documented as by-design.
- ISSUE-002 (W2): the bulk-apply confirm dialog already uses the focus-trapping
  bits-ui AlertDialog.Content primitive; added source-guards pinning the wiring.
  No production change (a Bun source suite cannot assert runtime focus movement).
- ISSUE-001 (W3): closed as external. No unguarded client JSON.parse runs on
  /wrapped/2026; the "Unable to parse JSON" prefix is not V8/Bun native wording,
  indicating a third-party script (Google Identity Services). No code change.
- ISSUE-005 (W4): false positive. Thumbnail token TTL is 30 min, not ~1 year
  (TOKEN_TTL_SECONDS = 30 * 60); the year:2026 payload field is the Wrapped year,
  not an expiry. Added a decoded-token proof test asserting exp - mint ~= 1800s.

Verification: bun run check (0 errors), bun run test (2151 pass / 0 fail,
coverage >= 80%), bun run check:biome (clean).
@augmentcode

augmentcode Bot commented Jun 17, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR remediates 2026-06-16 dogfood findings by making the dashboard reflect whether a user actually has synced plays for the current year, and by adding “source-guard” tests to prevent regressions.

Changes:

  • Dashboard subtitle is now gated on data.wrappedHref, showing an accurate empty-state message when no personal Wrapped link is available.
  • Personal Wrapped card now renders a non-link empty-state card (a <div>) when wrappedHref is null, avoiding hover-preload and avoiding minting share settings for 0-play users.
  • Adds CSS overrides for .wrapped-card.empty to suppress hover affordances on the non-interactive empty-state card.
  • Adds a new unit test file that source-guards the dashboard subtitle gate and the “no-link” invariant for the empty personal card.
  • Adds unit source-guards asserting the admin privacy bulk-apply confirm dialog continues to use the bits-ui AlertDialog primitive (focus-trap wiring).
  • Adds a thumbnail token test that decodes the JWT and proves the TTL is ~30 minutes (not ~1 year), with CI-robust timing bounds.

Technical Notes: The UI behavior change is driven entirely by the existing wrappedHref signal (no new server calls), and the new tests intentionally validate template wiring via source inspection to cover UI invariants without a DOM harness.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/routes/dashboard/+page.svelte
Comment thread tests/unit/plex/thumbnail-auth.test.ts Outdated
- dashboard: suppress empty-state card icon hover scale so the 'no data' card reads as non-clickable (ISSUE 3431266106)

- thumbnail-auth test: bound token exp two-sidedly against before/after mint captures to remove slow-CI flakiness while preserving the ~30min-not-1yr proof (ISSUE 3431266114)
@engels74

Copy link
Copy Markdown
Owner Author

augment review

@augmentcode augmentcode 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.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@engels74
engels74 merged commit 5d917d0 into main Jun 18, 2026
3 checks passed
@engels74
engels74 deleted the fix/dogfood-findings-2026-06-16-e2e branch June 18, 2026 07:07
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