mirror of
https://github.com/wavetermdev/waveterm
synced 2026-04-21 14:37:16 +00:00
fix: Mouse Back/Forward support in webviews + few bugfixes (#3141)
- Add Mouse-3/Mouse-4 (back/forward) navigation support in webviews - Add COLORTERM=truecolor env variable for terminal sessions - Fix AI button width calculation when button is hidden - Fix setSizeAndPosition animation on tab layout updates - Increase DevInitTimeout for slower startup scenarios - Update .gitignore and package-lock.json --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c99bd4888a
commit
984b4e5eb1
5 changed files with 28 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -39,3 +39,6 @@ test-results.xml
|
|||
docsite/
|
||||
|
||||
.kilo-format-temp-*
|
||||
.superpowers
|
||||
docs/superpowers
|
||||
.claude
|
||||
|
|
|
|||
|
|
@ -236,6 +236,14 @@ export function initIpcHandlers() {
|
|||
menu.popup();
|
||||
});
|
||||
|
||||
electron.ipcMain.on("webview-mouse-navigate", (event: electron.IpcMainEvent, direction: string) => {
|
||||
if (direction === "back") {
|
||||
event.sender.navigationHistory.goBack();
|
||||
} else if (direction === "forward") {
|
||||
event.sender.navigationHistory.goForward();
|
||||
}
|
||||
});
|
||||
|
||||
electron.ipcMain.on("download", (event, payload) => {
|
||||
const baseName = encodeURIComponent(path.basename(payload.filePath));
|
||||
const streamingUrl =
|
||||
|
|
|
|||
|
|
@ -25,4 +25,15 @@ document.addEventListener("contextmenu", (event) => {
|
|||
// do nothing
|
||||
});
|
||||
|
||||
document.addEventListener("mouseup", (event) => {
|
||||
// Mouse button 3 = back, button 4 = forward
|
||||
if (!event.isTrusted) {
|
||||
return;
|
||||
}
|
||||
if (event.button === 3 || event.button === 4) {
|
||||
event.preventDefault();
|
||||
ipcRenderer.send("webview-mouse-navigate", event.button === 3 ? "back" : "forward");
|
||||
}
|
||||
});
|
||||
|
||||
console.log("loaded wave preload-webview.ts");
|
||||
|
|
|
|||
|
|
@ -189,7 +189,8 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
|
|||
const addBtnWidth = getOuterWidth(addBtnRef.current);
|
||||
const appMenuButtonWidth = appMenuButtonRef.current?.getBoundingClientRect().width ?? 0;
|
||||
const workspaceSwitcherWidth = workspaceSwitcherRef.current?.getBoundingClientRect().width ?? 0;
|
||||
const waveAIButtonWidth = waveAIButtonRef.current != null ? getOuterWidth(waveAIButtonRef.current) : 0;
|
||||
const waveAIButtonWidth =
|
||||
!hideAiButton && waveAIButtonRef.current != null ? getOuterWidth(waveAIButtonRef.current) : 0;
|
||||
|
||||
const nonTabElementsWidth =
|
||||
windowDragLeftWidth +
|
||||
|
|
@ -276,7 +277,7 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
|
|||
// Check if all tabs are loaded
|
||||
const allLoaded = tabIds.length > 0 && tabIds.every((id) => tabsLoaded[id]);
|
||||
if (allLoaded) {
|
||||
setSizeAndPosition(newTabId === null && prevAllLoadedRef.current);
|
||||
setSizeAndPosition(false);
|
||||
saveTabsPosition();
|
||||
if (!prevAllLoadedRef.current) {
|
||||
prevAllLoadedRef.current = true;
|
||||
|
|
|
|||
|
|
@ -222,6 +222,9 @@ func WaveshellLocalEnvVars(termType string) map[string]string {
|
|||
}
|
||||
// these are not necessary since they should be set with the swap token, but no harm in setting them here
|
||||
rtn["TERM_PROGRAM"] = "waveterm"
|
||||
if os.Getenv("COLORTERM") == "" {
|
||||
rtn["COLORTERM"] = "truecolor"
|
||||
}
|
||||
rtn["WAVETERM"], _ = os.Executable()
|
||||
rtn["WAVETERM_VERSION"] = wavebase.WaveVersion
|
||||
rtn["WAVETERM_WSHBINDIR"] = filepath.Join(wavebase.GetWaveDataDir(), WaveHomeBinDir)
|
||||
|
|
|
|||
Loading…
Reference in a new issue