Split print session (and preset sheet state) out of TargetWorkflowViewModel
#85
Closed
opened 2026-09-10 18:23:15 +01:00 by gronod
·
1 comment
No Branch/Tag Specified
main
develop
milestone/m8-consolidation
feat/80-process-run-notice-consolidation
feat/79-runner-loop-contract-tests
feat/86-args-builder-completion
feat/84-process-manager-edge-contracts
feat/83-calibration-profile-contracts
feat/82-preset-mapping-contracts
feat/81-json-store-contracts
v2.0.0-pre2-grok
v2.0.0-pre1
Labels
Clear labels
Bug/Architecture
Bug/Backend
Bug/DevOps
Bug/UI
Compat/Breaking
Feature/Architecture
Feature/Backend
Feature/DevOps
Feature/UI
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Project/ICCery-v2
Core / wizard / process infra defect
Argyll orchestration, file/data defect
Build, packaging, CI defect
Views, controls, dialogs defect
Breaking change that won't be backward compatible
Core / wizard / process infra
Argyll orchestration, file/data engines
Build, packaging, CI
Views, controls, dialogs
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
ICCery v2 Mac rewrite
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
M7 — Deduplicate & consolidate (develop)
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gronod/iccery-v2-mac#85
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
TargetWorkflowViewModel(719 lines) is the composition root and Stage 1 form and Stage 2 form and CUPS print session and preset CRUD, while also owningmeasurement,profile, andcalibration. Print-queue state sitting next tocustomPatchCountmakes Stage 2 and Stage 1 PRs collide and is why print notices were a second banner system.Spec refs
Sources/ICCery/TargetWorkflowViewModel.swiftSources/ICCery/RootView.swift/Stage2View.swiftScope
In
PrintSessionViewModel(Sources/ICCery/Print/PrintSessionViewModel.swift):printers,selectedPrinter,printerCaps, tray/media/orientationcapturedCupsOptionsprintNotice: Notice?(from the notice-unification ticket)isPrinting,printTaskrefreshPrinters,reloadSelectedCapabilities,openPrinterPreferences,printAllPages,printPage,spoolwizard.printerNameafter a successful spool (Stage 5 history #95)Optional but recommended in the same PR if it stays mechanical:
PresetSessionholdingpresets,selectedPresetID, save/manage sheet flags, import/export.applyPreset/saveCurrentAsPresetcan remain on the target VM because they touch Stage 1/2 form fields — or they take the form snapshot as input. Do not move targen form fields into the preset type.TargetWorkflowViewModelkeeps:buildTargenConfig/buildPrinttargConfiggenerateTarget,createLayout, resume/importprint: PrintSessionViewModelpropertyStage2Viewprint panel / gallery Print buttons bind toworkflow.print.RootViewpreset sheets can bind toworkfloworworkflow.presetswithout reaching into print state.Out
lpargv or ColorSync suppression.printerSelect,btnPrintAll,btnPrintPage-N,rawPrintPanel, …).Full solution
AppEnvironment.cupsServiceis injected intoPrintSessionViewModel; do not construct a secondCupsService.printAllPagesstill stops on first failure.printTaskreference stays so unstructuredTaskis not deallocated mid-spool.onChange(of: selectedPrinter)still clears tray/media and reloads caps.Rewrite invariants
-o rawon macOS.AP_ColorMatchingModeandAP.ColorMatchingModestill come fromLpArgs/ColorMatchingAttempts, not from this VM.Dependencies
Blocks-on: notice-unification ticket (
Noticemust exist for print chrome before the type moves).Unblocks: none.
Test
Tests/ICCeryUITests/Milestone3UITests.swiftis the gate:ICCERY_TEST_LP_ARGVstill records both AP_* keyswizard.printerNameis assigned after success (can be a small fake CupsService).Acceptance criteria
TargetWorkflowViewModelno longer contains CUPS/spool stored properties.Closing #85. Implementation landed via stacked commit
d4261ba(PR #87). Verified that PrintSessionViewModel owns print session state, TargetWorkflowViewModel is decoupled from spooling, Stage2View bindings remain intact, and UI test coverage passed in baseline verification at0332a2bb4f. Acceptance criteria fully satisfied.