fix(app): browser pane keyboard tweaks
- Refresh icon: use single-arrow RotateCw instead of two-arrow RefreshCw - URL bar selects all text on focus - Cmd+R now reloads the active browser pane (tracked via IPC) when the URL bar has focus, instead of reloading the Electron window - Forward Paseo shortcut keys (b, e, w, t, k, /, \, comma, digits, enter, arrows) from the embedded webview to the main window so sidebar/tab/etc. shortcuts still fire when focus is inside the loaded page
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { app, Menu, BrowserWindow, ipcMain, webContents } from "electron";
|
||||
import { getPaseoBrowserIdForWebContents } from "./browser-webviews.js";
|
||||
import {
|
||||
getActivePaseoBrowserWebContents,
|
||||
getPaseoBrowserIdForWebContents,
|
||||
} from "./browser-webviews.js";
|
||||
|
||||
interface ShowContextMenuInput {
|
||||
kind?: "terminal";
|
||||
@@ -20,8 +23,12 @@ function getFocusedPaseoBrowserWebContents(): Electron.WebContents | null {
|
||||
return getPaseoBrowserIdForWebContents(focusedContents) ? focusedContents : null;
|
||||
}
|
||||
|
||||
function getReloadTargetBrowserWebContents(): Electron.WebContents | null {
|
||||
return getFocusedPaseoBrowserWebContents() ?? getActivePaseoBrowserWebContents();
|
||||
}
|
||||
|
||||
function reloadFocusedContentsOrWindow(win: BrowserWindow, options?: { ignoreCache?: boolean }) {
|
||||
const browserContents = getFocusedPaseoBrowserWebContents();
|
||||
const browserContents = getReloadTargetBrowserWebContents();
|
||||
if (browserContents) {
|
||||
if (options?.ignoreCache) {
|
||||
browserContents.reloadIgnoringCache();
|
||||
|
||||
Reference in New Issue
Block a user