Skip to content

Fix ultraplan h/l navigation direction in grouped sidebar#695

Merged
Iron-Ham merged 1 commit into
mainfrom
Iron-Ham/9bb5d7ea-somehow-weve-swapped-the-behav
Mar 21, 2026
Merged

Fix ultraplan h/l navigation direction in grouped sidebar#695
Iron-Ham merged 1 commit into
mainfrom
Iron-Ham/9bb5d7ea-somehow-weve-swapped-the-behav

Conversation

@Iron-Ham
Copy link
Copy Markdown
Owner

Summary

  • Fixes h/l navigation going in the wrong visual direction in ultraplan mode with groups. Navigation used plan-execution order (getNavigableInstances) while the sidebar rendered in group-structure order (FlattenGroupsForDisplay), causing the two to diverge. Navigation now follows the visual display order filtered to navigable instances.
  • Fixes silent plan validation failurehandlePlanFileCheckResult was silently swallowing SetPlan errors, leaving users stuck in a session that would never progress. Now sets an error message and transitions to PhaseFailed.
  • Removes dead SelectedNavIdx field from ultraplan state (written but never read).
  • Updates getNavigableInstances doc comment to reflect its reduced role as a membership set provider (ordering now comes from getInstanceDisplayOrder).

Test plan

  • go build ./... passes
  • go vet ./... passes
  • gofmt -d . shows no output
  • go test -race ./internal/tui/... -count=1 passes (all 13 packages)
  • Manual: run ultraplan with groups, verify l moves down visually and h moves up

Navigation used getNavigableInstances() which builds its list in
plan-execution order, but the sidebar renders via FlattenGroupsForDisplay
which uses group-structure order. These orderings diverge because
instances are added to groups in creation order, not plan order.

Now navigateToNextInstance() uses getInstanceDisplayOrder() (the same
ordering the sidebar renders) filtered to the navigable instance set,
ensuring h/l move in the direction the user visually expects.

Also fixes:
- handlePlanFileCheckResult silently swallowing SetPlan errors, leaving
  users stuck in a dead session
- Removes dead SelectedNavIdx field from ultraplan state
- Updates getNavigableInstances doc comment to reflect its reduced role
  as a membership set provider
@Iron-Ham Iron-Ham marked this pull request as ready for review March 21, 2026 02:23
@Iron-Ham Iron-Ham merged commit 1412b71 into main Mar 21, 2026
6 checks passed
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