Navi Code TUI: unify session commands on shared workers; /switch hybrid
Route /new, /sessions, and /switch through shared app-side logic instead of
each command reimplementing the switch path:
- _open_sessions_picker(): pushes SessionsPickerScreen and wires the select
  callback to _switch_session_worker / _create_new_session_worker. Both
  /sessions and /switch (no/ambiguous arg) use it.
- /new -> _create_new_session_worker (was: inline create + attach + clear).
- /switch <prefix>: resolve to a single navi_code session (exact id, then
  prefix match) and switch directly via _switch_session_worker; no/ambiguous/
  unknown arg opens the picker pre-filtered to what was typed. This removes
  the latent clear()-after-attach bug from the old SwitchCommand (clear erased
  the history that attach_session had just replayed).
- SessionsPickerScreen gains initial_query to open pre-filtered.

Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dc5a465 commit e9d5ec5798382e75d813c10f00b75c7a4cf1fbd8
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 1 day ago
Showing 4 changed files
View
clients/terminal/tui/commands/builtin.py
View
clients/terminal/tui/screens/sessions_picker.py
View
clients/terminal/tui/tui_app.py
View
tests/clients/test_sessions_picker.py