Repository navigation
Coverage round 2 batch C: AppState-constructible tests, dialog states, project load/export - #110
Merged
Merged
Conversation
…2 batch C) Coverage round 2 batch C (83 new tests, 1092 total; line coverage 59% -> 62%): Production refactor (behavior-preserving): - Extract an IpcState interface with IpcStateImpl as the real implementation, injected into AppState via a factory (default builds the real server). This lets tests build a real AppState with a FakeIpcState instead of binding the IPC port, dropping the need for reflection-based AppState construction. Tests (via the new testutil.TestAppState / testutil.FakeIpcState helpers): - AppState glue: screen switching, project open/close wiring, plugin/labeler disabled-name filtering, error pending actions, exit() closing ipcState - AppDialogState: standalone/embedded dialog open/close/stacking, the awaitEmbeddedDialog request/result flow, closeAllDialogs, dialog queries - Remaining dialog states: project settings, sample list (missing/excluded samples), import-entries module mapping, updater version comparison - io/Project: awaitLoadProject labeler-version reconciliation branches (newer/older/unknown labeler, install/RequiredLabelerNotFound), export paths, openCreatedProject, importProjectFile koverVerify bound raised from 56 to 59 (new baseline 62%). Several suspected bugs found and pinned (not fixed), see the PR description. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sdercolin
commented
Jul 10, 2026
It returned true whenever the customizable item manager was shown, including for the MacroPlugin type, so it did not actually exclude the macro-plugin manager (and isMacroPluginAvailable was false while that dialog was open). Now it excludes the MacroPlugin manager type; anyDialogOpening() still counts it via its explicit MacroPlugin clause. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
It previously cleared only a subset, so the About, License, Import, Prerender, EntrySampleSync, TrackingSettings, FileNameNormalizer, QuickEdit, Updater, ImportEntries and ReloadLabel dialogs stayed open across a screen switch or when another dialog was opened (both of which call closeAllDialogs). It now resets all dialog state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
importModulesFromProject swallowed all failures and returned an empty list, so importProjectFile silently opened the import dialog with zero modules for a malformed project file instead of showing an error. It now lets structural failures (malformed JSON, missing labelerConf) propagate, while a valid project with no importable entries still returns an empty list. importProjectFile already wraps the call and surfaces the error via ProjectImportException. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
isOutputFileValid returned false for an empty-string output file (File("").parentFile
is null), so a dialog whose output file initializes to empty (an editable
module with no raw file) opened in an error state that blocked submit, even
though empty means "no output file" and createNewProject already handles it
via ifEmpty { null }. Empty is now treated as none, consistent with null.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Final batch of coverage round 2 (items 4, 5, 7 and the AppState refactor of 8): 83 new tests (1092 total), line coverage 58.9% → 61.5%, koverVerify bound raised 56 → 59.
Production refactor (behavior-preserving)
IpcStateis now an interface withIpcStateImplas the real implementation, injected intoAppStatevia a factory parameter (default{ IpcStateImpl(it) }). This lets tests construct a realAppStatewith aFakeIpcState— no port binding, no reflection. Production behavior is unchanged (default factory starts the real server). New shared helpers:testutil.TestAppState.create(scope)andtestutil.FakeIpcState.AppState glue + dialog state (44 tests)
Screen switching and project open/close wiring, plugin/labeler disabled-name filtering, error pending actions,
exit()closingipcState(verified viaFakeIpcState);AppDialogStatestandalone/embedded open-close-stacking, theawaitEmbeddedDialogrequest/result flow,closeAllDialogs, dialog queries.Remaining dialog states (36 tests)
Project settings (validation, submit/cancel), sample list (missing- and excluded-sample handling, redirect), import-entries module mapping, updater version comparison (no network).
io/Project (18 tests)
awaitLoadProjectlabeler-version reconciliation — existing labeler newer/older/unknown, auto-install vsRequiredLabelerNotFoundException, parse error, missing file, cache-dir/path redirect, auto-saved path;exportProject/exportProjectModuleraw-label writes;openCreatedProject,importProjectFile.Suspected bugs found (pinned, NOT fixed)
closeAllDialogsis incomplete — it clears only a subset; About/License/Import/Updater/ImportEntries/ReloadLabel/QuickEdit/Prerender/etc. survive a screen switch or opening another dialog (changeScreencallscloseAllDialogs).anyDialogOpeningExceptMacroPluginManager()doesn't exclude the macro-plugin manager — returns true whenever the customizable-item manager is shown, soisMacroPluginAvailableis false while that dialog is open.importProjectFileswallows parse errors —importModulesFromProjectcatches everything and returns an empty list, so a malformed project opens the import dialog with zero modules instead of surfacingProjectImportException.File.getDirectory()redirects to parent on a non-existent leaf name, so sample-dir / download-position redirect handlers silently target the parent.ProjectSettingDialogState.isOutputFileValidfalse for empty string vscreateNewProjecttreating empty as null.Note:
isDebugevaluates true under the Gradle test worker — relevant to any prerelease-filtering or unknown-key-parsing tests.Test plan
./gradlew jvmTest— 1092 tests, 0 failures./gradlew koverVerify ktlintCheck🤖 Generated with Claude Code