Files
LorenEteval_Furious/Furious/Window/AGENTS.md
T
2026-09-08 15:59:34 +08:00

4.1 KiB

Window and page guidance

Inherit the root and package guides. Consult Qt/Widget for presentation and Controllers/Service for shared owners. This scope owns persistent page composition and top-level presentation, not shared domain state.

Composition and shared state

  • MainWindow owns the persistent built-in page tree and navigation; plugin pages enter through the plugin navigation service. Pages adapt shared controllers/services/repositories and must not become competing state authorities. Preserve application-facing forwarding APIs until their consumers migrate deliberately.
  • Home, Settings, tray actions, and reusable dialogs render the same connection, routing, and settings controllers. Platform/capability availability affects presentation but does not authorize an unsupported persisted value or a duplicate host side effect.
  • The current page composition shares one subscription workflow between server and subscription presentation, records traffic into one history, and derives metrics/endpoint presentation from owned services. These exact locations may evolve, but a refactor retains one durable owner, one scheduler/request path, and one signal path.
  • Home remains the initial page and navigation expansion/selection is session-local unless a product decision adds a persisted migration. Plugin ordering and bottom settings placement remain declarative navigation concerns.

Visibility, lifetime, and geometry

  • Long-lived pages construct persistent controls, models, timers, services, and connections once. Page visibility may coalesce log/graph painting or deliberately gate a lazy endpoint lookup, but it never owns log collection/draining, traffic sampling, subscription schedules, or an already-started request.
  • A page that creates a service must make its process-lifetime or page-lifetime ownership explicit and expose one cleanup path through the containing window/application. Moving a service between pages must not duplicate schedules, histories, requests, or controller connections during the transition.
  • One-shot editors/prompts use managed transient dialogs and weak compiled-safe continuations. Reusable text/editor windows and retained settings dialogs need an explicit owner and reopen policy. A settings label or Qt parent does not determine lifetime: check the actual base class and close/accept/reject path before changing deletion policy.
  • Empty-state presentation distinguishes an empty repository from a filtered view with no matches. Recovery changes view filters only; reuse existing import/edit/test actions instead of creating page-specific workflow owners.
  • Use normal layouts and AppQ* controls. Restore top-level geometry only after persistent composition and through the canonical first-show path; never-shown Qt fallback geometry must not overwrite a prior user decision.
  • QR export captures capped independent profile snapshots before deferred work. Incremental generation is owned by the result window and stops on close; a malformed item cannot retarget or invalidate completed tabs. Resizing scales the cached module image at integer factors with its quiet zone, rather than regenerating or smoothing secret-bearing QR content. Reuse plugin export semantics and never log the encoded URI.
  • Log views keep per-filter cursors and catch up on visibility; metrics pages derive series from shared raw history. Switching pages, ranges, or filters must not reset collection or create a second history.

Verification and evolution

  • Verify initial/plugin navigation, shared Home/Settings/tray state, service ownership, lazy rendering versus continuous collection, async continuation cleanup, unsaved-close behavior, translation/theme changes, geometry migration, and repeated open/show/hide/destroy stability with real Qt input where semantics depend on it. Keep this guide as current architectural memory: change it with intentional page ownership, not after forcing new code through stale structure. Relevant anchors include tests/test_ui_behavior.py, tests/test_qr_export_scalability.py, tests/test_metrics_behavior.py, and tests/test_main_window_geometry.py.