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 { DebugBar } from "@/components/debug-bar"
|
||||||
import { HelpButton } from "@/components/help-button"
|
import { HelpButton } from "@/components/help-button"
|
||||||
import { Titlebar, type TitlebarUpdate } from "@/components/titlebar"
|
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 { useNotification } from "@/context/notification"
|
||||||
import { usePlatform } from "@/context/platform"
|
import { usePlatform } from "@/context/platform"
|
||||||
import { setNavigate } from "@/utils/notification-click"
|
import { setNavigate } from "@/utils/notification-click"
|
||||||
import { setV2Toast, ToastRegion } from "@/utils/toast"
|
import { setV2Toast, ToastRegion } from "@/utils/toast"
|
||||||
|
|
||||||
export default function NewLayout(props: ParentProps) {
|
export default function NewLayout(props: ParentProps) {
|
||||||
|
const command = useCommand()
|
||||||
|
const dialog = useDialog()
|
||||||
|
const language = useLanguage()
|
||||||
const platform = usePlatform()
|
const platform = usePlatform()
|
||||||
const notification = useNotification()
|
const notification = useNotification()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
@ -22,6 +28,20 @@ export default function NewLayout(props: ParentProps) {
|
||||||
notification.session.markViewed(params.id)
|
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 = {
|
const update: TitlebarUpdate = {
|
||||||
version: () => {
|
version: () => {
|
||||||
const state = platform.updater?.state()
|
const state = platform.updater?.state()
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export default function NewSessionPage() {
|
||||||
const serverSync = useServerSync()
|
const serverSync = useServerSync()
|
||||||
const comments = useComments()
|
const comments = useComments()
|
||||||
const route = useSessionKey()
|
const route = useSessionKey()
|
||||||
const [searchParams, setSearchParams] = useSearchParams<{ prompt?: string }>()
|
const [searchParams, setSearchParams] = useSearchParams<{ draftId?: string; prompt?: string }>()
|
||||||
|
|
||||||
let inputRef: HTMLDivElement | undefined
|
let inputRef: HTMLDivElement | undefined
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue