feat(app): add tooltips to sidebar new session/workspace buttons (#9652)
This commit is contained in:
@@ -34,7 +34,7 @@ export function DialogSelectFile() {
|
|||||||
const view = createMemo(() => layout.view(sessionKey()))
|
const view = createMemo(() => layout.view(sessionKey()))
|
||||||
const state = { cleanup: undefined as (() => void) | void, committed: false }
|
const state = { cleanup: undefined as (() => void) | void, committed: false }
|
||||||
const [grouped, setGrouped] = createSignal(false)
|
const [grouped, setGrouped] = createSignal(false)
|
||||||
const common = ["session.new", "session.previous", "session.next", "terminal.toggle", "review.toggle"]
|
const common = ["session.new", "workspace.new", "session.previous", "session.next", "terminal.toggle", "review.toggle"]
|
||||||
const limit = 5
|
const limit = 5
|
||||||
|
|
||||||
const allowed = createMemo(() =>
|
const allowed = createMemo(() =>
|
||||||
|
|||||||
@@ -1998,6 +1998,17 @@ export default function Layout(props: ParentProps) {
|
|||||||
navigate(`/${base64Encode(created.directory)}/session`)
|
navigate(`/${base64Encode(created.directory)}/session`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
command.register(() => [
|
||||||
|
{
|
||||||
|
id: "workspace.new",
|
||||||
|
title: "New workspace",
|
||||||
|
category: "Workspace",
|
||||||
|
keybind: "mod+shift+w",
|
||||||
|
disabled: !layout.sidebar.workspaces(project()?.worktree ?? "")(),
|
||||||
|
onSelect: createWorkspace,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
const homedir = createMemo(() => sync.data.path.home)
|
const homedir = createMemo(() => sync.data.path.home)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -2123,17 +2134,19 @@ export default function Layout(props: ParentProps) {
|
|||||||
fallback={
|
fallback={
|
||||||
<>
|
<>
|
||||||
<div class="py-4 px-3">
|
<div class="py-4 px-3">
|
||||||
<Button
|
<TooltipKeybind title="New session" keybind={command.keybind("session.new")} placement="top">
|
||||||
size="large"
|
<Button
|
||||||
icon="plus-small"
|
size="large"
|
||||||
class="w-full"
|
icon="plus-small"
|
||||||
onClick={() => {
|
class="w-full"
|
||||||
navigate(`/${base64Encode(p.worktree)}/session`)
|
onClick={() => {
|
||||||
layout.mobileSidebar.hide()
|
navigate(`/${base64Encode(p.worktree)}/session`)
|
||||||
}}
|
layout.mobileSidebar.hide()
|
||||||
>
|
}}
|
||||||
New session
|
>
|
||||||
</Button>
|
New session
|
||||||
|
</Button>
|
||||||
|
</TooltipKeybind>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 min-h-0">
|
<div class="flex-1 min-h-0">
|
||||||
<LocalWorkspace project={p} mobile={sidebarProps.mobile} />
|
<LocalWorkspace project={p} mobile={sidebarProps.mobile} />
|
||||||
@@ -2143,9 +2156,11 @@ export default function Layout(props: ParentProps) {
|
|||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<div class="py-4 px-3">
|
<div class="py-4 px-3">
|
||||||
<Button size="large" icon="plus-small" class="w-full" onClick={createWorkspace}>
|
<TooltipKeybind title="New workspace" keybind={command.keybind("workspace.new")} placement="top">
|
||||||
New workspace
|
<Button size="large" icon="plus-small" class="w-full" onClick={createWorkspace}>
|
||||||
</Button>
|
New workspace
|
||||||
|
</Button>
|
||||||
|
</TooltipKeybind>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative flex-1 min-h-0">
|
<div class="relative flex-1 min-h-0">
|
||||||
<DragDropProvider
|
<DragDropProvider
|
||||||
|
|||||||
Reference in New Issue
Block a user