Skip to content

Epic expand/collapse broken in Active/Ready view modes #11

@dreamiurg

Description

@dreamiurg

Bug Description

When using the V key to switch to Active or Ready view mode, epic expand/collapse stops working. The triangle indicator (▼/▶) toggles visually when clicking or pressing Space/arrow keys, but the tree doesn't actually expand or collapse - children remain visible regardless of the indicator state.

Steps to Reproduce

  1. Open Abacus in a repository with epics that have children
  2. Press V to switch to Active view (or press again for Ready view)
  3. Try to collapse an expanded epic using Space, Right arrow, or clicking the triangle
  4. Observe: Triangle changes from ▼ to ▶, but children remain visible

Expected Behavior

Children should hide when the epic is collapsed, matching the triangle indicator state.

Actual Behavior

Triangle toggles visually but children remain visible. The expand/collapse has no effect.

Environment

  • Abacus version: 0.8.0
  • OS: macOS (Darwin 24.6.0)

Root Cause Analysis

The bug is in internal/ui/state_expansion.go. The functions expandNodeForView() and collapseNodeForView() check m.filterText == "" to decide whether to track filter override state (filterForcedExpanded/filterCollapsed), but they ignore view mode filtering (m.viewMode != ViewModeAll).

When in Active/Ready view mode:

  • filterText is empty, so the early return triggers
  • Filter override state is never set
  • shouldExpandFilteredNode() uses default behavior instead of user's explicit toggle

Fix

I have a fix ready in my fork that:

  1. Adds isFilterActive() helper checking both text filter AND view mode
  2. Uses this helper consistently in expandNodeForView(), collapseNodeForView(), isNodeExpandedInView(), and recalcVisibleRows()
  3. Includes a regression test TestViewModeExpandCollapse

Will submit a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions