clay-server 5.6.0-beta.2 → 5.6.0-beta.4
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/lib/public/css/chrome-material.css +3 -5
- package/lib/public/css/navigation-island.css +108 -0
- package/lib/public/css/project-empty-canvas.css +52 -7
- package/lib/public/modules/project-empty-canvas.js +8 -18
- package/lib/public/modules/project-home-render.js +78 -0
- package/lib/public/pane-assets/{app-Y3UNQJAF.js → app-QR6W64PK.js} +1 -1
- package/lib/public/pane-assets/{chunk-FFGCYBLP.js → chunk-25X3V6RW.js} +1 -1
- package/lib/public/pane-assets/{chunk-DNZONOJO.js → chunk-4KCNVBBD.js} +1 -1
- package/lib/public/pane-assets/chunk-AKFJO7SA.js +1 -0
- package/lib/public/pane-assets/chunk-DX7R6GRL.js +1 -0
- package/lib/public/pane-assets/chunk-F33TBKP2.js +1 -0
- package/lib/public/pane-assets/{chunk-XUDCXLKZ.js → chunk-H3BOT3SB.js} +1 -1
- package/lib/public/pane-assets/{chunk-DK5TJRPY.js → chunk-H6RI6IG5.js} +1 -1
- package/lib/public/pane-assets/{chunk-YIMKBG4B.js → chunk-HXD34AZT.js} +1 -1
- package/lib/public/pane-assets/{chunk-DCIX62EV.js → chunk-I5RM7KNO.js} +1 -1
- package/lib/public/pane-assets/{chunk-HA7YSD4A.js → chunk-IIZZTDLB.js} +1 -1
- package/lib/public/pane-assets/{chunk-S7RDX7Z7.js → chunk-K3AFWB4T.js} +97 -97
- package/lib/public/pane-assets/{chunk-YSP3IUTM.js → chunk-KLRVHJC5.js} +1 -1
- package/lib/public/pane-assets/{chunk-3HH6CEO5.js → chunk-OHKQX2VV.js} +1 -1
- package/lib/public/pane-assets/{chunk-M6IVTHY2.js → chunk-PTZ2QTNA.js} +1 -1
- package/lib/public/pane-assets/chunk-QWNMLSVA.js +1 -0
- package/lib/public/pane-assets/{chunk-76XI36Y7.js → chunk-TKD25TLY.js} +1 -1
- package/lib/public/pane-assets/{chunk-JD65ITOS.js → chunk-TUZOISN6.js} +1 -1
- package/lib/public/pane-assets/{chunk-BHQLADRL.js → chunk-UBGZO6GV.js} +1 -1
- package/lib/public/pane-assets/chunk-VG32EEIQ.js +1 -0
- package/lib/public/pane-assets/chunk-W2W4CPO7.js +1 -0
- package/lib/public/pane-assets/{chunk-5Z22SHOM.js → chunk-WI7YYJ5R.js} +1 -1
- package/lib/public/pane-assets/chunk-XX2GY7T5.js +1 -0
- package/lib/public/pane-assets/{chunk-SBLWP3OO.js → chunk-YDQZXMHJ.js} +1 -1
- package/lib/public/pane-assets/manifest.json +378 -377
- package/lib/public/pane-assets/{style-KPZA4PQD.css → style-BCUGGAD3.css} +1 -1
- package/package.json +1 -1
- package/lib/public/pane-assets/chunk-5JCXUWGC.js +0 -1
- package/lib/public/pane-assets/chunk-BCUZ5CU4.js +0 -1
- package/lib/public/pane-assets/chunk-IX4TRTWV.js +0 -1
- package/lib/public/pane-assets/chunk-JYKTJDXQ.js +0 -1
- package/lib/public/pane-assets/chunk-MHIJP27M.js +0 -1
- package/lib/public/pane-assets/chunk-Z2APTNHP.js +0 -1
- package/lib/public/pane-assets/chunk-ZH3SEVMH.js +0 -1
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
--chrome-material-solid: var(--sidebar-bg);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/* Navigation
|
|
29
|
+
/* Navigation alone uses a softly blurred backing. */
|
|
30
30
|
:is(:where(#navigation-island) > #icon-strip, #sidebar-column, #mate-sidebar-column) {
|
|
31
31
|
--chrome-material-tint: 90%;
|
|
32
32
|
--chrome-material-blur: 24px;
|
|
@@ -74,9 +74,7 @@ body.mate-workspace-active :is(#sidebar-column, .title-bar-content) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, black 74%, transparent)) {
|
|
77
|
-
:is(:where(#navigation-island) > #icon-strip, #sidebar-column, #mate-sidebar-column
|
|
78
|
-
.split-pane-header, .tool-pane-header, .terminal-header,
|
|
79
|
-
.file-viewer-tabbar, .shared-browser-header, .dm-header-bar, #contextual-clay > header) {
|
|
77
|
+
:is(:where(#navigation-island) > #icon-strip, #sidebar-column, #mate-sidebar-column) {
|
|
80
78
|
--chrome-material-fill: color-mix(in srgb, var(--chrome-material-solid) var(--chrome-material-tint), transparent);
|
|
81
79
|
--chrome-material-filter: blur(var(--chrome-material-blur)) saturate(var(--chrome-material-saturation));
|
|
82
80
|
}
|
|
@@ -141,7 +139,7 @@ body.mate-workspace-active :is(#sidebar-column, .title-bar-content) {
|
|
|
141
139
|
.tool-pane-material > .tool-pane-header > .shared-browser-tabs { background: transparent; }
|
|
142
140
|
|
|
143
141
|
/* Reading surfaces stay opaque in project, embedded and native Mate chats.
|
|
144
|
-
|
|
142
|
+
Pane headers also stay opaque; navigation retains its glass backing. */
|
|
145
143
|
#app,
|
|
146
144
|
.split-pane-frame {
|
|
147
145
|
background: var(--bg);
|
|
@@ -323,3 +323,111 @@ body.clay-workspace-active #sidebar-column #you-button.palette-tile.active > .lu
|
|
|
323
323
|
#sidebar-column :is(.git-placard-more, .git-placard-badge) {
|
|
324
324
|
background: var(--navigation-inset);
|
|
325
325
|
}
|
|
326
|
+
|
|
327
|
+
/* Navigation foregrounds stay readable over the composited glass. */
|
|
328
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar, #icon-strip) {
|
|
329
|
+
--navigation-foreground: color-mix(in srgb, var(--text) 88%, var(--sidebar-bg));
|
|
330
|
+
--navigation-secondary: color-mix(in srgb, var(--text) 80%, var(--sidebar-bg));
|
|
331
|
+
}
|
|
332
|
+
:is(#sidebar-column, #mate-sidebar-column) .palette-tile:not(:disabled):not(#you-button),
|
|
333
|
+
:is(#sidebar-column, #mate-sidebar-column) .palette-tile:not(:disabled):not(#you-button) > .lucide,
|
|
334
|
+
:is(#sidebar-column, #mate-sidebar-column) .session-folder-toggle:not(:disabled) {
|
|
335
|
+
color: var(--navigation-foreground);
|
|
336
|
+
}
|
|
337
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-count,
|
|
338
|
+
.session-date-group-count, .session-group-header-label, .session-folder-empty,
|
|
339
|
+
.session-favorites-empty, .session-item-age, .sidebar-badge),
|
|
340
|
+
#sidebar-column :is(.git-placard-branch, .git-placard-remote,
|
|
341
|
+
.git-placard-stat:not(.git-placard-stat-warn)),
|
|
342
|
+
#sidebar-column .git-placard-more:not(:disabled) {
|
|
343
|
+
color: var(--navigation-secondary);
|
|
344
|
+
}
|
|
345
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-empty,
|
|
346
|
+
.session-favorites-empty) {
|
|
347
|
+
opacity: 1;
|
|
348
|
+
}
|
|
349
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-tool,
|
|
350
|
+
.session-group-clear-btn, .session-search-clear):not(:disabled):not(.is-create):not([aria-expanded="true"]) {
|
|
351
|
+
color: var(--navigation-secondary);
|
|
352
|
+
}
|
|
353
|
+
#icon-strip :is(.icon-strip-filter-label, .icon-strip-hint) {
|
|
354
|
+
color: var(--navigation-secondary);
|
|
355
|
+
}
|
|
356
|
+
#icon-strip .icon-strip-hint { opacity: 1; }
|
|
357
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) .session-folder-tool {
|
|
358
|
+
white-space: nowrap;
|
|
359
|
+
}
|
|
360
|
+
/* Layer darker translucent faces onto navigation instead of outlining tiles. */
|
|
361
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar, #icon-strip) {
|
|
362
|
+
--navigation-layer: rgba(0, 0, 0, .08);
|
|
363
|
+
--navigation-layer-hover: rgba(0, 0, 0, .14);
|
|
364
|
+
--navigation-card: rgba(0, 0, 0, .05);
|
|
365
|
+
}
|
|
366
|
+
.dark-theme :is(#sidebar-column, #mate-sidebar-column, #sidebar, #icon-strip) {
|
|
367
|
+
--navigation-layer: rgba(0, 0, 0, .24);
|
|
368
|
+
--navigation-layer-hover: rgba(0, 0, 0, .36);
|
|
369
|
+
--navigation-card: rgba(0, 0, 0, .18);
|
|
370
|
+
}
|
|
371
|
+
#icon-strip .icon-strip-item[data-slug]:not(:has(.project-emoji, img)) {
|
|
372
|
+
color: var(--text);
|
|
373
|
+
}
|
|
374
|
+
#icon-strip .icon-strip-item[data-slug]:not(:has(.project-emoji, img)):not(.active)::before {
|
|
375
|
+
background: var(--navigation-layer);
|
|
376
|
+
box-shadow: none;
|
|
377
|
+
}
|
|
378
|
+
#icon-strip .icon-strip-item[data-slug]:not(:has(.project-emoji, img)):hover:not(.active)::before {
|
|
379
|
+
background: var(--navigation-layer-hover);
|
|
380
|
+
}
|
|
381
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-tool,
|
|
382
|
+
.session-folder-new-btn, #mate-new-session-btn):not(:disabled):not(.is-create) {
|
|
383
|
+
background: var(--navigation-layer);
|
|
384
|
+
color: var(--text);
|
|
385
|
+
}
|
|
386
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-tool,
|
|
387
|
+
.session-folder-new-btn, #mate-new-session-btn):hover:not(:disabled):not(.is-create) {
|
|
388
|
+
background: var(--navigation-layer-hover);
|
|
389
|
+
}
|
|
390
|
+
#sidebar-column .git-placard {
|
|
391
|
+
background: var(--navigation-card);
|
|
392
|
+
border-color: transparent;
|
|
393
|
+
}
|
|
394
|
+
#sidebar-column .git-placard-more:not(:disabled) {
|
|
395
|
+
background: var(--navigation-layer);
|
|
396
|
+
border-color: transparent;
|
|
397
|
+
color: var(--text);
|
|
398
|
+
}
|
|
399
|
+
#sidebar-column .git-placard-more:hover {
|
|
400
|
+
background: var(--navigation-layer-hover);
|
|
401
|
+
color: var(--text);
|
|
402
|
+
}
|
|
403
|
+
#sidebar-column .git-placard-badge:not(.git-placard-badge-warn) {
|
|
404
|
+
border-color: transparent;
|
|
405
|
+
color: var(--navigation-secondary);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Compact row actions share the navigation's filled layers. */
|
|
409
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-folder-star-btn, .session-close-btn:not(.armed)) {
|
|
410
|
+
background: var(--navigation-layer);
|
|
411
|
+
color: var(--text);
|
|
412
|
+
border-radius: 5px;
|
|
413
|
+
padding: 0;
|
|
414
|
+
}
|
|
415
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) :is(.session-item, .session-loop-child):is(:hover, :focus-within) :is(.session-folder-star-btn, .session-close-btn) {
|
|
416
|
+
opacity: 1;
|
|
417
|
+
}
|
|
418
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) .session-folder-star-btn:is(:hover, :focus-visible, .is-favorite) {
|
|
419
|
+
background: color-mix(in srgb, var(--accent) 16%, var(--navigation-layer));
|
|
420
|
+
color: var(--accent);
|
|
421
|
+
}
|
|
422
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) .session-close-btn:not(.armed):is(:hover, :focus-visible) {
|
|
423
|
+
background: var(--navigation-layer-hover);
|
|
424
|
+
color: var(--text);
|
|
425
|
+
}
|
|
426
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) .session-close-btn:focus-visible {
|
|
427
|
+
outline: 2px solid var(--accent);
|
|
428
|
+
outline-offset: 1px;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
:is(#sidebar-column, #mate-sidebar-column, #sidebar) .session-item:not(:hover):not(:focus-within):not(:has(.session-unread-badge.has-unread)) .session-item-age {
|
|
432
|
+
opacity: 1;
|
|
433
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Project home stays open and quiet over the workspace wallpaper. */
|
|
2
2
|
body:not(.pane-mode) #main-column:has(#split-host.project-start-visible) {
|
|
3
3
|
background: transparent;
|
|
4
4
|
border: 0;
|
|
@@ -14,21 +14,29 @@ body:not(.pane-mode) #main-panels:has(> #split-host.project-start-visible) {
|
|
|
14
14
|
#split-host.project-start-visible.visible {
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: row;
|
|
17
|
-
align-items:
|
|
17
|
+
align-items: flex-start;
|
|
18
18
|
justify-content: center;
|
|
19
|
-
padding:
|
|
19
|
+
padding: clamp(32px, 12vh, 112px) 32px 32px;
|
|
20
20
|
background: transparent;
|
|
21
21
|
overflow: auto;
|
|
22
22
|
}
|
|
23
23
|
#split-host.project-start-visible > :not(#project-empty-canvas) { display: none; }
|
|
24
24
|
#project-empty-canvas {
|
|
25
25
|
position: relative;
|
|
26
|
-
flex: 0 1
|
|
27
|
-
width:
|
|
26
|
+
flex: 0 1 600px;
|
|
27
|
+
width: 600px;
|
|
28
28
|
min-width: 0;
|
|
29
29
|
max-width: 100%;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
margin: 0;
|
|
31
|
+
isolation: isolate;
|
|
32
|
+
color: #fff;
|
|
33
|
+
text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 2px 12px rgba(0, 0, 0, .5);
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
border-radius: 12px;
|
|
37
|
+
background: rgba(16, 18, 24, .48);
|
|
38
|
+
-webkit-backdrop-filter: blur(16px) saturate(.9);
|
|
39
|
+
backdrop-filter: blur(16px) saturate(.9);
|
|
32
40
|
}
|
|
33
41
|
#project-empty-canvas[hidden] { display: none; }
|
|
34
42
|
@media (max-width: 768px) {
|
|
@@ -41,3 +49,40 @@ body:not(.pane-mode) #main-panels:has(> #split-host.project-start-visible) {
|
|
|
41
49
|
border: 0;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
52
|
+
|
|
53
|
+
.project-home-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
|
|
54
|
+
.project-home-heading h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
|
|
55
|
+
.project-home button { font: inherit; cursor: pointer; }
|
|
56
|
+
.project-home-recent { display: flex; flex-direction: column; gap: 8px; }
|
|
57
|
+
.project-home-row { display: flex; align-items: center; width: 100%; gap: 20px; padding: 14px 12px; border: 0; border-radius: 8px; text-align: left; background: transparent; color: inherit; text-shadow: inherit; }
|
|
58
|
+
.project-home-row:is(:hover, :focus-visible) { background: rgba(0, 0, 0, .22); }
|
|
59
|
+
.project-home-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; }
|
|
60
|
+
.project-home-copy strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
61
|
+
.project-home-detail { font-size: 12px; color: rgba(255, 255, 255, .88); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
62
|
+
.project-home-trailing { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .88); }
|
|
63
|
+
.project-home-trailing small { font-size: 11px; white-space: nowrap; }
|
|
64
|
+
.project-home-arrow { display: flex; }
|
|
65
|
+
.project-home-arrow svg { width: 14px; height: 14px; }
|
|
66
|
+
.project-home button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
67
|
+
.project-home button:disabled { opacity: .5; cursor: default; }
|
|
68
|
+
.project-home-vendors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
|
|
69
|
+
.project-home-vendors button { display: inline-flex; align-items: center; gap: 8px; width: 40px; height: 40px; justify-content: center; padding: 8px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .35); color: #fff; text-shadow: none; font-size: 12px; }
|
|
70
|
+
.project-home-vendors button:hover { background: rgba(0, 0, 0, .5); }
|
|
71
|
+
.project-home-vendors img { width: 24px; height: 24px; border-radius: 5px; }
|
|
72
|
+
.project-home-empty, .project-home-status, .project-home-vendors p { font-size: 13px; color: rgba(255, 255, 255, .88); line-height: 1.5; }
|
|
73
|
+
.project-home-status:empty { display: none; }
|
|
74
|
+
@media (max-width: 768px) {
|
|
75
|
+
#split-host.project-start-visible.visible { padding: 40px 20px 24px; }
|
|
76
|
+
#project-empty-canvas { padding: 20px; }
|
|
77
|
+
.project-home-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
|
|
78
|
+
.project-home-heading h1 { font-size: 20px; }
|
|
79
|
+
.project-home-row { padding: 14px 0; gap: 12px; }
|
|
80
|
+
.project-home-vendors button { width: 44px; height: 44px; }
|
|
81
|
+
.project-home-trailing { gap: 6px; }
|
|
82
|
+
}
|
|
83
|
+
@media (forced-colors: active), (prefers-reduced-transparency: reduce) {
|
|
84
|
+
#project-empty-canvas { background: var(--bg); color: var(--text); text-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
|
|
85
|
+
.project-home-detail, .project-home-trailing, .project-home-empty, .project-home-status, .project-home-vendors p { color: var(--text-muted); }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.project-home-create-label { margin: 24px 0 0; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .88); }
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Project home shares guarded session creation and navigation with the picker.
|
|
2
2
|
import { store } from './store.js';
|
|
3
3
|
import { startNewSession } from './sidebar-sessions.js';
|
|
4
4
|
import { retryOptions, createOptions } from './session-create.js';
|
|
5
5
|
import { switchToStandalone } from './split-view-presentations.js';
|
|
6
|
-
import {
|
|
6
|
+
import { pickerCandidates } from './split-view-picker-render.js';
|
|
7
|
+
import { renderProjectHome } from './project-home-render.js';
|
|
7
8
|
import { activeSavedView } from './view-workspace-state.js';
|
|
8
9
|
import { layoutScope, currentLayoutScope } from './split-view-layout-scope.js';
|
|
9
10
|
|
|
@@ -70,12 +71,6 @@ function onClick(event) {
|
|
|
70
71
|
}
|
|
71
72
|
function onKey(event) {
|
|
72
73
|
var menu = canvasElement();
|
|
73
|
-
if (event.key === 'Escape') {
|
|
74
|
-
event.preventDefault(); event.stopPropagation();
|
|
75
|
-
if (menu.contains(document.activeElement)) document.activeElement.blur();
|
|
76
|
-
updatePicker({ dismissed: true });
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
74
|
if (['ArrowDown', 'ArrowUp', 'Home', 'End', 'Enter'].indexOf(event.key) < 0) return;
|
|
80
75
|
if (event.target.tagName === 'INPUT' && ['Home', 'End'].indexOf(event.key) >= 0) return;
|
|
81
76
|
var items = Array.from(menu.querySelectorAll('[data-split-session], [data-split-vendor]')).filter(function (item) { return !item.disabled; });
|
|
@@ -97,24 +92,19 @@ export function renderProjectEmptyCanvas(host, nativeApp) {
|
|
|
97
92
|
clearProjectEmptyCanvas();
|
|
98
93
|
root = document.createElement('section');
|
|
99
94
|
root.id = CANVAS_ID;
|
|
100
|
-
root.className = '
|
|
101
|
-
root.setAttribute('
|
|
102
|
-
root.setAttribute('aria-label', 'Open a session');
|
|
95
|
+
root.className = 'project-home';
|
|
96
|
+
root.setAttribute('aria-label', 'Project home');
|
|
103
97
|
host.appendChild(root);
|
|
104
98
|
var scope = activeSavedView() ? layoutScope(activeSavedView()) : standaloneScope();
|
|
105
99
|
store.set({ projectStartPicker: { projectStart: true, side: 'right', query: '', error: '', pending: null, dismissed: false, scope: scope } });
|
|
106
|
-
|
|
100
|
+
renderProjectHome(root, store.get('projectStartPicker'));
|
|
107
101
|
root.addEventListener('click', onClick);
|
|
108
102
|
root.addEventListener('keydown', onKey);
|
|
109
|
-
root.addEventListener('input', function (event) {
|
|
110
|
-
updatePicker({ query: event.target.value });
|
|
111
|
-
root.querySelector('.split-session-section').textContent = event.target.value ? 'Search results' : 'Recent sessions';
|
|
112
|
-
});
|
|
113
103
|
if (!createOptions().loaded) retryOptions();
|
|
114
104
|
}
|
|
115
105
|
host.classList.add('visible', 'project-start-visible');
|
|
116
106
|
// A closed pane may leave the split canvas geometry on the shared host.
|
|
117
|
-
//
|
|
107
|
+
// Project home uses normal flow and preserves the retained pane children.
|
|
118
108
|
host.classList.remove('split-view-canvas', 'split-view-preview-only');
|
|
119
109
|
delete host.dataset.positioned;
|
|
120
110
|
delete host.dataset.singlePane;
|
|
@@ -143,7 +133,7 @@ store.subscribe(function (state, previous) {
|
|
|
143
133
|
root.hidden = !!state.projectStartPicker.dismissed;
|
|
144
134
|
if (state.projectStartPicker !== previous.projectStartPicker || state.paneBindingSessions !== previous.paneBindingSessions ||
|
|
145
135
|
state.sessionCreateOptions !== previous.sessionCreateOptions || state.connected !== previous.connected) {
|
|
146
|
-
|
|
136
|
+
renderProjectHome(root, state.projectStartPicker);
|
|
147
137
|
}
|
|
148
138
|
});
|
|
149
139
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { store } from './store.js';
|
|
2
|
+
import { pickerCandidates } from './split-view-picker-render.js';
|
|
3
|
+
import { createOptions } from './session-create.js';
|
|
4
|
+
import { sortVendorEntries } from './vendor-priority.js';
|
|
5
|
+
import { VENDOR_NAMES, VENDOR_AVATARS } from './chat-render-runtime.js';
|
|
6
|
+
import { iconHtml, refreshIcons } from './icons.js';
|
|
7
|
+
|
|
8
|
+
function element(tag, className, text) {
|
|
9
|
+
var node = document.createElement(tag); node.className = className;
|
|
10
|
+
if (text) node.textContent = text;
|
|
11
|
+
return node;
|
|
12
|
+
}
|
|
13
|
+
function button(label, key, value) {
|
|
14
|
+
var node = element('button', '', label); node.type = 'button';
|
|
15
|
+
node.dataset[key] = value || 'true'; return node;
|
|
16
|
+
}
|
|
17
|
+
function relativeTime(time) {
|
|
18
|
+
if (!time) return '';
|
|
19
|
+
var minutes = Math.max(0, Math.floor((Date.now() - time) / 60000));
|
|
20
|
+
return minutes < 1 ? 'Just now' : minutes < 60 ? minutes + 'm ago' : minutes < 1440 ? Math.floor(minutes / 60) + 'h ago' : Math.floor(minutes / 1440) + 'd ago';
|
|
21
|
+
}
|
|
22
|
+
function detail(session) {
|
|
23
|
+
var vendor = VENDOR_NAMES[session.vendor] || session.vendor || 'Session';
|
|
24
|
+
var links = (session.linearLinks || []).concat(session.githubLinks || []);
|
|
25
|
+
var linked = links.find(function (link) { return link.title; });
|
|
26
|
+
var activity = session.isProcessing ? 'Working now' : session.backgroundTaskCount > 0 ? 'Background work running' : 'Open conversation';
|
|
27
|
+
return vendor + ' · ' + (linked ? linked.title : activity);
|
|
28
|
+
}
|
|
29
|
+
export function renderProjectHome(root, state) {
|
|
30
|
+
var focused = root.contains(document.activeElement) ? document.activeElement : null;
|
|
31
|
+
var focusKey = focused && ['splitSession', 'splitVendor', 'splitRetry'].find(function (key) { return focused.dataset[key]; });
|
|
32
|
+
var focusValue = focusKey && focused.dataset[focusKey];
|
|
33
|
+
root.replaceChildren();
|
|
34
|
+
var blocked = !!state.pending || !store.get('connected');
|
|
35
|
+
var header = element('div', 'project-home-heading');
|
|
36
|
+
var title = element('h1', '', 'Continue your work'); header.appendChild(title);
|
|
37
|
+
root.appendChild(header);
|
|
38
|
+
var list = element('div', 'project-home-recent'); list.setAttribute('aria-label', 'Recent work');
|
|
39
|
+
pickerCandidates('', true).slice(0, 3).forEach(function (session) {
|
|
40
|
+
var row = button('', 'splitSession', String(session.id)); row.className = 'project-home-row'; row.disabled = blocked;
|
|
41
|
+
row.setAttribute('aria-label', 'Continue ' + (session.title || 'New session'));
|
|
42
|
+
var content = element('span', 'project-home-copy');
|
|
43
|
+
content.appendChild(element('strong', '', session.title || 'New session'));
|
|
44
|
+
content.appendChild(element('span', 'project-home-detail', detail(session))); row.appendChild(content);
|
|
45
|
+
var trailing = element('span', 'project-home-trailing');
|
|
46
|
+
trailing.appendChild(element('small', '', relativeTime(session.lastActivity || session.createdAt)));
|
|
47
|
+
var arrow = element('span', 'project-home-arrow'); arrow.innerHTML = iconHtml('arrow-right'); trailing.appendChild(arrow); row.appendChild(trailing);
|
|
48
|
+
list.appendChild(row);
|
|
49
|
+
});
|
|
50
|
+
if (!list.children.length) list.appendChild(element('p', 'project-home-empty', 'A fresh start. Create a session to begin working here.'));
|
|
51
|
+
root.appendChild(list);
|
|
52
|
+
root.appendChild(element('h2', 'project-home-create-label', 'New session'));
|
|
53
|
+
var vendors = element('div', 'project-home-vendors'); vendors.id = 'project-home-vendors';
|
|
54
|
+
vendors.setAttribute('role', 'group');
|
|
55
|
+
vendors.setAttribute('aria-label', 'New session');
|
|
56
|
+
var options = createOptions(), installed = sortVendorEntries(options.vendors.filter(function (vendor) { return vendor.installed; }));
|
|
57
|
+
installed.forEach(function (vendor) {
|
|
58
|
+
var label = VENDOR_NAMES[vendor.id] || vendor.displayName || vendor.id;
|
|
59
|
+
var choice = button('', 'splitVendor', vendor.id); choice.disabled = blocked;
|
|
60
|
+
choice.setAttribute('aria-label', 'New ' + label + ' session');
|
|
61
|
+
choice.dataset.tip = 'New ' + label + ' session';
|
|
62
|
+
var image = document.createElement('img'); image.src = VENDOR_AVATARS[vendor.id] || '/icon-192.png'; image.alt = '';
|
|
63
|
+
choice.appendChild(image); vendors.appendChild(choice);
|
|
64
|
+
});
|
|
65
|
+
if (options.error || !installed.length) {
|
|
66
|
+
vendors.appendChild(element('p', '', options.error || (options.loaded ? 'No installed providers available.' : 'Loading providers…')));
|
|
67
|
+
if (options.error) vendors.appendChild(button('Retry', 'splitRetry'));
|
|
68
|
+
}
|
|
69
|
+
root.appendChild(vendors);
|
|
70
|
+
|
|
71
|
+
var status = element('p', 'project-home-status', state.pending ? 'Creating session…' : state.error || (!store.get('connected') ? 'Reconnecting…' : ''));
|
|
72
|
+
status.setAttribute('role', 'status'); root.appendChild(status);
|
|
73
|
+
if (focusKey) {
|
|
74
|
+
var restored = Array.from(root.querySelectorAll('button')).find(function (node) { return node.dataset[focusKey] === focusValue && !node.disabled; });
|
|
75
|
+
if (restored) restored.focus({ preventScroll: true });
|
|
76
|
+
}
|
|
77
|
+
refreshIcons();
|
|
78
|
+
}
|