Repository navigation
refactor: simplify session ownership and output preferences - #437
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
docs/CONTEXT.md still contains canonical rows describing APIs and constructor wiring deleted by this PR.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Simplifies session ownership by removing transient image mirrors from WaterMarkRepository and making output preference writes independent.
Changes:
- Makes Session authoritative for selection, offsets, and export state.
- Writes format and quality independently to prevent stale-value overwrites.
- Removes obsolete preview/output helpers and updates regression coverage and architecture docs.
| File | Description |
|---|---|
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosSourceOwnershipTransactionTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosProgressiveAdoptionTest.kt |
Tests stale callbacks after deletion. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosProductRootHostPreviewIdentityTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosProductRootDisposeTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosPhotoKitNeighborCacheTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosLibraryReadUpsellTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosH2CacheBudgetHostTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/ui/IosFiftyImageSessionLatencyTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/session/IosSourceStagingIdentityTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/session/IosReadySelectionTransactionTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/session/IosPickGenerationPublishBoundaryTest.kt |
Verifies Session-only publication boundaries. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/session/IosG4StagingMemoryTest.kt |
Updates repository construction. |
shared/src/iosTest/kotlin/me/rosuh/easywatermark/data/repo/IosWatermarkConfigBridgeTest.kt |
Updates repository construction. |
shared/src/iosMain/kotlin/me/rosuh/easywatermark/ui/IosProductRootHost.kt |
Uses field-specific preference writes and removes cache stub. |
shared/src/iosMain/kotlin/me/rosuh/easywatermark/session/IosAppServices.kt |
Updates repository construction. |
shared/src/iosMain/kotlin/me/rosuh/easywatermark/data/repo/IosWatermarkConfigBridge.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/ui/FiftyImageFilmstripSwitchDiagnosisTest.kt |
Removes obsolete stub assertion. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/TypedExportSessionTest.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/SessionOffsetIdentityTest.kt |
Documents Session offset ownership. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/OffsetExportOrderingTest.kt |
Expands selection and export ordering coverage. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/G3LifecycleFaultMatrixTest.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/ExportCancellationSessionTest.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/DesktopImportExportSemanticsTest.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/session/DesktopCloseBackPolicyTest.kt |
Updates repository construction. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/data/datastore/UserConfigDataStoreRoundtripTest.kt |
Tests independent preference writes. |
shared/src/desktopTest/kotlin/me/rosuh/easywatermark/data/datastore/DesktopWaterMarkStoreRoundtripTest.kt |
Updates repository construction. |
shared/src/commonTest/kotlin/me/rosuh/easywatermark/session/WatermarkSessionViewModelTest.kt |
Adapts to direct reducer snapshots. |
shared/src/commonTest/kotlin/me/rosuh/easywatermark/session/SessionReducerTest.kt |
Tests direct Session transitions. |
shared/src/commonTest/kotlin/me/rosuh/easywatermark/render/PreviewPaintPolicyTest.kt |
Removes obsolete policy tests. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/session/WatermarkSessionViewModel.kt |
Removes repository mirroring and effects. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/session/SessionReducer.kt |
Returns Session snapshots directly. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/session/AppIntent.kt |
Removes repository-selection synchronization intent. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/render/PreviewPaintPolicy.kt |
Deletes unused preview policy. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/domain/OutputPrefsEditor.kt |
Deletes pair-write preference wrapper. |
shared/src/commonMain/kotlin/me/rosuh/easywatermark/data/repo/WaterMarkRepository.kt |
Removes transient image state and APIs. |
docs/CONTEXT.md |
Documents ownership and preference behavior. |
docs/adr/0030-cross-platform-preview-working-set.md |
Records preview policy removal. |
docs/adr/0017-shared-session-viewmodel-cmp-first.md |
Records Session ownership decision. |
desktopApp/src/main/kotlin/me/rosuh/easywatermark/desktop/DesktopWindow.kt |
Writes output preferences independently. |
desktopApp/src/main/kotlin/me/rosuh/easywatermark/desktop/DesktopWatermarkFlow.kt |
Updates repository construction. |
app/src/test/java/me/rosuh/easywatermark/platform/AndroidShareInDirectUriBehaviorTest.kt |
Updates repository construction. |
app/src/main/java/me/rosuh/easywatermark/ui/MainViewModel.kt |
Splits format and quality updates. |
app/src/main/java/me/rosuh/easywatermark/ui/MainActivity.kt |
Calls field-specific output methods. |
app/src/main/java/me/rosuh/easywatermark/di/RepositoryModule.kt |
Removes obsolete logging dependency. |
app/src/androidTest/java/me/rosuh/easywatermark/ExampleInstrumentedTest.kt |
Uses the variant application ID. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Session already owns the editor image list, selection, offsets and export state, but WaterMarkRepository kept a second copy and fed it back through reducer effects. Remove that mirror and return Session snapshots directly, preserving selection/export ordering and offset CAS behavior.
Also remove the unused PreviewPaintPolicy and iOS cache-hit stub. Output controls now update only the edited preference through existing repository methods, so changing format cannot overwrite quality with a stale UI value. Android still invalidates old export results on either edit. CONTEXT and ADRs 0017/0030 describe the resulting ownership.
Validation:
32a1e779, Android assembleDebug passed; Android unit tests 117/117, Desktop tests 502/502 and iOS simulator tests 451/451 passed. Desktop application headless text/icon exports and template roundtrip also passed. Final-head CI onf35ed9f9passed Android/Desktop checks, iOS simulator tests plus app build, and license compliance. The follow-up only corrects historical interface references in CONTEXT; product code is identical to the locally tested commit.Validation limits: the local, uncommitted testmap harness is outside this PR. Its two attempted Android replays diverged on an absent filmstrip selector and Chinese text on an English screen; the full repeat batch, human Confirm, iOS app XCUITest and physical-device verification remain incomplete. The local verify report records these gaps; this PR does not claim full e2e acceptance. The owner explicitly requested creation and merge after these limits were reported.
Unrelated working-tree changes and the uncommitted test harness are excluded. The Android instrumentation package assertion now uses BuildConfig.APPLICATION_ID so it checks the installed debug package.