Skip to content

Commit 4702cdd

Browse files
chore: generate
1 parent 82c5d45 commit 4702cdd

3 files changed

Lines changed: 37 additions & 17 deletions

File tree

packages/app/src/components/windows-app-menu.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { useCommand } from "@/context/command"
77
import { DESKTOP_MENU, desktopMenuVisible, type DesktopMenuAction, type DesktopMenuEntry } from "@/desktop-menu"
88
import { usePlatform } from "@/context/platform"
99

10-
export function WindowsAppMenu(props: { command: ReturnType<typeof useCommand>; platform: ReturnType<typeof usePlatform> }) {
10+
export function WindowsAppMenu(props: {
11+
command: ReturnType<typeof useCommand>
12+
platform: ReturnType<typeof usePlatform>
13+
}) {
1114
let lastFocused: HTMLElement | undefined
1215

1316
const rememberFocus = () => {
@@ -57,18 +60,20 @@ export function WindowsAppMenu(props: { command: ReturnType<typeof useCommand>;
5760
<DropdownMenu.GroupLabel class="desktop-app-menu-heading">OpenCode</DropdownMenu.GroupLabel>
5861
{DESKTOP_MENU.filter((menu) => desktopMenuVisible(menu, "windows")).map((menu) => (
5962
<DesktopMenuSubmenu label={menu.label}>
60-
{menu.items?.filter((entry) => desktopMenuVisible(entry, "windows")).map((entry) =>
61-
entry.type === "separator" ? (
62-
<DropdownMenu.Separator />
63-
) : (
64-
<DesktopMenuItem
65-
label={entry.label ?? ""}
66-
keybind={entry.command ? props.command.keybind(entry.command) : entry.accelerator?.windows}
67-
disabled={entry.command ? commandDisabled(entry.command) : false}
68-
onSelect={() => runEntry(entry)}
69-
/>
70-
),
71-
)}
63+
{menu.items
64+
?.filter((entry) => desktopMenuVisible(entry, "windows"))
65+
.map((entry) =>
66+
entry.type === "separator" ? (
67+
<DropdownMenu.Separator />
68+
) : (
69+
<DesktopMenuItem
70+
label={entry.label ?? ""}
71+
keybind={entry.command ? props.command.keybind(entry.command) : entry.accelerator?.windows}
72+
disabled={entry.command ? commandDisabled(entry.command) : false}
73+
onSelect={() => runEntry(entry)}
74+
/>
75+
),
76+
)}
7277
</DesktopMenuSubmenu>
7378
))}
7479
</DropdownMenu.Group>

packages/app/src/desktop-menu.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,16 @@ export const DESKTOP_MENU: DesktopMenu[] = [
202202
{ type: "item", label: "OpenCode Documentation", href: "https://opencode.ai/docs" },
203203
{ type: "item", label: "Support Forum", href: "https://discord.com/invite/opencode" },
204204
{ type: "separator" },
205-
{ type: "item", label: "Share Feedback", href: "https://github.com/anomalyco/opencode/issues/new?template=feature_request.yml" },
206-
{ type: "item", label: "Report a Bug", href: "https://github.com/anomalyco/opencode/issues/new?template=bug_report.yml" },
205+
{
206+
type: "item",
207+
label: "Share Feedback",
208+
href: "https://github.com/anomalyco/opencode/issues/new?template=feature_request.yml",
209+
},
210+
{
211+
type: "item",
212+
label: "Report a Bug",
213+
href: "https://github.com/anomalyco/opencode/issues/new?template=bug_report.yml",
214+
},
207215
],
208216
},
209217
]

packages/desktop/src/main/menu.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { BrowserWindow, Menu, shell } from "electron"
22
import type { MenuItemConstructorOptions } from "electron"
3-
import { DESKTOP_MENU, desktopMenuVisible, type DesktopMenuEntry, type DesktopMenuRole } from "@opencode-ai/app/desktop-menu"
3+
import {
4+
DESKTOP_MENU,
5+
desktopMenuVisible,
6+
type DesktopMenuEntry,
7+
type DesktopMenuRole,
8+
} from "@opencode-ai/app/desktop-menu"
49

510
import { UPDATER_ENABLED } from "./constants"
611
import { runDesktopMenuAction } from "./desktop-menu-actions"
@@ -18,7 +23,9 @@ export function createMenu(deps: Deps) {
1823
if (menu.role) return { role: nativeRole(menu.role) }
1924
return {
2025
label: menu.label,
21-
submenu: menu.items?.filter((entry) => desktopMenuVisible(entry, "macos")).map((entry) => nativeItem(entry, deps)),
26+
submenu: menu.items
27+
?.filter((entry) => desktopMenuVisible(entry, "macos"))
28+
.map((entry) => nativeItem(entry, deps)),
2229
}
2330
})
2431

0 commit comments

Comments
 (0)