Extract dashboard state/model layer into dashboard_model.py #173

Merged
didericis merged 1 commits from issue-158-dashboard-model into main 2026-06-03 11:56:47 -04:00
Collaborator

Closes #158.

Summary

  • Splits bot_bottle/cli/dashboard.py (2103 lines) into two modules: the new dashboard_model.py carries the state/model layer; dashboard.py retains the curses TUI, $EDITOR integration, tmux subprocess flows, and action handlers (approve, reject, operator_edit_routes, operator_edit_allowlist).
  • dashboard.py re-imports everything from dashboard_model so all existing callers, tests, and monkey-patch patterns are unaffected.
  • Adds tests/unit/test_dashboard_model.py with 13 tests covering _approval_status, _proposed_payload_label, and _suffix_for_tool — three helpers that had no prior coverage.
  • No behavioral changes; all 894 unit tests pass.

Changes (1 commit)

  • f0ca4e3 refactor: extract dashboard state/model layer into dashboard_model.py
Closes #158. ## Summary - Splits `bot_bottle/cli/dashboard.py` (2103 lines) into two modules: the new `dashboard_model.py` carries the state/model layer; `dashboard.py` retains the curses TUI, `$EDITOR` integration, tmux subprocess flows, and action handlers (`approve`, `reject`, `operator_edit_routes`, `operator_edit_allowlist`). - `dashboard.py` re-imports everything from `dashboard_model` so all existing callers, tests, and monkey-patch patterns are unaffected. - Adds `tests/unit/test_dashboard_model.py` with 13 tests covering `_approval_status`, `_proposed_payload_label`, and `_suffix_for_tool` — three helpers that had no prior coverage. - No behavioral changes; all 894 unit tests pass. ## Changes (1 commit) - [`f0ca4e3`](https://gitea.dideric.is/didericis/bot-bottle/src/commit/f0ca4e352770ea8902d3d452a67a1f38ba45c2f8/bot_bottle/cli/dashboard_model.py) refactor: extract dashboard state/model layer into dashboard_model.py
didericis-claude added 1 commit 2026-06-03 11:53:31 -04:00
refactor: extract dashboard state/model layer into dashboard_model.py
test / unit (pull_request) Successful in 41s
test / integration (pull_request) Successful in 47s
test / unit (push) Successful in 35s
test / integration (push) Successful in 44s
f0ca4e3527
Splits the 2103-line dashboard.py into two modules. Pure data
structures (QueuedProposal), discovery helpers (discover_pending,
discover_active_agents), derived-value helpers (_is_recent,
_approval_status, _format_agent_row, _detail_lines, etc.), and
argv-builder helpers (_build_split_pane_argv, _build_respawn_pane_argv,
_build_resume_argv_with_fallback, _agent_runtime_args) all move to
dashboard_model.py. The curses TUI, $EDITOR integration, tmux
subprocess flows, and action handlers (approve, reject,
operator_edit_routes, operator_edit_allowlist) remain in dashboard.py,
which re-imports everything from dashboard_model so existing callers and
tests are unaffected.

Adds tests/unit/test_dashboard_model.py covering _approval_status,
_proposed_payload_label, and _suffix_for_tool — three helpers that had
no prior coverage. All 894 unit tests pass.

Closes #158
didericis approved these changes 2026-06-03 11:56:37 -04:00
didericis left a comment
Owner

Have some quibbles with the split, but not enough to justify spending more time on reorganizing this

Have some quibbles with the split, but not enough to justify spending more time on reorganizing this
didericis merged commit f0ca4e3527 into main 2026-06-03 11:56:47 -04:00
didericis deleted branch issue-158-dashboard-model 2026-06-03 11:56:47 -04:00
Sign in to join this conversation.