[Bug/High] Restore captured PrintTicket when reopening the printer properties dialog #219

Merged
gronod merged 1 commits from feat/217-panel-ticket-restore into milestone/m13-print-ticket 2026-09-22 18:56:33 +01:00
Owner

Summary

Fixes the Stage 2 properties dialog discarding the captured PrintTicket on reopen (#217).

  • PrintPanelService.showProperties gains a ticket: parameter; PrintSessionViewModel.openPrinterPreferences passes capturedTickets[queue].
  • The pre-modal configuration is extracted into a testable seam (makePanelPrintInfo → configureBoundPanel, same pattern as NativeTargetSpooler.makePrintInfo) running the spooler's S4→S7 order: ticket restore → Stage 2 selections (D6 parity) → PMSessionValidatePrintSettings + updateFromPMPrintSettings → applyPaper → suppression ②–⑤ → runModal.
  • Restore is warn-only on the panel path (unlike the spooler's fatal try): a stale/corrupt ticket must not keep the dialog from opening. Cross-queue refusal stays inside PMTicketBridge.restore (R3).
  • ICCERY_DEBUG_PANEL_DUMP=1 (DEBUG only) logs the unfiltered PMPrintSettingsToOptions output plus serialised settings/page-format sizes immediately before runModal and after OK — for the XP-55 RC3 verification.
  • New PrintPanelTicketTests (4 tests): ticket restored pre-modal, Stage 2 wins over ticket, cross-queue ticket refused, first-open selections + suppression keys land.

Verification

  • Local: xcodebuild test -scheme ICCery — PrintPanelTicketTests (4), PrintTicketTests, PrintPanelStubTests, PrintSessionViewModelTests all green.
  • Runner host (macOS 12.7.6 / Xcode 14.2, CI mirror): 539 ICCeryCoreTests, 0 failures.
  • Hardware gate (Epson XP-55) remains: change a vendor-pane-only setting → "Use Settings" → reopen → persists; dump flag answers the RC3 lpoptions question.

Out of scope per ticket: lpoptions persistence contingency (hardware-dependent, mutates queue defaults) and the capturedCupsOptions replay fallback.

Refs #217

## Summary Fixes the Stage 2 properties dialog discarding the captured `PrintTicket` on reopen (#217). - `PrintPanelService.showProperties` gains a `ticket:` parameter; `PrintSessionViewModel.openPrinterPreferences` passes `capturedTickets[queue]`. - The pre-modal configuration is extracted into a testable seam (`makePanelPrintInfo` → `configureBoundPanel`, same pattern as `NativeTargetSpooler.makePrintInfo`) running the spooler's S4→S7 order: **ticket restore → Stage 2 selections (D6 parity) → `PMSessionValidatePrintSettings` + `updateFromPMPrintSettings` → `applyPaper` → suppression ②–⑤ → runModal**. - Restore is warn-only on the panel path (unlike the spooler's fatal `try`): a stale/corrupt ticket must not keep the dialog from opening. Cross-queue refusal stays inside `PMTicketBridge.restore` (R3). - `ICCERY_DEBUG_PANEL_DUMP=1` (DEBUG only) logs the unfiltered `PMPrintSettingsToOptions` output plus serialised settings/page-format sizes immediately before `runModal` and after OK — for the XP-55 RC3 verification. - New `PrintPanelTicketTests` (4 tests): ticket restored pre-modal, Stage 2 wins over ticket, cross-queue ticket refused, first-open selections + suppression keys land. ## Verification - Local: `xcodebuild test -scheme ICCery` — PrintPanelTicketTests (4), PrintTicketTests, PrintPanelStubTests, PrintSessionViewModelTests all green. - Runner host (macOS 12.7.6 / Xcode 14.2, CI mirror): **539 ICCeryCoreTests, 0 failures**. - Hardware gate (Epson XP-55) remains: change a vendor-pane-only setting → "Use Settings" → reopen → persists; dump flag answers the RC3 lpoptions question. Out of scope per ticket: `lpoptions` persistence contingency (hardware-dependent, mutates queue defaults) and the `capturedCupsOptions` replay fallback. Refs #217
gronod added the Kind/Bug
Priority
High
2
Project/ICCery-v2Bug/Backend
labels 2026-09-22 17:47:49 +01:00
gronod added 1 commit 2026-09-22 17:47:50 +01:00
The bound NSPrintPanel always opened on queue driver defaults —
capturedTickets[queue] was stored but never passed back, so every
vendor-PDE setting outside the four mirrored fields was discarded
on reopen (RC1), and pre-selection writes were never validated into
the ticket before runModal (RC2).

Extract the pre-modal configuration into a testable
configureBoundPanel seam with the spooler's S4→S7 order: ticket
restore (warn-only, unlike the spooler's fatal try — a stale ticket
must not keep the dialog from opening → Stage 2 selections (D6
parity) → PMSessionValidatePrintSettings + updateFromPMPrintSettings
→ applyPaper → suppression ②–⑤.

ICCERY_DEBUG_PANEL_DUMP=1 logs the raw PMPrintSettingsToOptions
output and serialised ticket sizes pre/post modal for the XP-55
RC3 verification.

Refs #217
EOF
)
gronod added this to the M13 — Print ticket persistence & paper source milestone 2026-09-22 17:47:57 +01:00
gronod merged commit bd14f30a05 into milestone/m13-print-ticket 2026-09-22 18:56:33 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#219