mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-11 16:48:29 +00:00
fix(app): restore new layout shortcuts (#33929)
This commit is contained in:
parent
9ad7067971
commit
5565a8ee10
2 changed files with 21 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue