Repository navigation
Phase 15: refactoring pass (log_viewer split, settings, message router) - #22
Merged
Merged
Conversation
Pay down structural debt before phases 7/11/12 grow the codebase. - Split app/ui/log_viewer.py (~1450 lines) into app/ui/log_viewer/ package (common, factories, tag_bar, capture_panel, view), mirroring the app/ui/profiler split. Per-concern mixins keep behavior identical; __init__ re-exports LogViewerView so the public import is unchanged. - Add app/core/settings.py (Settings class, merge semantics, per-namespace files) replacing the duplicated _load_settings/_save_settings in profiler_view and log_viewer; the seam for the Phase 9 GSettings backend. - Extract SocketServer._reset_connection() (teardown was copy-pasted 3x). - Add app/core/message_router.py (typed MessageRouter.on(type, cb)) and replace the per-view message-received if/elif filtering in profiler_view, inspector_view and main.py. - Delete tests/test_placeholder.py (Phase 0 leftover). Add unit tests (test_settings.py, test_message_router.py), a headless log-viewer test in the WSL harness, and update the hook syntax-check list. Item 3 (Python packaging / dropping the sys.path hack) is deferred: all launch paths run app/main.py directly, so it needs launcher/manifest changes that must be build-tested on a real Linux box. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Implements Phase 15 — Refactoring Pass (5 of 6 items; packaging deferred).
Pays down structural debt before phases 7 / 11 / 12 grow the codebase.
Changes
app/ui/log_viewer.py(~1450 lines) into a packageapp/ui/log_viewer/, mirroring theapp/ui/profiler/split:common.py(constants, pure helpers,LogRowItem),factories.py(column cell factories),tag_bar.py(_TagBarLayout+TagBarMixinchip fitting),capture_panel.py(CapturePanelMixin),view.py(LogViewerViewcomposing them).__init__.pyre-exportsLogViewerViewsofrom app.ui.log_viewer import LogViewerViewis unchanged. Dropped dead code (_INVALID_POS).app/core/settings.pySettingsclass (merge semantics, per-namespace files), replacing the two diverging_load_settings/_save_settingstrios inprofiler_view.pyandlog_viewer.py. This is the seam for the Phase 9 GSettings backend.SocketServer._reset_connection()— the connection-teardown block was copy-pasted 3× (error path, EOF path,stop()).app/core/message_router.py(MessageRouter.on("profile_event", cb)), replacing the per-viewmessage-receivedif/elif filtering inprofiler_view.py,inspector_view.pyandmain.py.tests/test_placeholder.py(Phase 0 leftover).Deferred
[project]table +console_scripts, dropping thesys.path.inserthack): deferred. All three launch paths (setup-and-run.sh,build-deb.sh, Flatpak) runapp/main.pydirectly, so dropping the hack requires launcher/manifest changes that must be build-tested on a real Linux box.Tests
tests/test_settings.py,tests/test_message_router.py.🤖 Generated with Claude Code