Skip to content

Commit 5ccf06c

Browse files
committed
hide AI button config
1 parent 458fcc2 commit 5ccf06c

7 files changed

Lines changed: 14 additions & 1 deletion

File tree

docs/docs/config.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ wsh editconfig
4040
| app:showoverlayblocknums | bool | Set to false to disable the Ctrl+Shift block number overlay that appears when holding Ctrl+Shift (defaults to true) |
4141
| app:ctrlvpaste | bool | On Windows/Linux, when null (default) uses Control+V on Windows only. Set to true to force Control+V on all non-macOS platforms, false to disable the accelerator. macOS always uses Command+V regardless of this setting |
4242
| app:confirmquit <VersionBadge version="v0.14" /> | bool | Set to false to disable the quit confirmation dialog when closing Wave Terminal (defaults to true, requires app restart) |
43+
| app:hideaibutton <VersionBadge version="v0.14" /> | bool | Set to true to hide the AI button in the tab bar (defaults to false) |
4344
| ai:preset | string | the default AI preset to use |
4445
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
4546
| ai:apitoken | string | your AI api token |

frontend/app/tab/tabbar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Button } from "@/app/element/button";
55
import { modalsModel } from "@/app/store/modalmodel";
66
import { WorkspaceLayoutModel } from "@/app/workspace/workspace-layout-model";
77
import { deleteLayoutModelForTab } from "@/layout/index";
8-
import { atoms, createTab, getApi, globalStore, setActiveTab } from "@/store/global";
8+
import { atoms, createTab, getApi, getSettingsKeyAtom, globalStore, setActiveTab } from "@/store/global";
99
import { isMacOS, isWindows } from "@/util/platformutil";
1010
import { fireAndForget } from "@/util/util";
1111
import { useAtomValue } from "jotai";
@@ -44,12 +44,17 @@ interface TabBarProps {
4444

4545
const WaveAIButton = memo(() => {
4646
const aiPanelOpen = useAtomValue(WorkspaceLayoutModel.getInstance().panelVisibleAtom);
47+
const hideAiButton = useAtomValue(getSettingsKeyAtom("app:hideaibutton"));
4748

4849
const onClick = () => {
4950
const currentVisible = WorkspaceLayoutModel.getInstance().getAIPanelVisible();
5051
WorkspaceLayoutModel.getInstance().setAIPanelVisible(!currentVisible);
5152
};
5253

54+
if (hideAiButton) {
55+
return null;
56+
}
57+
5358
return (
5459
<div
5560
className={`flex h-[26px] px-1.5 justify-end items-center rounded-md mr-1 box-border cursor-pointer bg-hover hover:bg-hoverbg transition-colors text-[12px] ${aiPanelOpen ? "text-accent" : "text-secondary"}`}

frontend/types/gotypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ declare global {
12371237
"app:showoverlayblocknums"?: boolean;
12381238
"app:ctrlvpaste"?: boolean;
12391239
"app:confirmquit"?: boolean;
1240+
"app:hideaibutton"?: boolean;
12401241
"feature:waveappbuilder"?: boolean;
12411242
"ai:*"?: boolean;
12421243
"ai:preset"?: string;

pkg/wconfig/defaultconfig/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ai:timeoutms": 60000,
66
"app:defaultnewblock": "term",
77
"app:confirmquit": true,
8+
"app:hideaibutton": false,
89
"autoupdate:enabled": true,
910
"autoupdate:installonquit": true,
1011
"autoupdate:intervalms": 3600000,

pkg/wconfig/metaconsts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
ConfigKey_AppShowOverlayBlockNums = "app:showoverlayblocknums"
1414
ConfigKey_AppCtrlVPaste = "app:ctrlvpaste"
1515
ConfigKey_AppConfirmQuit = "app:confirmquit"
16+
ConfigKey_AppHideAiButton = "app:hideaibutton"
1617

1718
ConfigKey_FeatureWaveAppBuilder = "feature:waveappbuilder"
1819

pkg/wconfig/settingsconfig.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type SettingsType struct {
6060
AppShowOverlayBlockNums *bool `json:"app:showoverlayblocknums,omitempty"`
6161
AppCtrlVPaste *bool `json:"app:ctrlvpaste,omitempty"`
6262
AppConfirmQuit *bool `json:"app:confirmquit,omitempty"`
63+
AppHideAiButton bool `json:"app:hideaibutton,omitempty"`
6364

6465
FeatureWaveAppBuilder bool `json:"feature:waveappbuilder,omitempty"`
6566

schema/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"app:confirmquit": {
2727
"type": "boolean"
2828
},
29+
"app:hideaibutton": {
30+
"type": "boolean"
31+
},
2932
"feature:waveappbuilder": {
3033
"type": "boolean"
3134
},

0 commit comments

Comments
 (0)