refactor(ui): complete logged-run and Notice consolidation (#80) #103

Merged
gronod merged 1 commits from feat/80-process-run-notice-consolidation into milestone/m8-consolidation 2026-09-11 13:53:45 +01:00
Owner

Summary

Phase 7 of the M8 consolidation plan — finishes the runLogged orchestration adoption, Notice consolidation, and ProcessLogView unification across the wizard stages.

runLogged adoption

ProcessRunSupport.runLogged now owns every running-flag transition (false → true → false) and log-reset decision; no caller pre-sets or manually resets its flag.

  • TargetWorkflowViewModel — removed the duplicate targenRunning/targenLog/printtargRunning/printtargLog pre-run assignments and the targen catch-block reset around the already-adopted helper.
  • CalibrationViewModelgenerateTarget/computeCurves now use runLogged; the outer Task keeps its strong lifetime, and the original-basename restore on failure is unchanged.
  • ProfileWorkflowViewModelcreateProfile/verifyProfile use runLogged; work closures return structured results ((profileURL, gamutURL) / (report, history)) so gating, navigation, and history/drift assignment stay outside. The running flag spans colprof + applycal + best-effort iccgamut, and profcheck report/history handling, matching prior UI behavior.
  • MeasurementWorkflowViewModelfinishAndAverage uses runLogged with a no-op resetLog so prior chartread logs are preserved; single-pass promotion and first-pass fallback semantics are unchanged.

Notice consolidation

  • WizardViewModel.notice remains the session-wide banner; print/finish notices stay sticky stage-local Notice? values.
  • Deleted duplicate raw lastError: String? channels on Profile and Calibration; process failures route through the wizard notice only (removed colprofLastError and the CalibrationView error section).
  • Measurement chartread error state is now chartreadNotice: Notice?, still rendered as chartreadLastError via notice.text/notice.kind.
  • Notice.Kind.accessibilityValue exposes info/warning/error; printNotificationIcon reports the print notice kind as its accessibility value (cancel = info, spool failure = error), and Stage 3's sticky finish notice gained the stable chartreadFinishNotice identifier/value.

ProcessLogView unification

Stage 3 and Stage 4 disclosures were replaced with ProcessLogView, preserving chartreadLogContainer/colprofLogContainer and adding inner chartreadLog/colprofLog IDs. Stage 1/2 copy is untouched.

Dataset import seam

TargetWorkflowViewModel.importMeasurementDataset(from:) is the new internal seam — the parameterless UI action still prompts via the open panel (or UI-test hook) and delegates. Unit tests now cover malformed (CGATSParseError) and missing-file (CocoaError) inputs without global environment mutation, reusing TestAppEnvironment from #82.

Gate

xcodegen generate --spec project.yml && xcodebuild test -scheme ICCery -destination 'platform=macOS' -derivedDataPath build/DerivedData-feat-80-process-run-notice-consolidation ARCHS='arm64 x86_64' ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY='-' -only-testing:ICCeryCoreTests/ProcessRunSupportTests -only-testing:ICCeryCoreTests/TargetWorkflowViewModelTests -only-testing:ICCeryUITests/Milestone2UITests -only-testing:ICCeryUITests/Milestone3UITests -only-testing:ICCeryUITests/Milestone4UITests -only-testing:ICCeryUITests/Milestone5UITests -only-testing:ICCeryUITests/Milestone6CalibrationUITests

TEST SUCCEEDED — 29 tests, 0 failures: ProcessRunSupportTests (2), TargetWorkflowViewModelTests (2), Milestone2UITests (12), Milestone3UITests (6), Milestone4UITests (3), Milestone5UITests (2), Milestone6CalibrationUITests (2).

New coverage: runLogged success/failure contracts; two-pass MOCK_AVERAGE_FAIL=1 run asserting pass-1 promotion and the sticky chartreadFinishNotice error; printNotificationIcon kind values on cancel and spool failure; profile and calibration failure visibility through the wizard notice (with basename restore persisted to wizard_state.json).

Static checks clean: no printNoticeIsError/finishNoticeIsError, no ProcessRunSupport.logSink in view models, no Task { @MainActor } hops for log lines.

Refs #80

## Summary Phase 7 of the M8 consolidation plan — finishes the `runLogged` orchestration adoption, Notice consolidation, and `ProcessLogView` unification across the wizard stages. ### `runLogged` adoption `ProcessRunSupport.runLogged` now owns every running-flag transition (`false → true → false`) and log-reset decision; no caller pre-sets or manually resets its flag. - **TargetWorkflowViewModel** — removed the duplicate `targenRunning`/`targenLog`/`printtargRunning`/`printtargLog` pre-run assignments and the targen catch-block reset around the already-adopted helper. - **CalibrationViewModel** — `generateTarget`/`computeCurves` now use `runLogged`; the outer `Task` keeps its strong lifetime, and the original-basename restore on failure is unchanged. - **ProfileWorkflowViewModel** — `createProfile`/`verifyProfile` use `runLogged`; work closures return structured results (`(profileURL, gamutURL)` / `(report, history)`) so gating, navigation, and history/drift assignment stay outside. The running flag spans colprof + applycal + best-effort iccgamut, and profcheck report/history handling, matching prior UI behavior. - **MeasurementWorkflowViewModel** — `finishAndAverage` uses `runLogged` with a no-op `resetLog` so prior chartread logs are preserved; single-pass promotion and first-pass fallback semantics are unchanged. ### Notice consolidation - `WizardViewModel.notice` remains the session-wide banner; print/finish notices stay sticky stage-local `Notice?` values. - Deleted duplicate raw `lastError: String?` channels on Profile and Calibration; process failures route through the wizard notice only (removed `colprofLastError` and the CalibrationView error section). - Measurement chartread error state is now `chartreadNotice: Notice?`, still rendered as `chartreadLastError` via `notice.text`/`notice.kind`. - `Notice.Kind.accessibilityValue` exposes `info`/`warning`/`error`; `printNotificationIcon` reports the print notice kind as its accessibility value (cancel = `info`, spool failure = `error`), and Stage 3's sticky finish notice gained the stable `chartreadFinishNotice` identifier/value. ### ProcessLogView unification Stage 3 and Stage 4 disclosures were replaced with `ProcessLogView`, preserving `chartreadLogContainer`/`colprofLogContainer` and adding inner `chartreadLog`/`colprofLog` IDs. Stage 1/2 copy is untouched. ### Dataset import seam `TargetWorkflowViewModel.importMeasurementDataset(from:)` is the new internal seam — the parameterless UI action still prompts via the open panel (or UI-test hook) and delegates. Unit tests now cover malformed (`CGATSParseError`) and missing-file (`CocoaError`) inputs without global environment mutation, reusing `TestAppEnvironment` from #82. ### Gate ``` xcodegen generate --spec project.yml && xcodebuild test -scheme ICCery -destination 'platform=macOS' -derivedDataPath build/DerivedData-feat-80-process-run-notice-consolidation ARCHS='arm64 x86_64' ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY='-' -only-testing:ICCeryCoreTests/ProcessRunSupportTests -only-testing:ICCeryCoreTests/TargetWorkflowViewModelTests -only-testing:ICCeryUITests/Milestone2UITests -only-testing:ICCeryUITests/Milestone3UITests -only-testing:ICCeryUITests/Milestone4UITests -only-testing:ICCeryUITests/Milestone5UITests -only-testing:ICCeryUITests/Milestone6CalibrationUITests ``` **TEST SUCCEEDED** — 29 tests, 0 failures: ProcessRunSupportTests (2), TargetWorkflowViewModelTests (2), Milestone2UITests (12), Milestone3UITests (6), Milestone4UITests (3), Milestone5UITests (2), Milestone6CalibrationUITests (2). New coverage: `runLogged` success/failure contracts; two-pass `MOCK_AVERAGE_FAIL=1` run asserting pass-1 promotion and the sticky `chartreadFinishNotice` error; `printNotificationIcon` kind values on cancel and spool failure; profile and calibration failure visibility through the wizard notice (with basename restore persisted to `wizard_state.json`). Static checks clean: no `printNoticeIsError`/`finishNoticeIsError`, no `ProcessRunSupport.logSink` in view models, no `Task { @MainActor }` hops for log lines. Refs #80
gronod added 1 commit 2026-09-11 13:19:05 +01:00
Refs #80

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
gronod self-assigned this 2026-09-11 13:19:16 +01:00
gronod added this to the M7 — Deduplicate & consolidate (develop) milestone 2026-09-11 13:19:17 +01:00
gronod merged commit f681e60778 into milestone/m8-consolidation 2026-09-11 13:53:45 +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#103