Show a page count badge on multi-page PDF receipts - #97813
Draft
ishpaul777 wants to merge 3 commits into
Draft
Conversation
Auth now sends the page count for receipts stored as a PDF. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The receipt thumbnail is a server-generated JPG of page 1, so when a total sits on a later page the expense looks like it disagrees with its own receipt, and nothing signals that more pages exist. The badge sits bottom-left because the receipt action buttons hold the top-right corner, and uses the same translucent dark background as the video player controls so it stays legible over any receipt content in either theme. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
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.
Explanation of Change
A PDF receipt's thumbnail is a server-generated JPG of page 1. When a multi-page receipt's total sits on page 2 or later, the expense looks like it disagrees with its own receipt, and nothing on screen signals that more pages exist. Hover-zoom does not help — it magnifies the same first page.
This adds a
Page 1 of Nbadge over the receipt in the expense detail view, gated onpageCount > 1.Two design decisions, since design has not weighed in yet (the issue is still waiting on
@Expensify/design):theme.videoPlayerBG— the same translucent dark already used for controls over video — paired withtheme.white, which reads correctly in both themes. The page-stack icon is included because the original complaint was that users do not notice multi-page receipts at all, so an icon gives it a shape to catch the eye before the text is read.Happy to change the copy, position, or drop the icon once design responds.
This depends on three backend PRs and shows nothing until they ship, since
pageCountdoes not exist on any receipt today:There is no backfill, so the badge only ever appears on receipts uploaded after the backend ships. The
pageCount > 1gate handles that with no extra code.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/667914
PROPOSAL:
Tests
Requires the three backend PRs running locally.
Page 1 of 3badge appears at the bottom-left of the receipt.Offline tests
The page count arrives with the transaction from Onyx and is not fetched separately, so a cached expense keeps its badge offline.
QA Steps
Same as tests. Requires the three backend PRs deployed — the badge cannot appear before then, and only on receipts uploaded after they ship.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Pending — the three backend PRs are still in draft, so screenshots need a local build with all of them running. Will attach before taking this out of draft.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari