Skip to content

fix(SDK-1231): add paystub download loading indicator to PayrollOverview - #2653

Merged
serikjensen merged 6 commits into
mainfrom
SDK-1231
Aug 27, 2026
Merged

fix(SDK-1231): add paystub download loading indicator to PayrollOverview#2653
serikjensen merged 6 commits into
mainfrom
SDK-1231

Conversation

@serikjensen

@serikjensen serikjensen commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Port the new-tab loading spinner from PaystubsCard into PayrollOverview's paystub download, so users see a "Generating paystub…" spinner instead of a blank tab while the PDF fetches
  • Fix the blob URL revoke race (deferred to the load event instead of synchronous)
  • Add per-row isLoading on the download button while the fetch is in flight
  • Extract shared new-tab logic into openPdfInNewTab helper to prevent the two implementations from drifting apart

Test plan

  • On a processed payroll in PayrollOverview, click a paystub download icon — new tab should show spinner, then navigate to the PDF
  • Verify the download button shows a loading spinner while the fetch is in flight
  • Verify PaystubsCard download still works identically (uses the same shared helper now)
  • npm run test -- --run passes (47 tests across PayrollOverview + PaystubsCard suites)
Screen.Recording.2026-08-26.at.4.35.23.PM.mov
Screen.Recording.2026-08-26.at.4.48.20.PM.mov

(Posted by Claude on behalf of Steve)

🤖 Generated with Claude Code

serikjensen and others added 2 commits August 25, 2026 14:50
PayrollOverview's paystub download opened a blank tab while fetching the
PDF. Port the spinner + deferred blob-revoke pattern from PaystubsCard,
extract shared new-tab logic into openPdfInNewTab helper, and add
per-row button loading state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@serikjensen
serikjensen requested a review from a team as a code owner August 26, 2026 22:38
@serikjensen
serikjensen enabled auto-merge August 27, 2026 18:23
serikjensen and others added 3 commits August 27, 2026 12:49
Set gcTime: 0 on the payroll query in PayrollOverview so the cache entry
is garbage-collected immediately when the component unmounts. Previously,
the default 5-minute gcTime let a stale pre-calculation snapshot survive
across navigation cycles — when the user re-entered the overview after
calculating, TanStack Query served the cached data (calculatedAt: null)
while the background refetch was in flight, hitting the "Payroll is not
calculated" error boundary in the brief window before isFetching became
true.

With gcTime: 0, remounting always starts with data: undefined (which
shows the loading screen) and fetches fresh. keepPreviousData still works
for in-session pagination since the observer stays active while mounted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QqwvgKv1sGfyjFxwxUmw5
The "renders dashboard and loads employee data" test waited only for
ProfileCard ("Legal name") before synchronously asserting WorkAddressCard
("Work address"). Since each card fetches independently, WorkAddressCard
may not be in the DOM yet. Move all assertions into a single waitFor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@serikjensen
serikjensen added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit 42d849e Aug 27, 2026
35 checks passed
@serikjensen
serikjensen deleted the SDK-1231 branch August 27, 2026 19:37
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.

3 participants