Sessions: deleting the open chat opens the next one listed (fixes #427) #463
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 603 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.383
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #463"
general
weight: 0.35
Giton22
What and why
When you deleted the chat you were in, Kyllene put you on a new empty chat. Most chat apps open the next chat in the list, and now Kyllene does too.
Deleting the open chat, from the sidebar or from the chat's ⋯ options, now opens the chat listed after it in the list you're looking at. If it was the last row, the one before it opens. A new chat starts only when no other chat is listed.
Fixes #427
How
neighbourAfterRemoving(next tostepChatinShortcuts.kt) chooses which row replaces the deleted one.ShownChatsholder up to date with the rows it shows, top to bottom. The chat options menu reads the same holder, so both delete paths use the same order.SessionsViewModel.delete, because the delete removes the row from the list straight away.App.ktopens the neighbour withopenSession, carrying the "New messages" read point. If there is no neighbour, it callsnewChat()as before.Each view
If the delete fails
The neighbour has already opened by the time the gateway answers. If the delete then fails, the existing rollback puts the deleted chat back in the list and shows the error, and the user stays in the neighbour, which is a working chat. I kept this simple: no jumping back, and nothing is left half-open.
How I tested it
DesktopUxTest:-
aRemovedRowHandsOverToTheNextOrThePrevious: a middle row, the first, the last, the only row, a row that isn't in the list, an empty list.-
aDeletedChatOpensTheOneListedInItsPlace:ShownChats.afterbefore the sidebar has reported, the next and previous rows, a chat not listed, the only chat.:desktopApp:compileKotlinJvm: passes, with no test failures. I ran it with--no-daemon, and with the stray"stripped from this machine'sPATH(the known Windows problem in CONTRIBUTING).- With chat B open and C listed under it, deleting B from the sidebar opened C, and C was highlighted.
- Deleting C from the ⋯ menu opened the next chat in the list.
Not checked on a device:
Review fixes
A review of this PR found four cases, fixed in two follow-up commits:
ListFocushas its doc comment back.The list the neighbour comes from is now
chatsInView, a plain function, withChatsInViewTestcovering each view (Recent, another filter, search with and without results, a closed sidebar, the Bots side, windowed chats, a thread's later id).Checked on the emulator against the throwaway gateway: the closed-drawer search case failed on the first commit (the search hit opened) and passes now (the next chat in Recent opens). Deleting the last row opens the one before it. Deleting a chat that isn't open leaves the open chat alone. The desktop cases are covered by unit tests only; the desktop app was compiled, not run.
Not changed: after a failed delete the user stays in the neighbour, and the end of the loaded page counts as the end of the list.
Reviewed with a Gemini loop: 1 round with gemini-4-neon-high. Verdict: approved.
Created with Claude Opus 5.5 in Claude Code.