Skip to content

Commit 0e8eb83

Browse files
authored
Updates to prepare for v0.12 launch (#2434)
Documentation Updates (removing AI Widget Information / deprecation) Hover effect on tool calls shows which widget is effected Remove AI Widget from sidebar unless there is customized presets Backend now provides blockid (if available) to frontend for tool calls
1 parent a2f1d4f commit 0e8eb83

File tree

23 files changed

+218
-80
lines changed

23 files changed

+218
-80
lines changed

docs/docs/ai-presets.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ sidebar_position: 3.6
33
id: "ai-presets"
44
title: "AI Presets"
55
---
6+
:::warning Deprecation Notice
7+
The AI Widget and its presets are being replaced by [Wave AI](./waveai.mdx). Please refer to the Wave AI documentation for the latest AI features and configuration options.
8+
:::
9+
610

711
![AI Presets Menu](./img/ai-presets.png#right)
812

docs/docs/customization.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,4 @@ wsh setbg --print "#ff0000"
8181

8282
For more advanced customization options including gradients, colors, and saving your own background presets, check out our [Background Configuration](/presets#background-configurations) documentation.
8383

84-
## Presets
8584

86-
For more advanced customization, to set up multiple AI models, and your own tab backgrounds, check out our [Presets Documentation](./presets).

docs/docs/faq.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ title: "FAQ"
66

77
# FAQ
88

9-
### How do I configure Wave to use different AI models/providers?
10-
11-
Wave supports various AI providers including local LLMs (via Ollama), Azure OpenAI, Anthropic's Claude, and Perplexity. The recommended way to configure these is through AI presets, which let you set up and easily switch between different providers and models.
12-
13-
See our [AI Presets documentation](/ai-presets) for detailed setup instructions for each provider.
14-
159
### How do I enable Claude Code support with Shift+Enter?
1610

1711
Wave supports Claude Code and similar AI coding tools that expect Shift+Enter to send an escape sequence + newline (`\u001b\n`) instead of a regular carriage return. This can be enabled using the `term:shiftenternewline` configuration setting.

docs/docs/gettingstarted.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ You can also download installers directly from our [Downloads page](https://www.
9090
### Tabs and Blocks
9191

9292
- **Tabs**: Like browser tabs, these help organize your work. Create new tabs with <Kbd k="Cmd:t"/>.
93-
- **Blocks**: The building blocks of Wave. Each block can be a terminal, web browser, file preview, AI chat, or other widget.
93+
- **Blocks**: The building blocks of Wave. Each block can be a terminal, web browser, file preview, or other widget.
9494
- **Layout**: Blocks can be dragged, dropped, and resized to create your ideal layout.
9595

9696
### Key Features
@@ -152,7 +152,7 @@ You can also download installers directly from our [Downloads page](https://www.
152152
- Explore [Key Bindings](./keybindings) to work more efficiently
153153
- Learn about [Tab Layouts](./layout) to organize your workspace
154154
- Set up [Custom Widgets](./customwidgets) for quick access to your tools
155-
- Configure [AI Presets](./ai-presets) to use your preferred AI models
155+
- Configure [Wave AI](./waveai) to use your preferred AI models
156156
- Check out [Configuration](./config) for detailed customization options
157157

158158
## Getting Help

docs/docs/index.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Check out [Getting Started](./gettingstarted) for installation instructions.
1919
![Wave Screenshot](./img/wave-screenshot.webp)
2020

2121
<CardGroup>
22+
<Card
23+
href="./waveai"
24+
icon="fa-sparkles"
25+
title="Wave AI"
26+
description="Context-aware terminal assistant with access to terminal output, widgets, and filesystem."
27+
/>
2228
<Card
2329
href="./customization"
2430
icon="fa-paintbrush"
@@ -80,8 +86,6 @@ Other References:
8086

8187
## Roadmap
8288

83-
Wave is constantly improving! Our roadmap will be continuously updated with our goals for each release. You can find it [here](https://github.com/wavetermdev/waveterm/blob/main/ROADMAP.md).
84-
8589
Want to provide input to our future releases? Connect with us on [Discord](https://discord.gg/XfvZ334gwU) or open a [Feature Request](https://github.com/wavetermdev/waveterm/issues/new/choose)!
8690

8791
## Links

docs/docs/keybindings.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ Chords are shown with a + between the keys. You have 2 seconds to hit the 2nd ch
8181

8282
## WaveAI Keybindings
8383

84-
| Key | Function |
85-
| ---------------- | ------------- |
86-
| <Kbd k="Cmd:l"/> | Clear AI Chat |
84+
| Key | Function |
85+
| ----------------------- | ----------------------- |
86+
| <Kbd k="Cmd:Shift:a"/> | Toggle WaveAI panel |
87+
| <Kbd k="Ctrl:Shift:0"/> | Focus WaveAI input |
88+
| <Kbd k="Cmd:k"/> | Clear AI Chat |
8789

8890
## Terminal Keybindings
8991

docs/docs/presets.mdx

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ title: "Presets"
66

77
# Presets
88

9-
Wave's preset system allows you to save and apply multiple configuration settings at once. Presets can be used in two different scenarios:
9+
Wave's preset system allows you to save and apply multiple configuration settings at once. Presets are used for:
1010

11-
- AI models: Configure different AI providers and models (see [AI Presets](/ai-presets))
1211
- Tab backgrounds: Apply visual styles to your tabs
1312

1413
## Managing Presets
@@ -18,14 +17,14 @@ You can store presets in two locations:
1817
- `~/.config/waveterm/presets.json`: Main presets file
1918
- `~/.config/waveterm/presets/`: Directory for organizing presets into separate files
2019

21-
All presets are aggregated regardless of which file they're in, so you can use the `presets` directory to organize them (e.g., `presets/bg.json`, `presets/ai.json`).
20+
All presets are aggregated regardless of which file they're in, so you can use the `presets` directory to organize them (e.g., `presets/bg.json`).
2221

2322
:::info
2423
You can easily edit your presets using the built-in editor:
2524

2625
```bash
2726
wsh editconfig presets.json # Edit main presets file
28-
wsh editconfig presets/ai.json # Edit AI presets
27+
wsh editconfig presets/bg.json # Edit background presets
2928
```
3029

3130
:::
@@ -47,7 +46,6 @@ Presets follow this format:
4746

4847
The `preset-type` determines where the preset appears in Wave's interface:
4948

50-
- `ai`: Appears in the models dropdown in the "Wave AI" widget header (see [AI Presets](/ai-presets))
5149
- `bg`: Appears in the "Backgrounds" submenu when right-clicking a tab
5250

5351
### Common Keys
@@ -58,19 +56,9 @@ The `preset-type` determines where the preset appears in Wave's interface:
5856
| display:order | float | Controls the order in the menu (optional) |
5957

6058
:::info
61-
When a preset is applied, it overrides the default configuration values for that tab or block. Using `bg:*` or `ai:*` will clear any previously overridden values, setting them back to defaults. It's recommended to include these keys in your presets to ensure a clean slate.
59+
When a preset is applied, it overrides the default configuration values for that tab or block. Using `bg:*` will clear any previously overridden values, setting them back to defaults. It's recommended to include this key in your presets to ensure a clean slate.
6260
:::
6361

64-
## AI Presets
65-
66-
For configuring AI providers and models, see our dedicated [AI Presets](/ai-presets) documentation. It covers setting up presets for:
67-
68-
- Local LLMs via Ollama
69-
- Azure OpenAI
70-
- Anthropic's Claude
71-
- Perplexity
72-
- And more
73-
7462
## Background Presets
7563

7664
Wave's background system harnesses the full power of CSS backgrounds, letting you create rich visual effects through the "background" attribute. You can apply solid colors, gradients (both linear and radial), images, and even blend multiple elements together.

frontend/app/aipanel/aimessage.tsx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Copyright 2025, Command Line Inc.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import { BlockModel } from "@/app/block/block-model";
45
import { WaveStreamdown } from "@/app/element/streamdown";
56
import { RpcApi } from "@/app/store/wshclientapi";
67
import { TabRpcClient } from "@/app/store/wshrpcutil";
78
import { cn } from "@/util/util";
8-
import { memo, useEffect, useState } from "react";
9+
import { memo, useEffect, useRef, useState } from "react";
910
import { getFileIcon } from "./ai-utils";
1011
import { WaveUIMessage, WaveUIMessagePart } from "./aitypes";
1112
import { WaveAIModel } from "./waveai-model";
@@ -201,6 +202,8 @@ interface AIToolUseProps {
201202
const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
202203
const toolData = part.data;
203204
const [userApprovalOverride, setUserApprovalOverride] = useState<string | null>(null);
205+
const highlightTimeoutRef = useRef<NodeJS.Timeout | null>(null);
206+
const highlightedBlockIdRef = useRef<string | null>(null);
204207

205208
const statusIcon = toolData.status === "completed" ? "✓" : toolData.status === "error" ? "✗" : "•";
206209
const statusColor =
@@ -222,6 +225,14 @@ const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
222225
return () => clearInterval(interval);
223226
}, [isStreaming, effectiveApproval, toolData.toolcallid]);
224227

228+
useEffect(() => {
229+
return () => {
230+
if (highlightTimeoutRef.current) {
231+
clearTimeout(highlightTimeoutRef.current);
232+
}
233+
};
234+
}, []);
235+
225236
const handleApprove = () => {
226237
setUserApprovalOverride("user-approved");
227238
RpcApi.WaveAIToolApproveCommand(TabRpcClient, {
@@ -238,8 +249,47 @@ const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
238249
});
239250
};
240251

252+
const handleMouseEnter = () => {
253+
if (!toolData.blockid) return;
254+
255+
if (highlightTimeoutRef.current) {
256+
clearTimeout(highlightTimeoutRef.current);
257+
}
258+
259+
highlightedBlockIdRef.current = toolData.blockid;
260+
BlockModel.getInstance().setBlockHighlight({
261+
blockId: toolData.blockid,
262+
icon: "sparkles",
263+
});
264+
265+
highlightTimeoutRef.current = setTimeout(() => {
266+
if (highlightedBlockIdRef.current === toolData.blockid) {
267+
BlockModel.getInstance().setBlockHighlight(null);
268+
highlightedBlockIdRef.current = null;
269+
}
270+
}, 2000);
271+
};
272+
273+
const handleMouseLeave = () => {
274+
if (!toolData.blockid) return;
275+
276+
if (highlightTimeoutRef.current) {
277+
clearTimeout(highlightTimeoutRef.current);
278+
highlightTimeoutRef.current = null;
279+
}
280+
281+
if (highlightedBlockIdRef.current === toolData.blockid) {
282+
BlockModel.getInstance().setBlockHighlight(null);
283+
highlightedBlockIdRef.current = null;
284+
}
285+
};
286+
241287
return (
242-
<div className={cn("flex items-start gap-2 p-2 rounded bg-gray-800 border border-gray-700", statusColor)}>
288+
<div
289+
className={cn("flex items-start gap-2 p-2 rounded bg-gray-800 border border-gray-700", statusColor)}
290+
onMouseEnter={handleMouseEnter}
291+
onMouseLeave={handleMouseLeave}
292+
>
243293
<span className="font-bold">{statusIcon}</span>
244294
<div className="flex-1">
245295
<div className="font-semibold">{toolData.toolname}</div>

frontend/app/aipanel/aitypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type WaveUIDataTypes = {
1717
status: "pending" | "error" | "completed";
1818
errormessage?: string;
1919
approval?: "needs-approval" | "user-approved" | "user-denied" | "auto-approved" | "timeout";
20+
blockid?: string;
2021
};
2122
};
2223

frontend/app/block/block-model.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2025, Command Line Inc.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { globalStore } from "@/app/store/jotaiStore";
5+
import * as jotai from "jotai";
6+
7+
export interface BlockHighlightType {
8+
blockId: string;
9+
icon: string;
10+
}
11+
12+
export class BlockModel {
13+
private static instance: BlockModel | null = null;
14+
private blockHighlightAtomCache = new Map<string, jotai.Atom<BlockHighlightType | null>>();
15+
16+
blockHighlightAtom: jotai.PrimitiveAtom<BlockHighlightType> = jotai.atom(null) as jotai.PrimitiveAtom<BlockHighlightType>;
17+
18+
private constructor() {
19+
// Empty for now
20+
}
21+
22+
getBlockHighlightAtom(blockId: string): jotai.Atom<BlockHighlightType | null> {
23+
let atom = this.blockHighlightAtomCache.get(blockId);
24+
if (!atom) {
25+
atom = jotai.atom((get) => {
26+
const highlight = get(this.blockHighlightAtom);
27+
if (highlight?.blockId === blockId) {
28+
return highlight;
29+
}
30+
return null;
31+
});
32+
this.blockHighlightAtomCache.set(blockId, atom);
33+
}
34+
return atom;
35+
}
36+
37+
setBlockHighlight(highlight: BlockHighlightType | null) {
38+
globalStore.set(this.blockHighlightAtom, highlight);
39+
}
40+
41+
static getInstance(): BlockModel {
42+
if (!BlockModel.instance) {
43+
BlockModel.instance = new BlockModel();
44+
}
45+
return BlockModel.instance;
46+
}
47+
48+
static resetInstance(): void {
49+
BlockModel.instance = null;
50+
}
51+
}

0 commit comments

Comments
 (0)