Skip to content

feat(app): replace topic-based grouping with plan-based instance grouping#6

Open
brkastner wants to merge 7 commits intomainfrom
kas/plan-instance-grouping
Open

feat(app): replace topic-based grouping with plan-based instance grouping#6
brkastner wants to merge 7 commits intomainfrom
kas/plan-instance-grouping

Conversation

@brkastner
Copy link
Contributor

Summary

  • List filtering: Instances are now grouped and filtered by PlanFile instead of topic name; sidebar selection filters the instance list to show only instances assigned to that plan (or "ungrouped" instances)
  • Sidebar plan counts: Sidebar shows per-plan instance counts with a new GroupStatus type; search match highlighting is keyed by plan file
  • m keybind → Assign to Plan: Pressing m on an instance opens a picker overlay to reassign it to any known plan
  • Plan context menu: Right-clicking a plan in the sidebar now offers "Kill running instances" to stop all running instances in that plan group
  • Legacy topic cleanup: Removed filterInstancesByTopic, filterSearchWithTopic, KillInstancesByTopic, and SetSearchFilterWithTopic — all callers updated to the plan-based equivalents

Test Plan

  • go test ./... -count=1 — all packages green
  • New test files added for each task: list filter, sidebar counts, app state wiring, assign-plan input, plan context actions, and instance grouping field guard

- Add stateMoveTo case to View() so the plan-assign picker is actually
  rendered (was falling through to default, invisible to the user)
- Fix cancel_plan goroutine race: remove model mutations from the async
  action; return planRefreshMsg{} so Update applies them on the main loop
- Fix kill_running_instances_in_plan race: snapshot instances before the
  goroutine, call inst.Kill() (I/O only) in the goroutine, return
  killPlanInstancesMsg; add Update handler + List.RemoveByPlan for the
  model mutations; drop the dead OnConfirm path entirely
- Propagate sidebar selected plan file (PlanFile) into new instances
  created via KeyPrompt ('N'), KeyNew ('n'), and KeyNewSkipPermissions
  ('S') so new instances are grouped under the active plan
- Update test to use pendingConfirmAction flow instead of the defunct
  OnConfirm callback; add targeted tests for each fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant