fix(app): restore new layout shortcuts (#33929)

This commit is contained in:
Brendan Allan 2026-06-25 23:22:12 +08:00 committed by GitHub
parent 9ad7067971
commit 5565a8ee10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -3,12 +3,18 @@ import { useNavigate, useParams } from "@solidjs/router"
import { DebugBar } from "@/components/debug-bar"
import { HelpButton } from "@/components/help-button"
import { Titlebar, type TitlebarUpdate } from "@/components/titlebar"
import { useCommand } from "@/context/command"
import { useDialog } from "@opencode-ai/ui/context/dialog"
import { useLanguage } from "@/context/language"
import { useNotification } from "@/context/notification"
import { usePlatform } from "@/context/platform"
import { setNavigate } from "@/utils/notification-click"
import { setV2Toast, ToastRegion } from "@/utils/toast"
export default function NewLayout(props: ParentProps) {
const command = useCommand()
const dialog = useDialog()
const language = useLanguage()
const platform = usePlatform()
const notification = useNotification()
const navigate = useNavigate()
@ -22,6 +28,20 @@ export default function NewLayout(props: ParentProps) {
notification.session.markViewed(params.id)
})
command.register("layout", () => [
{
id: "settings.open",
title: language.t("command.settings.open"),
category: language.t("command.category.settings"),
keybind: "mod+comma",
onSelect: () => {
void import("@/components/settings-v2").then((x) => {
dialog.show(() => <x.DialogSettings />)
})
},
},
])
const update: TitlebarUpdate = {
version: () => {
const state = platform.updater?.state()

View file

@ -26,7 +26,7 @@ export default function NewSessionPage() {
const serverSync = useServerSync()
const comments = useComments()
const route = useSessionKey()
const [searchParams, setSearchParams] = useSearchParams<{ prompt?: string }>()
const [searchParams, setSearchParams] = useSearchParams<{ draftId?: string; prompt?: string }>()
let inputRef: HTMLDivElement | undefined