Skip to content

Optional: extract the describe flow into a controller #245

Description

@hellices

Optional follow-up from #238, where the measurement showed that describe
needs no new infrastructure to leave app.py.

Measurement

On main at 655f38e, the describe flow is 7 methods / 179 lines and
touches 19 app attributes, of which the existing seams already cover 12:

Covered by count
ViewState 4
UiSurface 4
WriteGate 4
would need injecting 7

The seven: _get_events, _get_manifest (data getters, the same shape
ForwardController already takes), _mark_agent_action,
_approval_dialog_active (agent coordination), and
_agent_panel_expanded, _provider_footer, query_one (layout).

For comparison: OperatorController takes 8 and ShellController 11.

Why this is optional, not owed

#187 closed on coupling criteria rather than a line count, and those
criteria are met. This slice removes ~179 lines and adds a seventh
controller; the case for it is that describe is self-contained and cheap,
not that app.py is still too big.

The case against is equally worth stating: every extraction so far cost
about one regression caught in review, and found zero pre-existing defects.
That is a real price for a cohesive 179-line area that is not currently
hard to work in.

If it is done

  • Characterization tests first — describe has an agent entry point
    (agent_open_describe) as well as the d key, and both must keep
    behaving identically.
  • The :ctx error path (_describe_ctx_error) and the precheck's
    fail-open semantics are the parts most likely to be broken silently.
  • docs/dev/ui-controllers.md records the extraction order and would need
    updating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: uiTextual application, screens, widgets, and interaction designconcern: architectureModule boundaries, dependency direction, and system structureenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions