Skip to content

Commit 0c5a820

Browse files
authored
new config: app:hideaibutton, app:disablectrlshiftarrows, app:disablectrlshiftdisplay (#2850)
| app:hideaibutton <VersionBadge version="v0.14" /> | bool | Set to true to hide the AI button in the tab bar (defaults to false) | | app:disablectrlshiftarrows <VersionBadge version="v0.14" /> | bool | Set to true to disable Ctrl+Shift+Arrow keybindings for block navigation (defaults to false) | | app:disablectrlshiftdisplay <VersionBadge version="v0.14" /> | bool | Set to true to disable the Ctrl+Shift visual indicator display (defaults to false) |
1 parent 1949aab commit 0c5a820

File tree

8 files changed

+63
-10
lines changed

8 files changed

+63
-10
lines changed

docs/docs/config.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ 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) |
44+
| app:disablectrlshiftarrows <VersionBadge version="v0.14" /> | bool | Set to true to disable Ctrl+Shift+Arrow keybindings for block navigation (defaults to false) |
45+
| app:disablectrlshiftdisplay <VersionBadge version="v0.14" /> | bool | Set to true to disable the Ctrl+Shift visual indicator display (defaults to false) |
4346
| ai:preset | string | the default AI preset to use |
4447
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
4548
| ai:apitoken | string | your AI api token |
@@ -67,7 +70,7 @@ wsh editconfig
6770
| term:macoptionismeta | bool | on macOS, treat the Option key as Meta key for terminal keybindings (default false) |
6871
| term:bellsound <VersionBadge version="v0.14" /> | bool | when enabled, plays the system beep sound when the terminal bell (BEL character) is received (default false) |
6972
| term:bellindicator <VersionBadge version="v0.14" /> | bool | when enabled, shows a visual indicator in the tab when the terminal bell is received (default false) |
70-
| term:durable <VersionBadge version="v0.14" /> | bool | makes remote terminal sessions durable across network disconnects (defaults to true) |
73+
| term:durable <VersionBadge version="v0.14" /> | bool | makes remote terminal sessions durable across network disconnects (defaults to false) |
7174
| editor:minimapenabled | bool | set to false to disable editor minimap |
7275
| editor:stickyscrollenabled | bool | enables monaco editor's stickyScroll feature (pinning headers of current context, e.g. class names, method names, etc.), defaults to false |
7376
| editor:wordwrap | bool | set to true to enable word wrapping in the editor (defaults to false) |
@@ -99,12 +102,13 @@ wsh editconfig
99102
| window:showmenubar | bool | set to use the OS-native menu bar (Windows and Linux only, requires app restart) |
100103
| window:nativetitlebar | bool | set to use the OS-native title bar, rather than the overlay (Windows and Linux only, requires app restart) |
101104
| window:disablehardwareacceleration | bool | set to disable Chromium hardware acceleration to resolve graphical bugs (requires app restart) |
105+
| window:fullscreenonlaunch | bool | set to true to launch the foreground window in fullscreen mode (defaults to false) |
102106
| window:savelastwindow | bool | when `true`, the last window that is closed is preserved and is reopened the next time the app is launched (defaults to `true`) |
103107
| window:confirmonclose | bool | when `true`, a prompt will ask a user to confirm that they want to close a window if it has an unsaved workspace with more than one tab (defaults to `true`) |
104108
| window:dimensions | string | set the default dimensions for new windows using the format "WIDTHxHEIGHT" (e.g. "1920x1080"). when a new window is created, these dimensions will be automatically applied. The width and height values should be specified in pixels. |
105109
| telemetry:enabled | bool | set to enable/disable telemetry |
106110

107-
For reference, this is the current default configuration (v0.11.5):
111+
For reference, this is the current default configuration (v0.14.0):
108112

109113
```json
110114
{
@@ -114,6 +118,9 @@ For reference, this is the current default configuration (v0.11.5):
114118
"ai:timeoutms": 60000,
115119
"app:defaultnewblock": "term",
116120
"app:confirmquit": true,
121+
"app:hideaibutton": false,
122+
"app:disablectrlshiftarrows": false,
123+
"app:disablectrlshiftdisplay": false,
117124
"autoupdate:enabled": true,
118125
"autoupdate:installonquit": true,
119126
"autoupdate:intervalms": 3600000,
@@ -128,14 +135,15 @@ For reference, this is the current default configuration (v0.11.5):
128135
"window:magnifiedblockopacity": 0.6,
129136
"window:magnifiedblocksize": 0.9,
130137
"window:magnifiedblockblurprimarypx": 10,
138+
"window:fullscreenonlaunch": false,
131139
"window:magnifiedblockblursecondarypx": 2,
132140
"window:confirmclose": true,
133141
"window:savelastwindow": true,
134142
"telemetry:enabled": true,
135143
"term:bellsound": false,
136144
"term:bellindicator": false,
137145
"term:copyonselect": true,
138-
"term:durable": true,
146+
"term:durable": false,
139147
"waveai:showcloudmodes": true,
140148
"waveai:defaultmode": "waveai@balanced"
141149
}

frontend/app/store/keymodel.ts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ function getSimpleControlShiftAtom() {
7676

7777
function setControlShift() {
7878
globalStore.set(simpleControlShiftAtom, true);
79-
setTimeout(() => {
80-
const simpleState = globalStore.get(simpleControlShiftAtom);
81-
if (simpleState) {
82-
globalStore.set(atoms.controlShiftDelayAtom, true);
83-
}
84-
}, 400);
79+
const disableDisplay = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftdisplay"));
80+
if (!disableDisplay) {
81+
setTimeout(() => {
82+
const simpleState = globalStore.get(simpleControlShiftAtom);
83+
if (simpleState) {
84+
globalStore.set(atoms.controlShiftDelayAtom, true);
85+
}
86+
}, 400);
87+
}
8588
}
8689

8790
function unsetControlShift() {
@@ -528,18 +531,34 @@ function registerGlobalKeys() {
528531
return true;
529532
});
530533
globalKeyMap.set("Ctrl:Shift:ArrowUp", () => {
534+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
535+
if (disableCtrlShiftArrows) {
536+
return false;
537+
}
531538
switchBlockInDirection(NavigateDirection.Up);
532539
return true;
533540
});
534541
globalKeyMap.set("Ctrl:Shift:ArrowDown", () => {
542+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
543+
if (disableCtrlShiftArrows) {
544+
return false;
545+
}
535546
switchBlockInDirection(NavigateDirection.Down);
536547
return true;
537548
});
538549
globalKeyMap.set("Ctrl:Shift:ArrowLeft", () => {
550+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
551+
if (disableCtrlShiftArrows) {
552+
return false;
553+
}
539554
switchBlockInDirection(NavigateDirection.Left);
540555
return true;
541556
});
542557
globalKeyMap.set("Ctrl:Shift:ArrowRight", () => {
558+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
559+
if (disableCtrlShiftArrows) {
560+
return false;
561+
}
543562
switchBlockInDirection(NavigateDirection.Right);
544563
return true;
545564
});

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,9 @@ declare global {
12501250
"app:showoverlayblocknums"?: boolean;
12511251
"app:ctrlvpaste"?: boolean;
12521252
"app:confirmquit"?: boolean;
1253+
"app:hideaibutton"?: boolean;
1254+
"app:disablectrlshiftarrows"?: boolean;
1255+
"app:disablectrlshiftdisplay"?: boolean;
12531256
"feature:waveappbuilder"?: boolean;
12541257
"ai:*"?: boolean;
12551258
"ai:preset"?: string;

pkg/wconfig/defaultconfig/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"ai:timeoutms": 60000,
66
"app:defaultnewblock": "term",
77
"app:confirmquit": true,
8+
"app:hideaibutton": false,
9+
"app:disablectrlshiftarrows": false,
10+
"app:disablectrlshiftdisplay": false,
811
"autoupdate:enabled": true,
912
"autoupdate:installonquit": true,
1013
"autoupdate:intervalms": 3600000,

pkg/wconfig/metaconsts.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const (
1313
ConfigKey_AppShowOverlayBlockNums = "app:showoverlayblocknums"
1414
ConfigKey_AppCtrlVPaste = "app:ctrlvpaste"
1515
ConfigKey_AppConfirmQuit = "app:confirmquit"
16+
ConfigKey_AppHideAiButton = "app:hideaibutton"
17+
ConfigKey_AppDisableCtrlShiftArrows = "app:disablectrlshiftarrows"
18+
ConfigKey_AppDisableCtrlShiftDisplay = "app:disablectrlshiftdisplay"
1619

1720
ConfigKey_FeatureWaveAppBuilder = "feature:waveappbuilder"
1821

pkg/wconfig/settingsconfig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ 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"`
64+
AppDisableCtrlShiftArrows bool `json:"app:disablectrlshiftarrows,omitempty"`
65+
AppDisableCtrlShiftDisplay bool `json:"app:disablectrlshiftdisplay,omitempty"`
6366

6467
FeatureWaveAppBuilder bool `json:"feature:waveappbuilder,omitempty"`
6568

schema/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
"app:confirmquit": {
2727
"type": "boolean"
2828
},
29+
"app:hideaibutton": {
30+
"type": "boolean"
31+
},
32+
"app:disablectrlshiftarrows": {
33+
"type": "boolean"
34+
},
35+
"app:disablectrlshiftdisplay": {
36+
"type": "boolean"
37+
},
2938
"feature:waveappbuilder": {
3039
"type": "boolean"
3140
},

0 commit comments

Comments
 (0)