fix: auto-name uses session model + pane auto-remove on last tab close
Two independent UI/UX fixes: - auto_name.ts: pass the session's own model as fallbackModel to taskModelCompletion, so chat rename uses whatever model is already loaded on llama-swap instead of forcing a swap to DEFAULT_MODEL (which times out at 10s when a different model is active). - useWorkspacePanes.ts: when the last tab in a pane is closed and other panes exist, remove the pane entirely instead of leaving an orphaned empty panel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -391,6 +391,13 @@ export function useWorkspacePanes(sessionId: string): UseWorkspacePanesResult {
|
||||
const pane = next[paneIdx]!;
|
||||
const nextIds = pane.chatIds.filter((id) => id !== chatId);
|
||||
if (nextIds.length === 0) {
|
||||
if (next.length > 1) {
|
||||
// Last tab closed and other panes exist — remove the whole pane
|
||||
// instead of leaving an orphaned empty panel.
|
||||
const spliced = next.filter((_, i) => i !== paneIdx);
|
||||
setActivePaneIdx((ai) => Math.min(ai, spliced.length - 1));
|
||||
return spliced;
|
||||
}
|
||||
next[paneIdx] = { ...pane, kind: 'empty', chatId: undefined, chatIds: [], activeChatIdx: -1 };
|
||||
} else {
|
||||
const nextActiveIdx = Math.min(pane.activeChatIdx, nextIds.length - 1);
|
||||
|
||||
Reference in New Issue
Block a user