Repository navigation
Split the settings view model by tab and keep view models out of its orchestrator - #179
Merged
Merged
Conversation
vesnicancz
added a commit
that referenced
this pull request
Nov 5, 2026
… the architecture test (#181) The last small items from the architecture review: members nothing reads, a comment that stopped being true, and two architecture checks for what #178 and #179 cleaned up. ## What changes - **`IWorklogStateService.RefreshFromDatabaseAsync`** goes, since only its tests called it. The two tests now run through `NotifyWorkEntriesModifiedAsync`, so the refresh keeps its coverage. - **`IStatusIndicatorPlugin.IsDeviceAvailable`** goes from the contract, the base class and the Luxafor plugin. The application always called `SetStateAsync` regardless, because that is what opens the device. One Luxafor test relied on the property to see that a failed device gets closed, and now checks that the next call opens it again. - **`PluginWorklogEntry.Category`, `PluginWorklogEntry.ProjectName` and `PluginMetadata.MinimumAppVersion`** go. Nothing set or read them. - **The comment on `RemoteControlHost`** blamed events raised on the caller's thread, which `WorklogStateService` no longer does. - **`ProjectDependencyTests`** gets two checks: orchestrators don't use types named `*ViewModel`, and only `App` and `MainWindowAccessor` touch `ApplicationLifetime`. `WorklogPreviewItem` still passes through its orchestrator, and the first check doesn't cover it. - `docs/plugins/luxafor.md` and `docs/plugin-development.md` follow. Removing members from `WorkTracker.Plugin.Abstractions` changes the contract, and a plugin outside this repository that overrides `IsDeviceAvailable` would stop compiling. All the plugins I know of are in this repository. ## Left as it is `WorkEntry.Reconstitute` and `PluginManager.LoadEmbeddedPlugin` are used only by tests, as the review noted, but both are `internal` and dozens of tests build on them. Replacing them would make those tests go through the database and assembly loading without anyone gaining anything. ## Testing - All 1456 tests pass on Windows: two Luxafor tests of the property are gone and the two architecture checks are new. - I ran the Debug GUI with the real development settings: all six plugins loaded and initialized, including Luxafor with the changed contract. The only warnings were the hotkey and the Stream Deck pipe, with the installed app running at the same time. - Not tried: a real Luxafor changing color on this build.
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.
SettingsViewModelhad 806 lines and held every tab of the dialog in one class: theme and language previews, the favorites form, the Pomodoro values and the plugin list with its connection test.ISettingsOrchestratoralso took and returnedPluginViewModel, so filling in the form and refreshing its fields happened in the orchestrator.What changes
AppearanceSettingsViewModelhas the theme and language with their previews and the revert.FavoritesSettingsViewModelhas the list and its edit form.PomodoroSettingsViewModelhas the values, andToSettings()builds what gets saved.PluginSettingsViewModelhas the plugin list, the selection and the connection test.SettingsViewModelkeeps the General tab, the About tab, and saving or dismissing the whole dialog, in 216 lines. Its constructor and its registration don't change, and it creates the sections itself.PluginSettingsEntryis whatISettingsOrchestratornow takes and returns: a descriptor, the enabled state and the configuration.PluginViewModelturns one into form fields and back, and the orchestrator no longer refers to it.Favorites.EditingName,Pomodoro.WorkMinutes), andSettingsWindow.axamlonly changes its binding paths. Compiled bindings check those paths at build time.Behavior to check
ApplicationSettingsand the settings file don't change, and neither does the order of steps inSaveSettingsAsync.Testing
settings.jsonkept its timestamp.