mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-11-28 05:00:26 +08:00
Don't allow tabs with active Wave AI sessions to get closed when we close the last block. Have Cmd-W close Wave AI if it is focused (rather than a random node). Also fixes some lurking bugs with the pinned tab functionality (and adds some nice visual feedback when we try to close a pinned tab).
26 lines
No EOL
666 B
TypeScript
26 lines
No EOL
666 B
TypeScript
// Copyright 2025, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { atom, type PrimitiveAtom } from "jotai";
|
|
import { globalStore } from "@/app/store/jotaiStore";
|
|
|
|
export class TabBarModel {
|
|
private static instance: TabBarModel | null = null;
|
|
|
|
jigglePinAtom: PrimitiveAtom<number> = atom(0);
|
|
|
|
private constructor() {
|
|
// Empty for now
|
|
}
|
|
|
|
static getInstance(): TabBarModel {
|
|
if (!TabBarModel.instance) {
|
|
TabBarModel.instance = new TabBarModel();
|
|
}
|
|
return TabBarModel.instance;
|
|
}
|
|
|
|
jiggleActivePinnedTab() {
|
|
globalStore.set(this.jigglePinAtom, (prev) => prev + 1);
|
|
}
|
|
} |