co-mono/packages
Sviatoslav Abakumov 4ca7bbe450
Fix tree selector focus behavior (#1142)
* fix(coding-agent): tree selector focuses nearest visible ancestor

When the selected entry is not visible (filtered out by mode change or a
metadata entry like model_change), walk up the parent chain to find the
nearest visible ancestor instead of jumping to the last item.

Fixes selection behavior for:

- Initial selection when currentLeafId is a metadata entry
- Filter switching, e.g. Ctrl+U for user-only mode

* fix(coding-agent): tree selector preserves selection through empty filters

When switching to a filter with no results, e.g. labeled-only with no
labels and back, the cursor would reset to the first message instead of
the original selection.

Track lastSelectedId as a class member and only update it when
filteredNodes is non-empty, preserving the selection across empty filter
results.

* test(coding-agent): add tree selector filter and selection tests

- Test metadata entry handling (model_change, thinking_level_change)
- Test filter switching with parent traversal (default ↔ user-only)
- Test empty filter preservation (labeled-only with no labels)
2026-02-01 13:23:52 +01:00
..
agent Add [Unreleased] section for next cycle 2026-02-01 09:36:24 +01:00
ai Add [Unreleased] section for next cycle 2026-02-01 09:36:24 +01:00
coding-agent Fix tree selector focus behavior (#1142) 2026-02-01 13:23:52 +01:00
mom Add [Unreleased] section for next cycle 2026-02-01 09:36:24 +01:00
pods Release v0.50.9 2026-02-01 09:35:42 +01:00
tui Add [Unreleased] section for next cycle 2026-02-01 09:36:24 +01:00
web-ui Add [Unreleased] section for next cycle 2026-02-01 09:36:24 +01:00