ikanban-web 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ghostty-web-BOsxUEnx.js → ghostty-web-C-SSEmFU.js} +1 -1
- package/dist/assets/home-C_ni123d.js +1 -0
- package/dist/assets/{index-Z4u1EVXA.css → index-7dPULZd1.css} +1 -1
- package/dist/assets/{index-CE2ZqGRp.js → index-BhuJVelU.js} +104 -104
- package/dist/assets/session-beMq99rD.js +24 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/dialog-select-server.test.ts +16 -0
- package/src/components/dialog-select-server.tsx +59 -51
- package/src/components/server-list-item-frame.tsx +15 -0
- package/src/components/titlebar.tsx +0 -30
- package/src/context/global-sync/bootstrap-mode.ts +17 -0
- package/src/context/global-sync/bootstrap.ts +18 -10
- package/src/context/global-sync.test.ts +57 -0
- package/src/context/global-sync.tsx +5 -0
- package/src/i18n/en.ts +13 -13
- package/src/i18n/zh.ts +13 -13
- package/src/pages/home/helpers.test.ts +62 -0
- package/src/pages/home/helpers.ts +80 -0
- package/src/pages/home.tsx +17 -53
- package/src/pages/layout/sidebar-project.tsx +1 -3
- package/src/pages/layout/sidebar-shell-helpers.ts +1 -1
- package/src/pages/layout/sidebar-shell.test.ts +2 -2
- package/src/pages/layout.tsx +41 -132
- package/dist/assets/home-DmwjxlRp.js +0 -1
- package/dist/assets/session-FqpMK7PV.js +0 -24
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test"
|
|
2
|
+
import type { Session } from "@opencode-ai/sdk/v2/client"
|
|
3
|
+
import { buildBoardColumns, trackedProjectDirectories } from "./helpers"
|
|
4
|
+
|
|
5
|
+
const session = (input: Partial<Session> & Pick<Session, "id">) =>
|
|
6
|
+
({
|
|
7
|
+
title: input.id,
|
|
8
|
+
version: "v2",
|
|
9
|
+
messageCount: 0,
|
|
10
|
+
permissions: { session: {}, share: {} },
|
|
11
|
+
time: { created: 0, updated: 0, archived: undefined },
|
|
12
|
+
...input,
|
|
13
|
+
}) as Session
|
|
14
|
+
|
|
15
|
+
describe("trackedProjectDirectories", () => {
|
|
16
|
+
test("keeps only unique opened project directories", () => {
|
|
17
|
+
expect(
|
|
18
|
+
trackedProjectDirectories([
|
|
19
|
+
{ worktree: "/open" },
|
|
20
|
+
{ worktree: "/open" },
|
|
21
|
+
{ worktree: "/other" },
|
|
22
|
+
]),
|
|
23
|
+
).toEqual(["/open", "/other"])
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe("buildBoardColumns", () => {
|
|
28
|
+
test("shows sessions only for opened projects", () => {
|
|
29
|
+
const columns = buildBoardColumns({
|
|
30
|
+
projectDirectories: ["/open"],
|
|
31
|
+
sessionsByProject: {
|
|
32
|
+
"/open": [session({ id: "open-session", title: "Open session" })],
|
|
33
|
+
"/closed": [session({ id: "closed-session", title: "Closed session" })],
|
|
34
|
+
},
|
|
35
|
+
statusesByProject: {},
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
expect(columns.idle.map((card) => card.session.id)).toEqual(["open-session"])
|
|
39
|
+
expect(columns.progress).toEqual([])
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test("deduplicates the same session across projects and keeps progress state", () => {
|
|
43
|
+
const shared = session({ id: "session-1", title: "Shared", time: { created: 1, updated: 2, archived: undefined } })
|
|
44
|
+
|
|
45
|
+
const columns = buildBoardColumns({
|
|
46
|
+
projectDirectories: ["/open", "/other-open"],
|
|
47
|
+
sessionsByProject: {
|
|
48
|
+
"/open": [shared],
|
|
49
|
+
"/other-open": [shared],
|
|
50
|
+
},
|
|
51
|
+
statusesByProject: {
|
|
52
|
+
"/other-open": {
|
|
53
|
+
"session-1": { type: "busy" },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
expect(columns.progress).toHaveLength(1)
|
|
59
|
+
expect(columns.progress[0]?.session.id).toBe("session-1")
|
|
60
|
+
expect(columns.idle).toEqual([])
|
|
61
|
+
})
|
|
62
|
+
})
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Session } from "@opencode-ai/sdk/v2/client"
|
|
2
|
+
|
|
3
|
+
export type BoardColumn = "progress" | "idle"
|
|
4
|
+
|
|
5
|
+
export type BoardCard = {
|
|
6
|
+
session: Session
|
|
7
|
+
projectDirectory: string
|
|
8
|
+
updatedAt: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type OpenProject = { worktree: string }
|
|
12
|
+
|
|
13
|
+
type SessionStatus = {
|
|
14
|
+
type?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function trackedProjectDirectories(projects: OpenProject[]) {
|
|
18
|
+
return [...new Set(projects.map((project) => project.worktree).filter(Boolean))]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function buildBoardColumns(input: {
|
|
22
|
+
projectDirectories: string[]
|
|
23
|
+
sessionsByProject: Record<string, Session[]>
|
|
24
|
+
statusesByProject: Record<string, Record<string, SessionStatus | undefined>>
|
|
25
|
+
}) {
|
|
26
|
+
const cards = new Map<string, BoardCard & { column: BoardColumn }>()
|
|
27
|
+
|
|
28
|
+
for (const directory of input.projectDirectories) {
|
|
29
|
+
const sessions = input.sessionsByProject[directory] ?? []
|
|
30
|
+
const statuses = input.statusesByProject[directory] ?? {}
|
|
31
|
+
|
|
32
|
+
for (const session of sessions) {
|
|
33
|
+
if (!session?.id || session.time?.archived) continue
|
|
34
|
+
|
|
35
|
+
const updatedAt = session.time.updated ?? session.time.created ?? 0
|
|
36
|
+
const nextColumn: BoardColumn =
|
|
37
|
+
statuses[session.id]?.type === "busy" || statuses[session.id]?.type === "retry"
|
|
38
|
+
? "progress"
|
|
39
|
+
: "idle"
|
|
40
|
+
|
|
41
|
+
const existing = cards.get(session.id)
|
|
42
|
+
if (!existing) {
|
|
43
|
+
cards.set(session.id, {
|
|
44
|
+
column: nextColumn,
|
|
45
|
+
projectDirectory: directory,
|
|
46
|
+
session,
|
|
47
|
+
updatedAt,
|
|
48
|
+
})
|
|
49
|
+
continue
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (nextColumn === "progress") existing.column = "progress"
|
|
53
|
+
|
|
54
|
+
if (updatedAt > existing.updatedAt) {
|
|
55
|
+
existing.projectDirectory = directory
|
|
56
|
+
existing.session = session
|
|
57
|
+
existing.updatedAt = updatedAt
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const columns: Record<BoardColumn, BoardCard[]> = {
|
|
63
|
+
progress: [],
|
|
64
|
+
idle: [],
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (const card of cards.values()) {
|
|
68
|
+
columns[card.column].push({
|
|
69
|
+
projectDirectory: card.projectDirectory,
|
|
70
|
+
session: card.session,
|
|
71
|
+
updatedAt: card.updatedAt,
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
for (const key of Object.keys(columns) as BoardColumn[]) {
|
|
76
|
+
columns[key].sort((a, b) => b.updatedAt - a.updatedAt)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return columns
|
|
80
|
+
}
|
package/src/pages/home.tsx
CHANGED
|
@@ -16,14 +16,7 @@ import { useGlobalSync } from "@/context/global-sync";
|
|
|
16
16
|
import { useLanguage } from "@/context/language";
|
|
17
17
|
import { IconButton } from "ikanban-ui/icon-button";
|
|
18
18
|
import type { Session } from "@opencode-ai/sdk/v2/client";
|
|
19
|
-
|
|
20
|
-
type BoardColumn = "progress" | "idle";
|
|
21
|
-
|
|
22
|
-
type BoardCard = {
|
|
23
|
-
session: Session;
|
|
24
|
-
projectDirectory: string;
|
|
25
|
-
updatedAt: number;
|
|
26
|
-
};
|
|
19
|
+
import { buildBoardColumns, trackedProjectDirectories, type BoardCard, type BoardColumn } from "./home/helpers";
|
|
27
20
|
|
|
28
21
|
const homeStyles = {
|
|
29
22
|
border: { border: "1px solid var(--border-weak-base)" },
|
|
@@ -62,18 +55,10 @@ export default function Home() {
|
|
|
62
55
|
const globalSDK = useGlobalSDK();
|
|
63
56
|
const server = useServer();
|
|
64
57
|
const language = useLanguage();
|
|
65
|
-
const
|
|
66
|
-
return sync.data.project
|
|
67
|
-
.slice()
|
|
68
|
-
.sort(
|
|
69
|
-
(a, b) =>
|
|
70
|
-
(b.time.updated ?? b.time.created) -
|
|
71
|
-
(a.time.updated ?? a.time.created),
|
|
72
|
-
);
|
|
73
|
-
});
|
|
58
|
+
const trackedProjects = createMemo(() => trackedProjectDirectories(server.projects.list()));
|
|
74
59
|
|
|
75
60
|
const [rootSessions, { mutate: mutateRootSessions }] = createResource(
|
|
76
|
-
|
|
61
|
+
trackedProjects,
|
|
77
62
|
async (directories) => {
|
|
78
63
|
const entries = await Promise.all(
|
|
79
64
|
directories.map(async (directory) => {
|
|
@@ -95,45 +80,24 @@ export default function Home() {
|
|
|
95
80
|
);
|
|
96
81
|
|
|
97
82
|
const boardColumns = createMemo<Record<BoardColumn, BoardCard[]>>(() => {
|
|
98
|
-
const now = Date.now();
|
|
99
|
-
const columns: Record<BoardColumn, BoardCard[]> = {
|
|
100
|
-
progress: [],
|
|
101
|
-
idle: [],
|
|
102
|
-
};
|
|
103
83
|
const sessionsByProject = rootSessions() ?? {};
|
|
84
|
+
const statusesByProject = Object.fromEntries(
|
|
85
|
+
trackedProjects().map((directory) => {
|
|
86
|
+
const [store] = sync.child(directory);
|
|
87
|
+
return [directory, store.session_status] as const;
|
|
88
|
+
}),
|
|
89
|
+
);
|
|
104
90
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const status = store.session_status[session.id];
|
|
111
|
-
const updatedAt = session.time.updated ?? session.time.created;
|
|
112
|
-
const card = {
|
|
113
|
-
session,
|
|
114
|
-
projectDirectory: project.worktree,
|
|
115
|
-
updatedAt,
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
if (status?.type === "busy" || status?.type === "retry") {
|
|
119
|
-
columns.progress.push(card);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
columns.idle.push(card);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
for (const key of Object.keys(columns) as BoardColumn[]) {
|
|
128
|
-
columns[key].sort((a, b) => b.updatedAt - a.updatedAt);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return columns;
|
|
91
|
+
return buildBoardColumns({
|
|
92
|
+
projectDirectories: trackedProjects(),
|
|
93
|
+
sessionsByProject,
|
|
94
|
+
statusesByProject,
|
|
95
|
+
});
|
|
132
96
|
});
|
|
133
97
|
|
|
134
98
|
createEffect(() => {
|
|
135
|
-
for (const
|
|
136
|
-
sync.child(
|
|
99
|
+
for (const directory of trackedProjects()) {
|
|
100
|
+
sync.child(directory);
|
|
137
101
|
}
|
|
138
102
|
});
|
|
139
103
|
|
|
@@ -249,7 +213,7 @@ export default function Home() {
|
|
|
249
213
|
</div>
|
|
250
214
|
|
|
251
215
|
<Switch>
|
|
252
|
-
<Match when={
|
|
216
|
+
<Match when={trackedProjects().length > 0}>
|
|
253
217
|
<div class="mt-6 flex w-full flex-col gap-6">
|
|
254
218
|
<section class="flex flex-col gap-4">
|
|
255
219
|
<div class="grid gap-3 lg:grid-cols-2">
|
|
@@ -8,7 +8,7 @@ import { Icon } from "ikanban-ui/icon"
|
|
|
8
8
|
import { IconButton } from "ikanban-ui/icon-button"
|
|
9
9
|
import { Tooltip } from "ikanban-ui/tooltip"
|
|
10
10
|
import { createSortable } from "@thisbeyond/solid-dnd"
|
|
11
|
-
import {
|
|
11
|
+
import { type LocalProject } from "@/context/layout"
|
|
12
12
|
import { useGlobalSync } from "@/context/global-sync"
|
|
13
13
|
import { useLanguage } from "@/context/language"
|
|
14
14
|
import { useNotification } from "@/context/notification"
|
|
@@ -77,7 +77,6 @@ const ProjectTile = (props: {
|
|
|
77
77
|
language: ReturnType<typeof useLanguage>
|
|
78
78
|
}): JSX.Element => {
|
|
79
79
|
const notification = useNotification()
|
|
80
|
-
const layout = useLayout()
|
|
81
80
|
const unseenCount = createMemo(() =>
|
|
82
81
|
props.dirs().reduce((total, directory) => total + notification.project.unseenCount(directory), 0),
|
|
83
82
|
)
|
|
@@ -127,7 +126,6 @@ const ProjectTile = (props: {
|
|
|
127
126
|
onClick={() => {
|
|
128
127
|
if (props.selected()) {
|
|
129
128
|
props.setSuppressHover(true)
|
|
130
|
-
layout.sidebar.toggle()
|
|
131
129
|
return
|
|
132
130
|
}
|
|
133
131
|
props.setSuppressHover(false)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const sidebarExpanded = (mobile: boolean | undefined,
|
|
1
|
+
export const sidebarExpanded = (mobile: boolean | undefined, _opened: boolean) => !!mobile
|
|
@@ -6,8 +6,8 @@ describe("sidebarExpanded", () => {
|
|
|
6
6
|
expect(sidebarExpanded(true, false)).toBe(true)
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
test("
|
|
10
|
-
expect(sidebarExpanded(false, true)).toBe(
|
|
9
|
+
test("stays closed on desktop now that the sidebar pane is removed", () => {
|
|
10
|
+
expect(sidebarExpanded(false, true)).toBe(false)
|
|
11
11
|
expect(sidebarExpanded(false, false)).toBe(false)
|
|
12
12
|
})
|
|
13
13
|
})
|
package/src/pages/layout.tsx
CHANGED
|
@@ -770,13 +770,6 @@ export default function Layout(props: ParentProps) {
|
|
|
770
770
|
|
|
771
771
|
command.register("layout", () => {
|
|
772
772
|
const commands: CommandOption[] = [
|
|
773
|
-
{
|
|
774
|
-
id: "sidebar.toggle",
|
|
775
|
-
title: language.t("command.sidebar.toggle"),
|
|
776
|
-
category: language.t("command.category.view"),
|
|
777
|
-
keybind: "mod+b",
|
|
778
|
-
onSelect: () => layout.sidebar.toggle(),
|
|
779
|
-
},
|
|
780
773
|
{
|
|
781
774
|
id: "file.open",
|
|
782
775
|
title: language.t("command.file.open"),
|
|
@@ -1471,12 +1464,7 @@ export default function Layout(props: ParentProps) {
|
|
|
1471
1464
|
)
|
|
1472
1465
|
|
|
1473
1466
|
createEffect(() => {
|
|
1474
|
-
|
|
1475
|
-
document.documentElement.style.setProperty("--dialog-left-margin", "0px")
|
|
1476
|
-
return
|
|
1477
|
-
}
|
|
1478
|
-
const sidebarWidth = layout.sidebar.opened() ? layout.sidebar.width() : 48
|
|
1479
|
-
document.documentElement.style.setProperty("--dialog-left-margin", `${sidebarWidth}px`)
|
|
1467
|
+
document.documentElement.style.setProperty("--dialog-left-margin", "0px")
|
|
1480
1468
|
})
|
|
1481
1469
|
|
|
1482
1470
|
const loadedSessionDirs = new Set<string>()
|
|
@@ -1922,137 +1910,58 @@ export default function Layout(props: ParentProps) {
|
|
|
1922
1910
|
</Show>
|
|
1923
1911
|
<div class="flex-1 min-h-0 flex">
|
|
1924
1912
|
<Show when={hasDirectoryRoute()}>
|
|
1925
|
-
|
|
1926
|
-
<
|
|
1927
|
-
aria-label={language.t("sidebar.nav.projectsAndSessions")}
|
|
1928
|
-
data-component="sidebar-nav-desktop"
|
|
1913
|
+
<div class="xl:hidden">
|
|
1914
|
+
<div
|
|
1929
1915
|
classList={{
|
|
1930
|
-
"
|
|
1931
|
-
"
|
|
1932
|
-
|
|
1933
|
-
style={{ width: layout.sidebar.opened() ? `${Math.max(layout.sidebar.width(), 244)}px` : "64px" }}
|
|
1934
|
-
ref={(el) => {
|
|
1935
|
-
setState("nav", el)
|
|
1916
|
+
"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200": true,
|
|
1917
|
+
"opacity-100 pointer-events-auto": layout.mobileSidebar.opened(),
|
|
1918
|
+
"opacity-0 pointer-events-none": !layout.mobileSidebar.opened(),
|
|
1936
1919
|
}}
|
|
1937
|
-
|
|
1938
|
-
if (
|
|
1939
|
-
clearTimeout(navLeave.current)
|
|
1940
|
-
navLeave.current = undefined
|
|
1920
|
+
onClick={(e) => {
|
|
1921
|
+
if (e.target === e.currentTarget) layout.mobileSidebar.hide()
|
|
1941
1922
|
}}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
setState("hoverSession", undefined)
|
|
1951
|
-
}, 300)
|
|
1923
|
+
/>
|
|
1924
|
+
<nav
|
|
1925
|
+
aria-label={language.t("sidebar.nav.projectsAndSessions")}
|
|
1926
|
+
data-component="sidebar-nav-mobile"
|
|
1927
|
+
classList={{
|
|
1928
|
+
"@container fixed top-10 bottom-0 left-0 z-50 w-72 bg-background-base transition-transform duration-200 ease-out": true,
|
|
1929
|
+
"translate-x-0": layout.mobileSidebar.opened(),
|
|
1930
|
+
"-translate-x-full": !layout.mobileSidebar.opened(),
|
|
1952
1931
|
}}
|
|
1932
|
+
onClick={(e) => e.stopPropagation()}
|
|
1953
1933
|
>
|
|
1954
|
-
<
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
)}
|
|
1962
|
-
handleDragStart={handleDragStart}
|
|
1963
|
-
handleDragEnd={handleDragEnd}
|
|
1964
|
-
handleDragOver={handleDragOver}
|
|
1965
|
-
openProjectLabel={language.t("command.project.open")}
|
|
1966
|
-
openProjectKeybind={() => command.keybind("project.open")}
|
|
1967
|
-
onOpenProject={chooseProject}
|
|
1968
|
-
renderProjectOverlay={() => (
|
|
1969
|
-
<ProjectDragOverlay projects={() => layout.projects.list()} activeProject={() => store.activeProject} />
|
|
1970
|
-
)}
|
|
1971
|
-
settingsLabel={() => language.t("sidebar.settings")}
|
|
1972
|
-
settingsKeybind={() => command.keybind("settings.open")}
|
|
1973
|
-
onOpenSettings={openSettings}
|
|
1974
|
-
helpLabel={() => language.t("sidebar.help")}
|
|
1975
|
-
onOpenHelp={() => platform.openLink("https://github.com/isomoes/ikanban/issues")}
|
|
1976
|
-
renderPanel={() => (
|
|
1977
|
-
<Show when={currentProject()} keyed>
|
|
1978
|
-
{(project) => <SidebarPanel project={project} />}
|
|
1979
|
-
</Show>
|
|
1980
|
-
)}
|
|
1981
|
-
/>
|
|
1982
|
-
</div>
|
|
1983
|
-
<Show when={!layout.sidebar.opened() ? hoverProjectData()?.worktree : undefined} keyed>
|
|
1984
|
-
{(worktree) => (
|
|
1985
|
-
<div class="absolute inset-y-0 left-16 z-50 flex" onMouseEnter={aim.reset}>
|
|
1986
|
-
<SidebarPanel project={hoverProjectData()} />
|
|
1987
|
-
</div>
|
|
1934
|
+
<SidebarContent
|
|
1935
|
+
mobile
|
|
1936
|
+
opened={() => false}
|
|
1937
|
+
aimMove={aim.move}
|
|
1938
|
+
projects={() => layout.projects.list()}
|
|
1939
|
+
renderProject={(project) => (
|
|
1940
|
+
<SortableProject ctx={projectSidebarCtx} project={project} sortNow={sortNow} mobile />
|
|
1988
1941
|
)}
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
classList={{
|
|
2005
|
-
"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200": true,
|
|
2006
|
-
"opacity-100 pointer-events-auto": layout.mobileSidebar.opened(),
|
|
2007
|
-
"opacity-0 pointer-events-none": !layout.mobileSidebar.opened(),
|
|
2008
|
-
}}
|
|
2009
|
-
onClick={(e) => {
|
|
2010
|
-
if (e.target === e.currentTarget) layout.mobileSidebar.hide()
|
|
2011
|
-
}}
|
|
1942
|
+
handleDragStart={handleDragStart}
|
|
1943
|
+
handleDragEnd={handleDragEnd}
|
|
1944
|
+
handleDragOver={handleDragOver}
|
|
1945
|
+
openProjectLabel={language.t("command.project.open")}
|
|
1946
|
+
openProjectKeybind={() => command.keybind("project.open")}
|
|
1947
|
+
onOpenProject={chooseProject}
|
|
1948
|
+
renderProjectOverlay={() => (
|
|
1949
|
+
<ProjectDragOverlay projects={() => layout.projects.list()} activeProject={() => store.activeProject} />
|
|
1950
|
+
)}
|
|
1951
|
+
settingsLabel={() => language.t("sidebar.settings")}
|
|
1952
|
+
settingsKeybind={() => command.keybind("settings.open")}
|
|
1953
|
+
onOpenSettings={openSettings}
|
|
1954
|
+
helpLabel={() => language.t("sidebar.help")}
|
|
1955
|
+
onOpenHelp={() => platform.openLink("https://github.com/isomoes/ikanban/issues")}
|
|
1956
|
+
renderPanel={() => <SidebarPanel project={currentProject()} mobile />}
|
|
2012
1957
|
/>
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
data-component="sidebar-nav-mobile"
|
|
2016
|
-
classList={{
|
|
2017
|
-
"@container fixed top-10 bottom-0 left-0 z-50 w-72 bg-background-base transition-transform duration-200 ease-out": true,
|
|
2018
|
-
"translate-x-0": layout.mobileSidebar.opened(),
|
|
2019
|
-
"-translate-x-full": !layout.mobileSidebar.opened(),
|
|
2020
|
-
}}
|
|
2021
|
-
onClick={(e) => e.stopPropagation()}
|
|
2022
|
-
>
|
|
2023
|
-
<SidebarContent
|
|
2024
|
-
mobile
|
|
2025
|
-
opened={() => layout.sidebar.opened()}
|
|
2026
|
-
aimMove={aim.move}
|
|
2027
|
-
projects={() => layout.projects.list()}
|
|
2028
|
-
renderProject={(project) => (
|
|
2029
|
-
<SortableProject ctx={projectSidebarCtx} project={project} sortNow={sortNow} mobile />
|
|
2030
|
-
)}
|
|
2031
|
-
handleDragStart={handleDragStart}
|
|
2032
|
-
handleDragEnd={handleDragEnd}
|
|
2033
|
-
handleDragOver={handleDragOver}
|
|
2034
|
-
openProjectLabel={language.t("command.project.open")}
|
|
2035
|
-
openProjectKeybind={() => command.keybind("project.open")}
|
|
2036
|
-
onOpenProject={chooseProject}
|
|
2037
|
-
renderProjectOverlay={() => (
|
|
2038
|
-
<ProjectDragOverlay projects={() => layout.projects.list()} activeProject={() => store.activeProject} />
|
|
2039
|
-
)}
|
|
2040
|
-
settingsLabel={() => language.t("sidebar.settings")}
|
|
2041
|
-
settingsKeybind={() => command.keybind("settings.open")}
|
|
2042
|
-
onOpenSettings={openSettings}
|
|
2043
|
-
helpLabel={() => language.t("sidebar.help")}
|
|
2044
|
-
onOpenHelp={() => platform.openLink("https://github.com/isomoes/ikanban/issues")}
|
|
2045
|
-
renderPanel={() => <SidebarPanel project={currentProject()} mobile />}
|
|
2046
|
-
/>
|
|
2047
|
-
</nav>
|
|
2048
|
-
</div>
|
|
2049
|
-
</>
|
|
1958
|
+
</nav>
|
|
1959
|
+
</div>
|
|
2050
1960
|
</Show>
|
|
2051
1961
|
|
|
2052
1962
|
<main
|
|
2053
1963
|
classList={{
|
|
2054
1964
|
"size-full overflow-x-hidden flex flex-col items-start contain-strict border-t border-border-weak-base": true,
|
|
2055
|
-
"xl:border-l xl:rounded-tl-[12px]": hasDirectoryRoute() && !layout.sidebar.opened(),
|
|
2056
1965
|
"border-t-0": !hasDirectoryRoute(),
|
|
2057
1966
|
}}
|
|
2058
1967
|
>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as Q,a as U,b as W,c as X,d as Y,e as Z,f as ee,g as te,h as R,i as re,j as se,k as t,l as s,L as ae,B as L,m as y,n as oe,o as ne,D as ie,M as O,I as F,s as $,S as q,p as K,q as le,t as b,F as ce,r as de,v as ue,w as ge}from"./index-CE2ZqGRp.js";var me=b("<div>"),ve=b('<div class="mt-6 flex w-full flex-col gap-6"><section class="flex flex-col gap-4"><div class="grid gap-3 lg:grid-cols-2">'),be=b('<div class="mt-6 rounded-2xl border border-dashed px-6 py-10 shadow-xs-border-base"><div class="mx-auto flex max-w-md flex-col items-center gap-3 text-center"><div class="flex size-12 items-center justify-center rounded-2xl border shadow-xs-border-base"></div><div class="flex flex-col gap-1 items-center justify-center"><div class="text-14-medium text-text-strong"></div><div class="text-12-regular text-text-weak">'),fe=b('<div class="mx-auto w-full max-w-7xl px-4 py-6 md:px-6 md:py-8"><div class="flex flex-col gap-4 md:flex-row md:items-start md:justify-between"><div class=min-w-0><div class="flex items-center gap-3"><div class="flex size-10 items-center justify-center rounded-2xl border shadow-xs-border-base"></div><div><div class="text-18-medium text-text-strong"></div><div class="mt-0.5 text-12-regular text-text-weak"></div></div></div></div><div class="flex items-center gap-2 self-start md:justify-end">'),xe=b('<div class="rounded-xl border border-dashed px-3 py-8 text-center text-12-regular text-text-weak">'),pe=b('<section class="rounded-2xl p-3 md:p-4 min-h-72 shadow-xs-border-base"><div class="flex items-center justify-between gap-3"><div class="flex items-center gap-2 min-w-0"><div></div><div class="text-14-medium text-text-strong"></div></div><div class="text-12-mono text-text-weak"></div></div><div class="mt-3 flex flex-col gap-2">'),he=b('<span class="min-w-0 flex-1 truncate text-12-regular text-text-weak">'),we=b('<div class="flex shrink-0 items-center gap-2 text-12-regular text-text-weak"><span>'),ke=b('<div class="overflow-hidden rounded-xl transition-colors"><div class="flex items-start justify-between gap-3 px-3 pt-3"><div class="min-w-0 flex-1 pt-1"><div class="truncate text-14-medium leading-tight text-text-strong">');const x={border:{border:"1px solid var(--border-weak-base)"},heroIcon:{border:"1px solid var(--border-weak-base)",background:"linear-gradient(135deg, color-mix(in srgb, var(--text-interactive-base) 12%, var(--background-stronger)), var(--background-stronger))"},emptyPanel:{"border-color":"var(--border-weak-base)",background:"linear-gradient(180deg, color-mix(in srgb, var(--surface-base-hover) 35%, var(--background-stronger)), var(--background-stronger))"},emptyIcon:{border:"1px solid var(--border-weak-base)",background:"linear-gradient(135deg, color-mix(in srgb, var(--text-interactive-base) 10%, var(--surface-inset-base)), var(--surface-inset-base))"},card:{border:"1px solid var(--border-weak-base)",background:"var(--background-base)"},emptyState:{"border-color":"var(--border-weak-base)",background:"linear-gradient(180deg, color-mix(in srgb, var(--surface-base-hover) 30%, var(--surface-inset-base)), var(--surface-inset-base))"}};function $e(){const o=Q(),B=U(),P=W(),p=X(),_=Y(),j=Z(),m=ee(),l=te(),h=R(()=>o.data.project.slice().sort((e,r)=>(r.time.updated??r.time.created)-(e.time.updated??e.time.created))),[E,{mutate:a}]=re(()=>h().map(e=>e.worktree),async e=>{const r=await Promise.all(e.map(async n=>{const d=((await j.client.session.list({directory:n,roots:!0})).data??[]).filter(v=>!!v?.id&&!v.time?.archived);return[n,d]}));return Object.fromEntries(r)}),u=R(()=>{const e={progress:[],idle:[]},r=E()??{};for(const n of h()){const[c]=o.child(n.worktree),d=r[n.worktree]??[];for(const v of d){const C=c.session_status[v.id],M=v.time.updated??v.time.created,S={session:v,projectDirectory:n.worktree,updatedAt:M};if(C?.type==="busy"||C?.type==="retry"){e.progress.push(S);continue}e.idle.push(S)}}for(const n of Object.keys(e))e[n].sort((c,d)=>d.updatedAt-c.updatedAt);return e});se(()=>{for(const e of h())o.child(e.worktree)});const f=R(()=>{const e=m.healthy();return e===!0?"bg-icon-success-base":e===!1?"bg-icon-critical-base":"bg-border-weak-base"});function z(e){B.projects.open(e),m.projects.touch(e),_(`/${K(e)}`)}function A(e,r){B.projects.open(e),m.projects.touch(e),_(`/${K(e)}/${r}`)}async function i(e,r){const[,n]=o.child(e,{bootstrap:!1});await j.client.session.update({sessionID:r,time:{archived:Date.now()}}),a(c=>c?.[e]?{...c,[e]:c[e].filter(d=>d.id!==r)}:c),n("session",c=>c.filter(d=>d.id!==r))}async function I(){function e(r){if(Array.isArray(r))for(const n of r)z(n);else r&&z(r)}if(P.openDirectoryPickerDialog&&m.isLocal()){const r=await P.openDirectoryPickerDialog?.({title:l.t("command.project.open"),multiple:!0});e(r)}else p.show(()=>s(le,{multiple:!0,onSelect:e}),()=>e(null))}return(()=>{var e=fe(),r=e.firstChild,n=r.firstChild,c=n.firstChild,d=c.firstChild,v=d.nextSibling,C=v.firstChild,M=C.nextSibling,S=n.nextSibling;return t(d,s(ae,{class:"w-6 opacity-90"})),t(C,()=>l.t("home.sessionBoard")),t(M,()=>l.t("home.sessionBoard.description")),t(S,s(L,{icon:"folder-add-left",size:"normal",class:"pl-2 pr-3",onClick:I,get children(){return l.t("command.project.open")}}),null),t(S,s(L,{size:"normal",variant:"ghost",class:"pr-3 text-13-regular text-text-weak",onClick:()=>p.show(()=>s(ie,{})),get children(){return[(()=>{var g=me();return y(w=>oe(g,{"size-2 rounded-full":!0,[f()]:!0},w)),g})(),ne(()=>m.name)]}}),null),t(e,s(q,{get children(){return[s(O,{get when(){return h().length>0},get children(){var g=ve(),w=g.firstChild,k=w.firstChild;return t(k,s(N,{get title(){return l.t("home.sessionBoard.progress")},icon:"brain",tone:"progress",get cards(){return u().progress},onOpen:A,onArchive:i,get empty(){return l.t("home.sessionBoard.emptyProgress")}}),null),t(k,s(N,{get title(){return l.t("home.sessionBoard.idle")},icon:"dash",tone:"idle",get cards(){return u().idle},onOpen:A,onArchive:i,get empty(){return l.t("home.sessionBoard.emptyIdle")}}),null),g}}),s(O,{when:!0,get children(){var g=be(),w=g.firstChild,k=w.firstChild,H=k.nextSibling,G=H.firstChild,T=G.nextSibling;return t(k,s(F,{name:"folder-add-left",size:"large"})),t(G,()=>l.t("home.empty.title")),t(T,()=>l.t("home.empty.description")),t(w,s(L,{class:"mt-1 px-3",onClick:I,get children(){return l.t("command.project.open")}}),null),y(D=>{var V=x.emptyPanel,J=x.emptyIcon;return D.e=$(g,V,D.e),D.t=$(k,J,D.t),D},{e:void 0,t:void 0}),g}})]}}),null),y(g=>$(d,x.heroIcon,g)),e})()}function N(o){const B=()=>o.tone==="progress"?"bg-surface-base-hover text-icon-success-base border-border-weak-base":"bg-surface-inset-base text-icon-base border-border-weak-base",P=()=>o.tone==="progress"?{...x.border,background:"linear-gradient(180deg, color-mix(in srgb, var(--text-interactive-base) 8%, var(--background-stronger)), var(--background-stronger))"}:{...x.border,background:"linear-gradient(180deg, color-mix(in srgb, var(--surface-inset-base) 55%, var(--background-stronger)), var(--background-stronger))"};return(()=>{var p=pe(),_=p.firstChild,j=_.firstChild,m=j.firstChild,l=m.nextSibling,h=j.nextSibling,E=_.nextSibling;return t(m,s(F,{get name(){return o.icon},size:"small"})),t(l,()=>o.title),t(h,()=>o.cards.length),t(E,s(q,{get children(){return[s(O,{get when(){return o.cards.length>0},get children(){return s(ce,{get each(){return o.cards},children:a=>(()=>{var u=ke(),f=u.firstChild,z=f.firstChild,A=z.firstChild;return t(A,()=>a.session.title),t(f,s(de,{icon:"archive",variant:"ghost",class:"size-7 rounded-md","aria-label":"Archive session",onClick:i=>{i.preventDefault(),i.stopPropagation(),o.onArchive(a.projectDirectory,a.session.id)}}),null),t(u,s(L,{variant:"ghost",class:"flex h-auto w-full min-w-0 items-center justify-between gap-3 rounded-none border-0 bg-transparent px-3 pb-3 pt-2 text-left",onClick:()=>o.onOpen(a.projectDirectory,a.session.id),get children(){return[(()=>{var i=he();return t(i,()=>a.projectDirectory.replace(/^.*?([^/\\]+(?:[/\\][^/\\]+)?)$/,"$1")),i})(),(()=>{var i=we(),I=i.firstChild;return t(I,()=>ue.fromMillis(a.updatedAt).toRelative()),t(i,s(F,{name:"arrow-right",size:"small",class:"text-icon-weak shrink-0"}),null),i})()]}}),null),y(i=>$(u,x.card,i)),u})()})}}),s(O,{when:!0,get children(){var a=xe();return t(a,()=>o.empty),y(u=>$(a,x.emptyState,u)),a}})]}})),y(a=>{var u=P(),f=`size-7 rounded-full border flex items-center justify-center ${B()}`;return a.e=$(p,u,a.e),f!==a.t&&ge(m,a.t=f),a},{e:void 0,t:void 0}),p})()}export{$e as default};
|