-
Notifications
You must be signed in to change notification settings - Fork 149
P1: App.xaml.cs (4204 lines) and ConnectionPage.xaml.cs (2840 lines) are unmaintainable god files #554
Copy link
Copy link
Open
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.refactor
Metadata
Metadata
Assignees
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.refactor
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Multiple files have grown far beyond the threshold where they can be safely reviewed or unit-tested in isolation.
src/OpenClaw.Tray.WinUI/App.xaml.cs— 4,204 linessrc/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs— 2,840 linesApp.xaml.cscurrently contains:This violates the Single Responsibility Principle and makes it nearly impossible to write unit tests for any individual concern.
Impact
Suggested fix
Extract cohesive modules into dedicated services or partial classes:
AppLifecycleService— mutex, single-instance, protocol activation, uninstallAppUpdateService— update check, skip logicTrayMenuBuilder— menu construction and snapshot handlingAppGatewayEventRouter— connection status, auth failure, notificationsAppVoiceLifecycle— voice service, TTS, STT setupConnectionPageViewModel/ConnectionPagePlan— move remaining row-state and plan logic out of the code-behindFiles
src/OpenClaw.Tray.WinUI/App.xaml.cssrc/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs