Skip to content

Commit b490113

Browse files
authored
change cursorAccent to cursor to match xtermjs. (#968)
also add more feedback for waveai -- tooltips + icon for local/cloud. also use 'ai:name' correctly
1 parent 1bd2fe8 commit b490113

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

frontend/app/view/waveai/waveai.tsx

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,47 @@ export class WaveAiModel implements ViewModel {
110110
set(this.updateLastMessageAtom, "", false);
111111
});
112112
this.viewText = atom((get) => {
113+
const viewTextChildren: HeaderElem[] = [];
113114
const settings = get(atoms.settingsAtom);
114115
const isCloud = isBlank(settings?.["ai:apitoken"]) && isBlank(settings?.["ai:baseurl"]);
115116
let modelText = "gpt-4o-mini";
116117
if (!isCloud && !isBlank(settings?.["ai:model"])) {
117-
modelText = settings["ai:model"];
118+
if (!isBlank(settings?.["ai:name"])) {
119+
modelText = settings["ai:name"];
120+
} else {
121+
modelText = settings["ai:model"];
122+
}
118123
}
119-
const viewTextChildren: HeaderElem[] = [
120-
{
121-
elemtype: "text",
122-
text: modelText,
123-
},
124-
];
124+
if (isCloud) {
125+
viewTextChildren.push({
126+
elemtype: "iconbutton",
127+
icon: "cloud",
128+
title: "Using Wave's AI Proxy (gpt-4o-mini)",
129+
disabled: true,
130+
});
131+
} else {
132+
const baseUrl = settings["ai:baseurl"] ?? "OpenAI Default Endpoint";
133+
const modelName = settings["ai:model"];
134+
if (baseUrl.startsWith("http://localhost") || baseUrl.startsWith("http://127.0.0.1")) {
135+
viewTextChildren.push({
136+
elemtype: "iconbutton",
137+
icon: "location-dot",
138+
title: "Using Local Model @ " + baseUrl + " (" + modelName + ")",
139+
disabled: true,
140+
});
141+
} else {
142+
viewTextChildren.push({
143+
elemtype: "iconbutton",
144+
icon: "globe",
145+
title: "Using Remote Model @ " + baseUrl + " (" + modelName + ")",
146+
disabled: true,
147+
});
148+
}
149+
}
150+
viewTextChildren.push({
151+
elemtype: "text",
152+
text: modelText,
153+
});
125154
return viewTextChildren;
126155
});
127156
}

frontend/types/gotypes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ declare global {
515515
foreground: string;
516516
selectionBackground: string;
517517
background: string;
518-
cursorAccent: string;
518+
cursor: string;
519519
};
520520

521521
// wshrpc.TimeSeriesData

pkg/wconfig/defaultconfig/termthemes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"foreground": "#c1c1c1",
2424
"selectionBackground": "",
2525
"background": "#00000077",
26-
"cursorAccent": ""
26+
"cursor": ""
2727
},
2828
"dracula": {
2929
"display:name": "Dracula",
@@ -49,7 +49,7 @@
4949
"foreground": "#F8F8F2",
5050
"selectionBackground": "#44475a",
5151
"background": "#282a36",
52-
"cursorAccent": "#f8f8f2"
52+
"cursor": "#f8f8f2"
5353
},
5454
"monokai": {
5555
"display:name": "Monokai",
@@ -75,7 +75,7 @@
7575
"foreground": "#F8F8F2",
7676
"selectionBackground": "#49483E",
7777
"background": "#272822",
78-
"cursorAccent": "#F8F8F2"
78+
"cursor": "#F8F8F2"
7979
},
8080
"campbell": {
8181
"display:name": "Campbell",
@@ -101,6 +101,6 @@
101101
"foreground": "#CCCCCC",
102102
"selectionBackground": "#3A96DD",
103103
"background": "#0C0C0C",
104-
"cursorAccent": "#CCCCCC"
104+
"cursor": "#CCCCCC"
105105
}
106106
}

pkg/wconfig/settingsconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,5 +392,5 @@ type TermThemeType struct {
392392
Foreground string `json:"foreground"`
393393
SelectionBackground string `json:"selectionBackground"`
394394
Background string `json:"background"`
395-
CursorAccent string `json:"cursorAccent"`
395+
Cursor string `json:"cursor"`
396396
}

0 commit comments

Comments
 (0)