[Feature/Medium] Stage 2: Add paper size and print quality selection to printer details #183
Notifications
Due Date
No due date set.
Blocks
Reference: gronod/iccery-v2-mac#183
Reference in New Issue
Block a user
Summary
Stage 2 printer details selection allows selection of the printer, media type, and orientation, but not quality or paper size settings from the ICCery screen. The paper size should follow the setting selected at the top of Stage 1 (defaults to A4) and default to portrait orientation. Print quality options should be populated from the printer's capabilities (lpoptions -l / PPD).
Spec refs
PrintOptions.paperSize— the spec names itpaper_size; the Swift field is camelCase, PrinterModels.swift:100)Scope
selectedPaperSizeandselectedQuality@Published propertiespaperSizes: [PrinterPaperSize]— wire it to the UIlpoptions -l(keys likeEPIJ_Qual,cupsPrintQuality,Quality,CNIJQuality,StpQuality,OutputMode,Resolution) and/or PPD*OpenUIentriespaperSizeand quality through capturedcupsOptionswhen opening printer propertiesImplementation notes
workflow.pageSize: it seeds frompageSizeand re-seeds on pageSize change or capabilities reload, but remains user-editable otherwisecustomPageW/customPageH) maps to a customPageSizeentry: the PPD tokenCustom.WIDTHxHEIGHTis a template — emitCustom.<w>x<h>in points (mm × 72/25.4); synthetic picker entryid: 0, labelCustom (W×H mm)lpoptions -p <queue> -land PPD parsingPrinterCapabilities.paperSizesarray is already populated but unused by Stage 2 UI (docs/10 §PrinterPaperSize gap)PMPageFormatpaper size andPMPrintSettingsquality beforerunModalCupsOptionsFilter.relevantKeys(Packages/ICCeryCore/Sources/ICCeryCore/Print/CupsOptionsFilter.swift:16-32).CupsParsersholdsmediaTypeKeys,bypassKeys,detectMediaTypeKey,detectDriverColorBypassonly (CupsParsers.swift:217-263) — a new quality-key roster/detector is needed. IncludeEPIJ_Qual(see issue #180)Rewrite invariants
$PATHfor binaries (use/usr/bin/lpoptionsvia CupsService).tmp+ rename (#213)Textonly (#114)ARGYLL_NOT_INTERACTIVE=1on every spawn@MainActorDependencies
showPropertiesinitial-selections plumbing for paper size + quality only; #186 completes media type + orientation preselect, capture-return of all fields, and binding verificationTest
lpoptions -loutput with multiple paper sizes and quality options; verify UI populates pickers; verifyPrintOptionscarries values tobuild_lp_argsAcceptance criteria
pageSizeand re-mirroring on pageSize change / caps reload, editable otherwise)PrintOptionswhen printingCustom.<w>x<h>in points)Planning errata for the implementation contract (verified on develop@736fd08 — code is ground truth):
CupsParsers.relevantKeys" — the roster isCupsOptionsFilter.relevantKeys(Packages/ICCeryCore/Sources/ICCeryCore/Print/CupsOptionsFilter.swift:16–32).CupsParsersholdsmediaTypeKeys,bypassKeys,detectMediaTypeKey,detectDriverColorBypassonly (CupsParsers.swift:217–263).PrintOptions.paper_size— the Swift field ispaperSize(camelCase, PrinterModels.swift:100);paper_sizeis docs/10 spec naming.showPropertiesinitial-selections plumbing for those two. #186 completes media type + orientation preselect, capture-return of all fields, and binding verification.workflow.pageSizeon pageSize change or caps reload.Custom.WIDTHxHEIGHTis a template — emitCustom.<w>x<h>in points (mm × 72/25.4); synthetic picker entryid: 0, labelCustom (W×H mm).Errata above incorporated into the issue body — the ticket itself is now the corrected contract.
Implementation landed in PR #193 at
51c3073on milestone/m11-print-settings.Acceptance evidence:
caps.paperSizesand quality picker populated fromcaps.qualities—paperSizeGroup/printerPaperSizeSelectandqualityGroup/printerQualitySelectin Stage2View; UI teststestPaperAndQualityPickersExist,testPickersSeedFromStage1AndDriverDefault(Milestone11PrintSettingsUITests)selectedPaperSizemirrorsworkflow.pageSizeincluding.custom→ syntheticCustom.<pt>x<pt>entry, and re-mirrors on pageSize change / printer change / caps reload while staying user-editable — PrintSessionViewModelTests:testSeedMatchesPageSizeRawValue,testSeedCustomPageSizeSyntheticEntry,testReseedOnPageSizeChange,testPrinterChangeReseeds,testUserEditPreservedAcrossUnrelatedPublishes,testSeedNoMatchLeavesNilPrintOptions.paperSize/quality→LpArgs→lpargv (-o PageSize=,-o <qualityKey>=after media, before orientation) — LpArgsTests:testPageSize,testQualityDerived,testQualityDetectedKey,testCapturedWinsQuality,testQualityNilNoEmit;testSpoolPassesPaperTokenAndQuality(PrintSessionViewModelTests)PMPrintSettingsSetValuePageSize +PMCreatePageFormatWithPMPaperpage-format write + detected quality key in PrintPanelService; PrintPanelStubTests coverage. PDE echo remains a hardware gateprinterPaperSizeSelect/printerQualitySelect/paperSizeGroup/qualityGrouppresent and distinct; all 13 pre-existing accessibility identifiers unchanged — verified at milestone tip6adbf99Custom.<w>x<h>in points (mm × 72/25.4);Custom.WIDTHxHEIGHTnever emitted verbatim —testSeedCustomPageSizeSyntheticEntry,testSpoolPassesPaperTokenAndQualityVerification at milestone/m11-print-settings
6adbf99bd9:xcodebuild test -scheme ICCery -destination 'platform=macOS' -derivedDataPath build/DerivedData-m11-final ARCHS="$(uname -m)" CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY='-'(x86_64): passedtestAboutDialogShowsVersionAndBuildDate, no assertion failure)Hardware item remains a milestone gate (not this issue's merge gate).
Closing manually only after code and tests are present on the milestone branch.