refactor(flutter): organize the frontend into Elm modules mirroring Iced - #108
Merged
Merged
Conversation
…e, and effect modules
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.
Summary
Reorganizes the Flutter frontend into Elm modules that mirror the Iced reference (
State/Message/update/view/ shared utils), and adds isolated deterministic tests. No product behavior change.Layout
Dart's library is the privacy unit, so each class-bearing module uses
partfiles (the Dart analogue of Rustmod foo;) to keep private members while splitting storage. Cross-feature helpers live in normal libraries.Commits
Deterministic Elm tests
ReaderControllerandLibraryControllerare driven directly throughdispatchwith injected fakes — no widget pumping:test/reader/controller_test.dart: pure transitions (tools visibility, layout/viewport, invalid layout rejection), listener notification, and disposal semantics.test/library/controller_test.dart: effect + completion pipeline (LibraryStarted→ page completion publishes books/settings), stale-completion rejection across a newer query, and format-filter reload.test/library/model_test.dart:LibraryModel.copyWithsentinel/clear semantics.test/reader/geometry_test.dart:SurfaceTransformmath for contain/cover and clamped mapping.test/reader/painting_test.dart: page color contrast and raster pixel geometry.test/library/view_test.dart: isolatedLibraryCollection/LibraryBannercomponent tests (loading, failure, empty vs. filtered, metadata + open, load-more, actions menu, banners).test/shared/shad_widgets_test.dartandtest/library/errors_test.dart: helper coverage.LibraryCollection,LibraryBanner, andSurfaceTransformwere made public so they can be exercised in isolation; the load-more button now keeps its label flexible so it stays inside the card at narrow widths.Testing
make test-flutter(281 tests)make lint-fluttermake check-fmt-flutterFollow-up
Extracting
updateinto a freereduce(model, message) -> effectsfunction (closer to Iced'sTask<Message>) is a deeper follow-up; the current controllers already expose deterministicdispatch-driven tests. Splitting the large legacytest/widget_test.dart/test/product_shell_test.dartinto per-module files still needs shared, non-private test support.