Hide browser shortcuts outside the desktop app (#2116)

* fix: hide browser pin on non-Electron web

Browser is desktop-only, but the pinned shortcut bar still rendered a
New browser pin on web where createBrowser is a silent no-op.

Skip browser pins in usePinnedLaunchers when not Electron, and drop
browser from default pinned targets so new users only get terminal.

* fix(app): preserve browser pin defaults on desktop

Keep platform availability in the pinned-target policy so regular web hides browser shortcuts without changing Electron defaults.

---------

Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
Jason@HND
2026-07-16 12:36:20 +00:00
committed by GitHub
co-authored by Mohamed Boudra
parent 47532952f3
commit 3e8dce7d7c
3 changed files with 41 additions and 2 deletions
+9 -1
View File
@@ -7,9 +7,14 @@ import {
resolveTerminalProfiles,
} from "@getpaseo/protocol/terminal-profiles";
import { getProviderIcon } from "@/components/provider-icons";
import { getIsElectron } from "@/constants/platform";
import { useDaemonConfig } from "@/hooks/use-daemon-config";
import type { Theme } from "@/styles/theme";
import { pinnedTargetKey, type PinnedTabTarget } from "@/workspace-pins/target";
import {
isPinnedTargetAvailable,
pinnedTargetKey,
type PinnedTabTarget,
} from "@/workspace-pins/target";
import { usePinnedTargetsStore } from "@/workspace-pins/store";
export interface ResolvedPin {
@@ -64,6 +69,9 @@ export function usePinnedLaunchers({ serverId, onLaunch }: UsePinnedLaunchersInp
return useMemo(() => {
const resolved: ResolvedPin[] = [];
for (const target of pinned) {
if (!isPinnedTargetAvailable(target, { isElectron: getIsElectron() })) {
continue;
}
if (target.kind === "draft") {
resolved.push({
key: pinnedTargetKey(target),