GUI-first exe with chromeless in-window report (increment 2) - #4
Merged
Merged
Conversation
…eport The single exe now opens the desktop GUI when launched with no arguments and runs the CLI when given a path or any flag (cli.main dispatches to gui.main on empty argv). It stays a console-subsystem build so the CLI can still print; gui._maybe_hide_console() hides the console via ctypes ONLY when the process exclusively owns it (GetConsoleProcessList == 1, i.e. a double-click) so a shared terminal is never hidden. After a GUI scan completes, the interactive HTML report opens automatically in a chromeless desktop window via Edge (or Chrome) `--app=file://...` launched with stdlib subprocess (find_app_browser / app_window_argv / open_report_window), falling back to webbrowser.open when neither browser is found -- preserving the zero-runtime-dependency / single-exe identity. storageanalyzer.spec lists tkinter in hiddenimports so the GUI is always bundled. Tests: tests/test_cli.py pins the no-args/--gui/path dispatch; tests/test_gui.py adds chromeless-argv + report-window fallback coverage. Full suite green (48). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Makes the standalone exe GUI-first and opens the interactive report in a chromeless window — the behavior already documented by docs PR #3.
cli.mainopens the Tkinter desktop GUI when launched with no arguments (double-click / Start menu), and runs the command-line scanner when given a path or any flag.--guistill forces the GUI explicitly.gui._maybe_hide_console()hides the console viactypesonly when the process exclusively owns it (GetConsoleProcessList() == 1, i.e. a double-click), so a shared terminal is never hidden.--app=file://...window via stdlibsubprocess(find_app_browser/app_window_argv/open_report_window), falling back towebbrowser.openwhen neither is found. No new runtime dependency — the zero-dep / single-exe identity holds.storageanalyzer.specliststkinterinhiddenimportsso the GUI is always bundled (native walker present or not).Tests
tests/test_cli.py(new) — pins no-args → GUI,--gui→ GUI, and path-arg → CLI dispatch without standing up Tk or running a real scan.tests/test_gui.py— adds chromeless--appargv construction + report-window browser/fallback coverage.Scope
Code + tests only. The README is handled separately on docs PR #3 (
hal/docs-gui-first).This PR and docs PR #3 must BOTH merge before the
v*release tag is cut. PR #3 documents this behavior; this PR implements it. Tagging a release with only one of them landed would leavemain's docs and code out of sync. (Do not merge or tag here — release is a separate task.)🤖 Generated with Claude Code