Repository navigation
Start the print dialog on A4 outside Letter regions and remember the paper size - #124
Open
twotonetobi wants to merge 1 commit into
Open
twotonetobi wants to merge 1 commit into
twotonetobi wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Problem
The print dialog always starts on Letter. In most of the world the printer holds A4, so every print first needs a trip to "Paper and quality", and the choice is forgotten the next time the dialog opens.
Steps: on a Mac with the region set to Germany, open a PDF, press Command P, open Advanced, then "Paper and quality". Paper size shows Letter.
Change
app.getLocaleCountryCode(), not the interface language) to the renderer throughadditionalArguments, and the preload exposes it asfolioDesktop.region.defaultPaper(region)inprintLayout.tsreturns Letter for the regions where Letter is standard (United States, Canada, Mexico, the Philippines, Puerto Rico and several Latin American countries) and for an unknown region, A4 everywhere else. The browser build has no region and keeps Letter.localStorage(folio:print-paper) and used the next time. Anything else in storage falls back to the default.FOLIO_TEST_USER_DATAset, unpackaged) use region US unlessFOLIO_TEST_REGIONnames another, so the smoke tests give the same result on every machine. Without this,smoke-printfails on a machine set to a non-Letter region.Issue or approval
No issue opened first. It is a small, contained change to a default, and I'm happy to move the discussion to an issue or close this if you'd rather handle it differently.
How I checked it
npm run build,npm run smokeandnpx vitest run(18 files, 261 tests, including the newsrc/printPaper.test.ts) pass.FOLIO_TEST_REGION=DEthe dialog opens on A4 (preview 8.27 × 11.69 in), withUSon Letter (screenshots attached). Before the test pin,smoke-printon this Mac (region Germany) printed A4, 842 × 595 pt, which is the change working.getLocaleCountryCode()exists on both.The code was written by Claude Code (Claude Opus), reviewed by me.
🤖 Generated with Claude Code