-
Notifications
You must be signed in to change notification settings - Fork 4k
[Payment due @abzokhattab] Show a page count badge on multi-page PDF receipts #97813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ishpaul777
wants to merge
17
commits into
Expensify:main
Choose a base branch
from
ishpaul777:ishpaul/667914-receipt-page-badge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
367a37e
Add pageCount to the Receipt type
ishpaul777 46a01d8
Add the receipt page count badge copy
ishpaul777 4de2d30
Show a page count badge on multi-page PDF receipts
ishpaul777 6650fad
Use the shared Badge and float it above the receipt
ishpaul777 f254e7b
Merge branch 'main' into ishpaul/667914-receipt-page-badge
ishpaul777 ac3b902
Hide the page count badge while the receipt loads
ishpaul777 df7a6f1
Adjust position of receipt page count badge for improved alignment
ishpaul777 281aa9b
Add the page count badge copy for the remaining locales
ishpaul777 78c258f
Add pageCount to the debug receipt validators
ishpaul777 4972c29
Drop the stale background note from the page count badge style
ishpaul777 5e7544a
Clear the page count optimistically when replacing a receipt
ishpaul777 ccb27a3
Cover the page count badge gating
ishpaul777 2bdd2d0
Only show the page count when the receipt is actually a PDF
ishpaul777 d704093
Merge branch 'Expensify:main' into ishpaul/667914-receipt-page-badge
ishpaul777 0649126
Stub the dismiss navigation the sign-in modal runs on its own
ishpaul777 1eb0b93
Merge branch 'main' into ishpaul/667914-receipt-page-badge
ishpaul777 4c7aa3f
Merge branch 'Expensify:main' into ishpaul/667914-receipt-page-badge
ishpaul777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a multi-page PDF is replaced,
replaceReceipt()insrc/libs/actions/IOU/Receipt.tsapplies an OnyxMERGEwhose nestedreceiptOptimisticobject omitspageCount; therefore the previous count remains in Onyx. Since this line trusts that retained value without checking whether the new receipt is a PDF, replacing the PDF with an image—or with a PDF having fewer pages—shows the oldPage 1 of Nbadge after loading, and an image response that omits this PDF-only field may never clear it. ClearpageCountin receipt replacement paths or gate the badge against the current receipt type.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in 5e7544a.
receiptOptimisticis applied withOnyx.METHOD.MERGE, so omittingpageCountleft the replaced receipt's count in place until the server responded. Now sendspageCount: null, matching howlocalSourceis already cleared in the same object, and the type allows null.Worth noting the server side of this is already handled — Auth's attach/replace update always sends
pageCount(null when the new receipt has none), so the correction arrives rather than the field simply being omitted. This closes the optimistic window before it.