Refactor/cargo workspace - #20
Merged
Merged
Conversation
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.
The app is now a four-part Cargo workspace like fan-control's. It builds, and
cargo fmt --checkandcargo clippy --workspace --all-targetsare clean. All 121 tests pass (69 in data, 52 in hardware). I haven't run the app itself, so the GUI smoke test from the plan is still to do.ccdandddc. The DDC test helpers are now inddc::test_util, available through atest-utilfeature sodata's tests can use them.presentation.rsholds the monitor view models, and the newstate.rsholdsAppState.AppModelwrapper, the views,effects.rs,subscriptions.rsandkeys.rs.main.rscallsui::run(...).build.rsand packaging are unchanged.How the split works:
AppState::update(Input)returns a list ofEffect's. It never creates a cosmicTask.Spawn(Job): hardware work, config ops or profile listing.Delay: the slider debounce.MonitorsDetected: the UI rebuilds the navigation bar.ProfilesUpdated: the UI refreshes the tray menu.ShowHotkeys: the UI switches to the Hotkeys page.Messageis nowData(Input)plus the UI-only messages (window, tray, settings drawer, clipboard, URLs). Views read state only through getters.data::hotkeysanddata::trayno longer use cosmic. The UI wraps them as subscriptions.datadoesn't depend on libcosmic, andhardwaredoesn't depend on cosmic, tray-icon or global-hotkey (checked withcargo tree).