fix(SDK-1231): add paystub download loading indicator to PayrollOverview - #2653
Merged
Conversation
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>
dmortal
approved these changes
Aug 27, 2026
serikjensen
enabled auto-merge
August 27, 2026 18:23
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaystubsCardintoPayrollOverview's paystub download, so users see a "Generating paystub…" spinner instead of a blank tab while the PDF fetchesloadevent instead of synchronous)isLoadingon the download button while the fetch is in flightopenPdfInNewTabhelper to prevent the two implementations from drifting apartTest plan
npm run test -- --runpasses (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