Skip to content

Commit 106a20e

Browse files
committed
add deprecation message to old wave ai proxy
1 parent a07e078 commit 106a20e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

frontend/app/view/waveai/waveai.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { RpcResponseHelper, WshClient } from "@/app/store/wshclient";
1111
import { RpcApi } from "@/app/store/wshclientapi";
1212
import { makeFeBlockRouteId } from "@/app/store/wshrouter";
1313
import { DefaultRouter, TabRpcClient } from "@/app/store/wshrpcutil";
14+
import { WorkspaceLayoutModel } from "@/app/workspace/workspace-layout-model";
1415
import { atoms, createBlock, fetchWaveFile, getApi, globalStore, WOS } from "@/store/global";
1516
import { BlockService, ObjectService } from "@/store/services";
1617
import { adaptFromReactOrNativeKeyEvent, checkKeyPressed } from "@/util/keyutil";
@@ -705,6 +706,8 @@ const WaveAi = ({ model }: { model: WaveAiModel; blockId: string }) => {
705706
const baseFontSize: number = 14;
706707
const msgWidths = {};
707708
const locked = useAtomValue(model.locked);
709+
const aiOpts = useAtomValue(model.aiOpts);
710+
const isUsingProxy = isBlank(aiOpts.apitoken) && isBlank(aiOpts.baseurl);
708711

709712
// a weird workaround to initialize ansynchronously
710713
useEffect(() => {
@@ -861,8 +864,27 @@ const WaveAi = ({ model }: { model: WaveAiModel; blockId: string }) => {
861864
}
862865
}, [locked, handleEnterKeyPressed]);
863866

867+
const handleOpenAIPanel = useCallback(() => {
868+
WorkspaceLayoutModel.getInstance().setAIPanelVisible(true);
869+
}, []);
870+
864871
return (
865872
<div ref={waveaiRef} className="waveai">
873+
{isUsingProxy && (
874+
<div className="flex items-start gap-3 px-4 py-2 bg-orange-500/25 border-b border-orange-500/50 text-sm">
875+
<i className="fa-sharp fa-solid fa-triangle-exclamation text-orange-300 mt-0.5"></i>
876+
<span className="text-primary/90">
877+
Wave AI Proxy is deprecated and will be removed. Please use the new{" "}
878+
<button
879+
onClick={handleOpenAIPanel}
880+
className="text-accent hover:text-accent/80 underline cursor-pointer"
881+
>
882+
Wave AI panel
883+
</button>{" "}
884+
instead (better model, terminal integration, tool support, image uploads).
885+
</span>
886+
</div>
887+
)}
866888
<div className="waveai-chat">
867889
<ChatWindow ref={osRef} chatWindowRef={chatWindowRef} msgWidths={msgWidths} model={model} />
868890
</div>

0 commit comments

Comments
 (0)