Preserve filter and selection across attach/detach in the interactive overview (Closes #27)
Filing in / out of sessions cleared the overview's filter on every
return (and reset the selection), which made navigating multiple
sessions feel disorienting per @schickling-assistant's report.
Mechanism: doAttach's onDetach/onExit handlers, doAttachRemote's
post-attach refresh, and doSpawnRemote's post-spawn refresh all
explicitly called filterField.set({ text: "", cursor: 0 }) before
resuming the app. Removing those clears makes the module-level
signals naturally persist across the attach round-trip.
The selection clamp logic is intentionally kept — when the list
shrinks (e.g., the session you were attached to exits and gets
reaped before you return), selectedIndex still snaps in-bounds via
the existing Math.max(0, totalItems - 1) check. That's the right
behavior either way and is independent of the filter-preservation
fix.
Test (tests/tui.test.ts) creates three sessions, types a filter
that narrows to one, attaches to it, detaches, and asserts: the
"Filter: ..." line still shows the typed value, the matched
session is still visible, the other two are still hidden by the
filter. Then ctrl+u clears it and the other two reappear, which
also confirms the filter cursor is preserved (ctrl+u operates on
the live cursor position).