Behaviour. Toggling the chat in a tab that shows no widget moves the most recent session out of the tab it was in, leaving that tab empty. Toggle can therefore never produce a second session, so every tab ends up showing the same conversation.
Expected. A new session for that tab, as before #297, when the tabpage-keyed registry created one for any tab that had none.
Repro.
- Open the chat in tab A.
:tabnew.
- Toggle the chat in tab B.
Tab B shows session 1, tab A is empty, session count is still 1.
Cause. open/toggle resolve through current(), which falls back to _most_recent when nothing is visible in the current tab; show_session then moves it. The same fallback bites harder in create_with_current_session_guard: from a tab with no widget, the keep-or-destroy prompt is about a session in a different tab, and "destroy" kills it there.
new_session() still creates correctly, but it is not the key you reach for to open the chat and has no default keymap.
Not asking for one-conversation-per-tab back. Removing that limit did not require removing per-tab creation, and both went at once. Should open/toggle create when visible_here() is nil? I have a failing test if useful.
Found while rebasing #267 onto main; the reconnect path there needs rework for the same concurrent-session model, which I will follow up on in that PR.
Behaviour. Toggling the chat in a tab that shows no widget moves the most recent session out of the tab it was in, leaving that tab empty. Toggle can therefore never produce a second session, so every tab ends up showing the same conversation.
Expected. A new session for that tab, as before #297, when the tabpage-keyed registry created one for any tab that had none.
Repro.
:tabnew.Tab B shows session 1, tab A is empty, session count is still 1.
Cause.
open/toggleresolve throughcurrent(), which falls back to_most_recentwhen nothing is visible in the current tab;show_sessionthen moves it. The same fallback bites harder increate_with_current_session_guard: from a tab with no widget, the keep-or-destroy prompt is about a session in a different tab, and "destroy" kills it there.new_session()still creates correctly, but it is not the key you reach for to open the chat and has no default keymap.Not asking for one-conversation-per-tab back. Removing that limit did not require removing per-tab creation, and both went at once. Should
open/togglecreate whenvisible_here()is nil? I have a failing test if useful.Found while rebasing #267 onto main; the reconnect path there needs rework for the same concurrent-session model, which I will follow up on in that PR.