@ibgib/space-gib 0.0.33 → 0.0.34
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/client/bootstrap.mjs +24 -51
- package/dist/client/chunk-25PXC4HP.mjs +9914 -0
- package/dist/client/chunk-RXWLL2AI.mjs +30 -0
- package/dist/client/css/activity-bar.css +417 -0
- package/dist/client/css/base.css +167 -0
- package/dist/client/css/components.css +218 -0
- package/dist/client/css/cosmic.css +557 -0
- package/dist/client/css/dev-tools.css +163 -0
- package/dist/client/css/landing.css +184 -0
- package/dist/client/css/layout.css +896 -0
- package/dist/client/css/onboarding.css +181 -0
- package/dist/client/css/repos.css +740 -0
- package/dist/client/css/variables.css +64 -0
- package/dist/client/index.html +202 -31
- package/dist/client/index.mjs +32 -32
- package/dist/client/script.mjs +1 -1
- package/dist/client/style.css +11 -1056
- package/dist/respec-gib.node.mjs +5 -0
- package/dist/server/server.mjs +6879 -3109
- package/package.json +6 -6
- package/src/client/AUTO-GENERATED-version.mts +1 -1
- package/src/client/cosmos/seed-cosmos-workspace.mts +69 -0
- package/src/client/css/activity-bar.css +417 -0
- package/src/client/css/base.css +167 -0
- package/src/client/css/components.css +218 -0
- package/src/client/css/cosmic.css +557 -0
- package/src/client/css/dev-tools.css +163 -0
- package/src/client/css/landing.css +184 -0
- package/src/client/css/layout.css +896 -0
- package/src/client/css/onboarding.css +181 -0
- package/src/client/css/repos.css +740 -0
- package/src/client/css/variables.css +64 -0
- package/src/client/dev-tools/vcs-workspace.mts +3 -3
- package/src/client/index.html +202 -31
- package/src/client/style.css +11 -1056
- package/src/client/ui/component/chat-view/IMPLEMENTATION.md +48 -0
- package/src/client/ui/component/chat-view/chat-view.css +381 -0
- package/src/client/ui/component/chat-view/chat-view.html +104 -0
- package/src/client/ui/component/chat-view/chat-view.mts +277 -0
- package/src/client/ui/component/chat-view/index.mts +9 -0
- package/src/client/ui/component/clone/IMPLEMENTATION.md +68 -0
- package/src/client/ui/component/clone/clone-constants.mts +16 -0
- package/src/client/ui/component/clone/clone-types.mts +60 -0
- package/src/client/ui/component/clone/clone.css +383 -0
- package/src/client/ui/component/clone/clone.html +89 -0
- package/src/client/ui/component/clone/clone.mts +620 -0
- package/src/client/ui/component/clone/index.mts +11 -0
- package/src/client/ui/component/code-editor/IMPLEMENTATION.md +89 -0
- package/src/client/ui/component/code-editor/code-editor.css +275 -0
- package/src/client/ui/component/code-editor/code-editor.html +54 -0
- package/src/client/ui/component/code-editor/code-editor.mts +427 -0
- package/src/client/ui/component/code-editor/index.mts +9 -0
- package/src/client/ui/component/cosmos-navigator/IMPLEMENTATION.md +31 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.css +864 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.html +97 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.mts +1084 -0
- package/src/client/ui/component/cosmos-navigator/index.mts +18 -0
- package/src/client/ui/component/file-explorer/IMPLEMENTATION.md +42 -0
- package/src/client/ui/component/file-explorer/file-explorer.css +256 -0
- package/src/client/ui/component/file-explorer/file-explorer.html +75 -0
- package/src/client/ui/component/file-explorer/file-explorer.mts +346 -0
- package/src/client/ui/component/file-explorer/index.mts +9 -0
- package/src/client/ui/component/nested-chat/IMPLEMENTATION.md +18 -0
- package/src/client/ui/component/nested-chat/chat/IMPLEMENTATION.md +14 -0
- package/src/client/ui/component/nested-chat/chat/chat-constants.mts +14 -0
- package/src/client/ui/component/nested-chat/chat/chat-helpers.mts +66 -0
- package/src/client/ui/component/nested-chat/chat/chat.css +654 -0
- package/src/client/ui/component/nested-chat/chat/chat.html +90 -0
- package/src/client/ui/component/nested-chat/chat/chat.mts +646 -0
- package/src/client/ui/component/nested-chat/chat/index.mts +7 -0
- package/src/client/ui/component/nested-chat/index.mts +14 -0
- package/src/client/ui/component/nested-chat/nested-chat-constants.mts +12 -0
- package/src/client/ui/component/nested-chat/nested-chat-types.mts +53 -0
- package/src/client/ui/component/nested-chat/nested-chat.css +142 -0
- package/src/client/ui/component/nested-chat/nested-chat.html +11 -0
- package/src/client/ui/component/nested-chat/nested-chat.mts +393 -0
- package/src/client/ui/component/notes-explorer/index.mts +9 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.css +313 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.html +136 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.mts +240 -0
- package/src/client/ui/component/notes-inspector/index.mts +9 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.css +244 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.html +97 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.mts +152 -0
- package/src/client/ui/component/pitch/IMPLEMENTATION.md +48 -0
- package/src/client/ui/component/pitch/index.mts +9 -0
- package/src/client/ui/component/pitch/pitch.css +295 -0
- package/src/client/ui/component/pitch/pitch.html +97 -0
- package/src/client/ui/component/pitch/pitch.mts +135 -0
- package/src/client/ui/component/timeline/IMPLEMENTATION.md +33 -0
- package/src/client/ui/component/timeline/index.mts +9 -0
- package/src/client/ui/component/timeline/timeline.css +264 -0
- package/src/client/ui/component/timeline/timeline.html +23 -0
- package/src/client/ui/component/timeline/timeline.mts +317 -0
- package/src/client/ui/component/timeline-item-details/IMPLEMENTATION.md +28 -0
- package/src/client/ui/component/timeline-item-details/index.mts +9 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.css +286 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.html +64 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.mts +194 -0
- package/src/client/ui/router/index.mts +3 -0
- package/src/client/ui/router/space-gib-router-helpers.mts +272 -0
- package/src/client/ui/router/space-gib-router-helpers.respec.mts +353 -0
- package/src/client/ui/router/space-gib-router-service.mts +186 -0
- package/src/client/ui/router/space-gib-router-types.mts +93 -0
- package/src/client/ui/shell/cosmic-big-bang.mts +844 -0
- package/src/client/ui/shell/space-gib-shell-constants.mts +7 -0
- package/src/client/ui/shell/space-gib-shell-service.mts +1728 -31
- package/src/server/server.mts +20 -1
- package/tsconfig.test.json +5 -1
- package/dist/client/chunk-CRJV762I.mjs +0 -3102
- package/dist/client/chunk-LXRCF5OS.mjs +0 -25
- package/dist/client/chunk-UBDQUZZV.mjs +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.timeline-root {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
width: 100%;
|
|
14
|
+
user-select: none;
|
|
15
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Timeline Accordion Header (Matches File Explorer branch-header) */
|
|
22
|
+
.timeline-header {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.35rem;
|
|
26
|
+
padding: 0.4rem 0.6rem;
|
|
27
|
+
background: rgba(255, 255, 255, 0.04);
|
|
28
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
29
|
+
border-radius: 6px;
|
|
30
|
+
font-size: 0.82rem;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
color: #cbd5e1;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: all 0.15s ease;
|
|
35
|
+
outline: none;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.timeline-header:hover {
|
|
41
|
+
background: rgba(255, 255, 255, 0.07);
|
|
42
|
+
border-color: rgba(124, 92, 252, 0.3);
|
|
43
|
+
color: #f1f5f9;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.timeline-header:focus-visible {
|
|
47
|
+
border-color: #a78bfa;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.timeline-toggle-btn {
|
|
51
|
+
background: transparent;
|
|
52
|
+
border: none;
|
|
53
|
+
color: inherit;
|
|
54
|
+
font-size: 0.65rem;
|
|
55
|
+
padding: 0;
|
|
56
|
+
margin: 0;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 14px;
|
|
62
|
+
height: 14px;
|
|
63
|
+
line-height: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chevron-icon {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
transition: transform 0.15s ease;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.timeline-header.collapsed .chevron-icon {
|
|
72
|
+
transform: rotate(-90deg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.timeline-icon {
|
|
76
|
+
font-size: 0.9rem;
|
|
77
|
+
line-height: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.timeline-branch-title {
|
|
81
|
+
flex: 1;
|
|
82
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
|
|
83
|
+
font-size: 0.82rem;
|
|
84
|
+
color: #a78bfa;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
text-overflow: ellipsis;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Badge styled like file explorer's worktree-badge */
|
|
92
|
+
.timeline-badge {
|
|
93
|
+
font-size: 0.58rem;
|
|
94
|
+
text-transform: uppercase;
|
|
95
|
+
letter-spacing: 0.04em;
|
|
96
|
+
background: rgba(124, 92, 252, 0.18);
|
|
97
|
+
border: 1px solid rgba(124, 92, 252, 0.35);
|
|
98
|
+
color: #c4b5fd;
|
|
99
|
+
padding: 1px 5px;
|
|
100
|
+
border-radius: 4px;
|
|
101
|
+
font-weight: 700;
|
|
102
|
+
margin-right: 0.3rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.timeline-actions {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: 0.2rem;
|
|
109
|
+
opacity: 0.6;
|
|
110
|
+
transition: opacity 0.15s ease;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.timeline-header:hover .timeline-actions {
|
|
114
|
+
opacity: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.action-btn {
|
|
118
|
+
background: transparent;
|
|
119
|
+
border: none;
|
|
120
|
+
color: #cbd5e1;
|
|
121
|
+
font-size: 0.72rem;
|
|
122
|
+
padding: 2px 4px;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
line-height: 1;
|
|
126
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.action-btn:hover {
|
|
130
|
+
background: rgba(255, 255, 255, 0.1);
|
|
131
|
+
color: #fff;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Stream Container */
|
|
135
|
+
.timeline-stream-container {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
position: relative;
|
|
139
|
+
padding: 0.35rem 0.2rem 0.5rem 0.8rem;
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.timeline-stream-container.hidden {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.timeline-rail {
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: 0.7rem;
|
|
150
|
+
bottom: 0.7rem;
|
|
151
|
+
left: 1.15rem;
|
|
152
|
+
width: 2px;
|
|
153
|
+
background: rgba(124, 92, 252, 0.25);
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.timeline-list {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
gap: 0.25rem;
|
|
161
|
+
position: relative;
|
|
162
|
+
z-index: 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Snapshot Item */
|
|
166
|
+
.timeline-item {
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: flex-start;
|
|
169
|
+
gap: 0.55rem;
|
|
170
|
+
padding: 0.35rem 0.5rem;
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
transition: background 0.12s ease, transform 0.1s ease;
|
|
174
|
+
position: relative;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.timeline-item:hover {
|
|
178
|
+
background: rgba(255, 255, 255, 0.05);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.timeline-item.selected {
|
|
182
|
+
background: rgba(124, 92, 252, 0.15);
|
|
183
|
+
border-left: 2px solid #a78bfa;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.timeline-node-dot {
|
|
187
|
+
width: 9px;
|
|
188
|
+
height: 9px;
|
|
189
|
+
border-radius: 50%;
|
|
190
|
+
background: #334155;
|
|
191
|
+
border: 2px solid #64748b;
|
|
192
|
+
margin-top: 4px;
|
|
193
|
+
flex-shrink: 0;
|
|
194
|
+
transition: all 0.15s ease;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.timeline-item.is-tip .timeline-node-dot {
|
|
198
|
+
background: #38bdf8;
|
|
199
|
+
border-color: #0ea5e9;
|
|
200
|
+
box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.timeline-item:hover .timeline-node-dot {
|
|
204
|
+
transform: scale(1.25);
|
|
205
|
+
border-color: #a78bfa;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.timeline-item-content {
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
gap: 2px;
|
|
212
|
+
flex: 1;
|
|
213
|
+
min-width: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.timeline-item-header {
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
gap: 0.35rem;
|
|
220
|
+
min-width: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.timeline-hash-badge {
|
|
224
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
|
|
225
|
+
font-size: 0.68rem;
|
|
226
|
+
font-weight: 700;
|
|
227
|
+
color: #38bdf8;
|
|
228
|
+
background: rgba(56, 189, 248, 0.12);
|
|
229
|
+
padding: 1px 4px;
|
|
230
|
+
border-radius: 3px;
|
|
231
|
+
line-height: 1;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.timeline-tip-badge {
|
|
235
|
+
font-size: 0.55rem;
|
|
236
|
+
font-weight: 700;
|
|
237
|
+
text-transform: uppercase;
|
|
238
|
+
color: #0ea5e9;
|
|
239
|
+
background: rgba(14, 165, 233, 0.18);
|
|
240
|
+
border: 1px solid rgba(14, 165, 233, 0.4);
|
|
241
|
+
padding: 1px 4px;
|
|
242
|
+
border-radius: 3px;
|
|
243
|
+
line-height: 1;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.timeline-item-time {
|
|
247
|
+
font-size: 0.65rem;
|
|
248
|
+
color: #64748b;
|
|
249
|
+
margin-left: auto;
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.timeline-item-msg {
|
|
254
|
+
font-size: 0.74rem;
|
|
255
|
+
color: #cbd5e1;
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
text-overflow: ellipsis;
|
|
259
|
+
line-height: 1.25;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.timeline-item:hover .timeline-item-msg {
|
|
263
|
+
color: #f1f5f9;
|
|
264
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div id="timeline-root" class="timeline-root">
|
|
2
|
+
<!-- Worktree Timeline Accordion Header -->
|
|
3
|
+
<div id="timeline-header" class="timeline-header expanded" tabindex="0">
|
|
4
|
+
<button id="btn-timeline-toggle" class="timeline-toggle-btn" type="button" aria-label="Toggle Timeline Snapshots">
|
|
5
|
+
<span class="chevron-icon">▼</span>
|
|
6
|
+
</button>
|
|
7
|
+
<span class="timeline-icon">⏳</span>
|
|
8
|
+
<span id="timeline-branch-title" class="timeline-branch-title">main</span>
|
|
9
|
+
<!-- <span class="timeline-badge">timeline</span> -->
|
|
10
|
+
<div class="timeline-actions">
|
|
11
|
+
<button id="btn-timeline-refresh" class="action-btn" type="button" title="Refresh Timeline">⟳</button>
|
|
12
|
+
<button id="btn-timeline-collapse" class="action-btn" type="button" title="Toggle Collapse">⇱</button>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!-- Timeline Snapshots Stream Container -->
|
|
17
|
+
<div id="timeline-stream-container" class="timeline-stream-container">
|
|
18
|
+
<div class="timeline-rail"></div>
|
|
19
|
+
<div id="timeline-list" class="timeline-list">
|
|
20
|
+
<!-- Injected snapshot items -->
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import thisCss from "./timeline.css";
|
|
2
|
+
import thisHtml from "./timeline.html";
|
|
3
|
+
|
|
4
|
+
import { ROOT_ADDR } from "@ibgib/ts-gib/dist/V1/constants.mjs";
|
|
5
|
+
import { IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs";
|
|
6
|
+
import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs";
|
|
7
|
+
import { extractErrorMsg } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
|
|
8
|
+
import {
|
|
9
|
+
IbGibDynamicComponentMetaBase, IbGibDynamicComponentInstanceBase,
|
|
10
|
+
} from "@ibgib/web-gib/dist/ui/component/ibgib-dynamic-component-bases.mjs";
|
|
11
|
+
import {
|
|
12
|
+
ElementsBase, IbGibDynamicComponentInstance,
|
|
13
|
+
} from "@ibgib/web-gib/dist/ui/component/component-types.mjs";
|
|
14
|
+
import { getComponentCtorArg } from "@ibgib/web-gib/dist/app-bootstrap/init-orchestration.mjs";
|
|
15
|
+
|
|
16
|
+
export const TIMELINE_COMPONENT_NAME = 'space-gib-timeline';
|
|
17
|
+
|
|
18
|
+
export interface TimelineItem {
|
|
19
|
+
hash: string;
|
|
20
|
+
shortHash: string;
|
|
21
|
+
message: string;
|
|
22
|
+
author: string;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
isTip?: boolean;
|
|
25
|
+
branch: string;
|
|
26
|
+
parentHash?: string;
|
|
27
|
+
changedFiles?: { path: string; status: 'M' | 'A' | 'D'; additions: number; deletions: number }[];
|
|
28
|
+
diffPreview?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Metadata factory for space-gib-timeline Web Component.
|
|
33
|
+
*/
|
|
34
|
+
export class TimelineComponentMeta extends IbGibDynamicComponentMetaBase {
|
|
35
|
+
protected lc: string = `[${TimelineComponentMeta.name}]`;
|
|
36
|
+
|
|
37
|
+
routeRegExp?: RegExp = new RegExp(`^${TIMELINE_COMPONENT_NAME}$`);
|
|
38
|
+
componentName = TIMELINE_COMPONENT_NAME;
|
|
39
|
+
|
|
40
|
+
constructor() {
|
|
41
|
+
super(getComponentCtorArg());
|
|
42
|
+
if (!customElements.get(this.componentName)) {
|
|
43
|
+
customElements.define(this.componentName, TimelineComponentInstance);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async createInstance({
|
|
48
|
+
path,
|
|
49
|
+
ibGibAddr
|
|
50
|
+
}: {
|
|
51
|
+
path: string;
|
|
52
|
+
ibGibAddr: IbGibAddr;
|
|
53
|
+
}): Promise<IbGibDynamicComponentInstance> {
|
|
54
|
+
const component = document.createElement(this.componentName) as TimelineComponentInstance;
|
|
55
|
+
await component.initialize({
|
|
56
|
+
ibGibAddr: ibGibAddr || ROOT_ADDR,
|
|
57
|
+
meta: this,
|
|
58
|
+
html: thisHtml,
|
|
59
|
+
css: [thisCss],
|
|
60
|
+
});
|
|
61
|
+
return component;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* References to DOM elements within the component's Shadow Root.
|
|
67
|
+
*/
|
|
68
|
+
export interface TimelineElements extends ElementsBase {
|
|
69
|
+
rootEl: HTMLDivElement;
|
|
70
|
+
timelineHeaderEl: HTMLDivElement;
|
|
71
|
+
btnTimelineToggleEl: HTMLButtonElement;
|
|
72
|
+
timelineBranchTitleEl: HTMLSpanElement;
|
|
73
|
+
timelineStreamContainerEl: HTMLDivElement;
|
|
74
|
+
timelineListEl: HTMLDivElement;
|
|
75
|
+
btnTimelineRefreshEl: HTMLButtonElement;
|
|
76
|
+
btnTimelineCollapseEl: HTMLButtonElement;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Concrete implementation of the Branch Timeline accordion component.
|
|
81
|
+
*/
|
|
82
|
+
export class TimelineComponentInstance
|
|
83
|
+
extends IbGibDynamicComponentInstanceBase<IbGib_V1, TimelineElements>
|
|
84
|
+
implements IbGibDynamicComponentInstance<IbGib_V1, TimelineElements> {
|
|
85
|
+
|
|
86
|
+
protected lc: string = `[${TimelineComponentInstance.name}]`;
|
|
87
|
+
|
|
88
|
+
private branchName: string = 'main';
|
|
89
|
+
private isTimelineExpanded: boolean = true;
|
|
90
|
+
private selectedHash: string = '3e8f1c2';
|
|
91
|
+
|
|
92
|
+
private snapshots: TimelineItem[] = [
|
|
93
|
+
{
|
|
94
|
+
hash: '3e8f1c2a05d8f99e32b4f17c802e3b4a',
|
|
95
|
+
shortHash: '3e8f1c2',
|
|
96
|
+
message: 'feat: implement cosmos navigation and orbital drift',
|
|
97
|
+
author: 'Bill Raiford <bill@ibgib.space>',
|
|
98
|
+
timestamp: '2m ago',
|
|
99
|
+
isTip: true,
|
|
100
|
+
branch: 'main',
|
|
101
|
+
parentHash: 'a7b4d90',
|
|
102
|
+
changedFiles: [
|
|
103
|
+
{ path: 'src/client/ui/component/cosmos-navigator/cosmos-navigator.mts', status: 'M', additions: 18, deletions: 4 },
|
|
104
|
+
{ path: 'src/client/ui/shell/space-gib-shell-service.mts', status: 'M', additions: 32, deletions: 6 },
|
|
105
|
+
{ path: 'src/client/css/layout.css', status: 'M', additions: 14, deletions: 2 },
|
|
106
|
+
],
|
|
107
|
+
diffPreview: `@@ -848,6 +848,20 @@
|
|
108
|
+
- this.launchProjectile({ ... });
|
|
109
|
+
+ // Make activity bar visible BEFORE zoom flight starts
|
|
110
|
+
+ window.dispatchEvent(new CustomEvent('space-gib-activity-bar-expand-requested'));
|
|
111
|
+
+ setTimeout(() => {
|
|
112
|
+
+ this.launchProjectile({ ... });
|
|
113
|
+
+ }, 180);`
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
hash: 'a7b4d9089f21c4320b9e8471da329188',
|
|
117
|
+
shortHash: 'a7b4d90',
|
|
118
|
+
message: 'style: polish firecracker big bang compression',
|
|
119
|
+
author: 'Bill Raiford <bill@ibgib.space>',
|
|
120
|
+
timestamp: '1h ago',
|
|
121
|
+
branch: 'main',
|
|
122
|
+
parentHash: 'f2098b1',
|
|
123
|
+
changedFiles: [
|
|
124
|
+
{ path: 'src/client/ui/component/cosmos-navigator/cosmos-navigator.css', status: 'M', additions: 24, deletions: 11 },
|
|
125
|
+
{ path: 'src/client/ui/component/cosmos-navigator/cosmos-navigator.mts', status: 'M', additions: 12, deletions: 5 },
|
|
126
|
+
],
|
|
127
|
+
diffPreview: `@@ -430,8 +430,12 @@
|
|
128
|
+
- btn.classList.add('compressing');
|
|
129
|
+
+ // Firecracker high velocity rotation
|
|
130
|
+
+ btn.classList.add('compressing');
|
|
131
|
+
+ this.triggerBigBangExplosion();`
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
hash: 'f2098b191c4998721fae390c91834789',
|
|
135
|
+
shortHash: 'f2098b1',
|
|
136
|
+
message: 'refactor: decouple activity bar and cosmos controls',
|
|
137
|
+
author: 'Bill Raiford <bill@ibgib.space>',
|
|
138
|
+
timestamp: 'yesterday',
|
|
139
|
+
branch: 'main',
|
|
140
|
+
parentHash: 'c019a4e',
|
|
141
|
+
changedFiles: [
|
|
142
|
+
{ path: 'src/client/ui/shell/cosmic-big-bang.mts', status: 'M', additions: 40, deletions: 52 },
|
|
143
|
+
{ path: 'src/client/ui/shell/space-gib-shell-service.mts', status: 'M', additions: 75, deletions: 18 },
|
|
144
|
+
],
|
|
145
|
+
diffPreview: `@@ -120,7 +120,7 @@
|
|
146
|
+
- public toggleActivityBar(): void {
|
|
147
|
+
+ public expandActivityBar(): void {`
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
hash: 'c019a4ee899201bdcf88132582910fa2',
|
|
151
|
+
shortHash: 'c019a4e',
|
|
152
|
+
message: 'feat: primordial singularity and big bang stage',
|
|
153
|
+
author: 'Bill Raiford <bill@ibgib.space>',
|
|
154
|
+
timestamp: '3d ago',
|
|
155
|
+
branch: 'main',
|
|
156
|
+
parentHash: '0000000',
|
|
157
|
+
changedFiles: [
|
|
158
|
+
{ path: 'src/client/ui/component/cosmos-navigator/cosmos-navigator.mts', status: 'A', additions: 450, deletions: 0 },
|
|
159
|
+
{ path: 'src/client/ui/component/cosmos-navigator/cosmos-navigator.html', status: 'A', additions: 95, deletions: 0 },
|
|
160
|
+
],
|
|
161
|
+
diffPreview: `@@ -0,0 +1,95 @@
|
|
162
|
+
+<div id="cosmos-nav-root" class="cosmos-nav-root">
|
|
163
|
+
+ <canvas id="bg-canvas"></canvas>
|
|
164
|
+
+</div>`
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
hash: '00000000000000000000000000000000',
|
|
168
|
+
shortHash: '0000000',
|
|
169
|
+
message: 'Initial commit (empty space genesis)',
|
|
170
|
+
author: 'Bill Raiford <bill@ibgib.space>',
|
|
171
|
+
timestamp: '5d ago',
|
|
172
|
+
branch: 'main',
|
|
173
|
+
changedFiles: [
|
|
174
|
+
{ path: 'package.json', status: 'A', additions: 35, deletions: 0 },
|
|
175
|
+
{ path: 'README.md', status: 'A', additions: 20, deletions: 0 },
|
|
176
|
+
],
|
|
177
|
+
diffPreview: `@@ -0,0 +1,20 @@
|
|
178
|
+
+# space-gib
|
|
179
|
+
+Decentralized VCS and superspaces.`
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
get el(): TimelineElements {
|
|
184
|
+
if (!this.elements) {
|
|
185
|
+
throw new Error(`elements is not defined in ${this.lc}`);
|
|
186
|
+
}
|
|
187
|
+
return this.elements;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
override async created(): Promise<void> {
|
|
191
|
+
const lc = `${this.lc}[${this.created.name}]`;
|
|
192
|
+
try {
|
|
193
|
+
const shadow = this.shadowRoot!;
|
|
194
|
+
this.elements = {
|
|
195
|
+
rootEl: shadow.getElementById('timeline-root') as HTMLDivElement,
|
|
196
|
+
timelineHeaderEl: shadow.getElementById('timeline-header') as HTMLDivElement,
|
|
197
|
+
btnTimelineToggleEl: shadow.getElementById('btn-timeline-toggle') as HTMLButtonElement,
|
|
198
|
+
timelineBranchTitleEl: shadow.getElementById('timeline-branch-title') as HTMLSpanElement,
|
|
199
|
+
timelineStreamContainerEl: shadow.getElementById('timeline-stream-container') as HTMLDivElement,
|
|
200
|
+
timelineListEl: shadow.getElementById('timeline-list') as HTMLDivElement,
|
|
201
|
+
btnTimelineRefreshEl: shadow.getElementById('btn-timeline-refresh') as HTMLButtonElement,
|
|
202
|
+
btnTimelineCollapseEl: shadow.getElementById('btn-timeline-collapse') as HTMLButtonElement,
|
|
203
|
+
contentEl: shadow.getElementById('timeline-root') as HTMLDivElement,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
this.bindHandlers();
|
|
207
|
+
this.renderSnapshots();
|
|
208
|
+
} catch (error) {
|
|
209
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private bindHandlers(): void {
|
|
214
|
+
this.el.timelineHeaderEl.addEventListener('click', (e) => {
|
|
215
|
+
const target = e.target as HTMLElement;
|
|
216
|
+
if (target.closest('.action-btn')) return;
|
|
217
|
+
this.toggleTimelineAccordion();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
this.el.btnTimelineCollapseEl.addEventListener('click', (e) => {
|
|
221
|
+
e.stopPropagation();
|
|
222
|
+
this.toggleTimelineAccordion();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
this.el.btnTimelineRefreshEl.addEventListener('click', (e) => {
|
|
226
|
+
e.stopPropagation();
|
|
227
|
+
this.renderSnapshots();
|
|
228
|
+
this.dispatchEvent(new CustomEvent('space-gib-timeline-refresh-requested', {
|
|
229
|
+
detail: { branch: this.branchName },
|
|
230
|
+
bubbles: true,
|
|
231
|
+
composed: true,
|
|
232
|
+
}));
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
public renderSnapshots(): void {
|
|
237
|
+
const container = this.el.timelineListEl;
|
|
238
|
+
if (!container) { return; }
|
|
239
|
+
container.innerHTML = '';
|
|
240
|
+
|
|
241
|
+
for (const item of this.snapshots) {
|
|
242
|
+
const row = document.createElement('div');
|
|
243
|
+
row.className = `timeline-item ${item.shortHash === this.selectedHash ? 'selected' : ''} ${item.isTip ? 'is-tip' : ''}`;
|
|
244
|
+
row.setAttribute('data-hash', item.shortHash);
|
|
245
|
+
|
|
246
|
+
row.innerHTML = `
|
|
247
|
+
<div class="timeline-node-dot"></div>
|
|
248
|
+
<div class="timeline-item-content">
|
|
249
|
+
<div class="timeline-item-header">
|
|
250
|
+
<span class="timeline-hash-badge">${item.shortHash}</span>
|
|
251
|
+
${item.isTip ? '<span class="timeline-tip-badge">tip</span>' : ''}
|
|
252
|
+
<span class="timeline-item-time">${item.timestamp}</span>
|
|
253
|
+
</div>
|
|
254
|
+
<span class="timeline-item-msg" title="${item.message}">${item.message}</span>
|
|
255
|
+
</div>
|
|
256
|
+
`;
|
|
257
|
+
|
|
258
|
+
row.addEventListener('click', () => {
|
|
259
|
+
this.selectTimelineItem(item.shortHash);
|
|
260
|
+
this.dispatchEvent(new CustomEvent('space-gib-timeline-item-selected', {
|
|
261
|
+
detail: { item },
|
|
262
|
+
bubbles: true,
|
|
263
|
+
composed: true,
|
|
264
|
+
}));
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
container.appendChild(row);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
public selectTimelineItem(hash: string): void {
|
|
272
|
+
this.selectedHash = hash;
|
|
273
|
+
const shadow = this.shadowRoot;
|
|
274
|
+
if (!shadow) { return; }
|
|
275
|
+
shadow.querySelectorAll('.timeline-item').forEach(el => {
|
|
276
|
+
if (el.getAttribute('data-hash') === hash) {
|
|
277
|
+
el.classList.add('selected');
|
|
278
|
+
} else {
|
|
279
|
+
el.classList.remove('selected');
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
public setBranch(branchName: string): void {
|
|
285
|
+
this.branchName = branchName;
|
|
286
|
+
if (this.el.timelineBranchTitleEl) {
|
|
287
|
+
this.el.timelineBranchTitleEl.textContent = branchName;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public toggleTimelineAccordion(): void {
|
|
292
|
+
this.isTimelineExpanded = !this.isTimelineExpanded;
|
|
293
|
+
const chevron = this.el.timelineHeaderEl.querySelector('.chevron-icon');
|
|
294
|
+
|
|
295
|
+
if (this.isTimelineExpanded) {
|
|
296
|
+
this.el.timelineHeaderEl.classList.remove('collapsed');
|
|
297
|
+
this.el.timelineHeaderEl.classList.add('expanded');
|
|
298
|
+
this.el.timelineStreamContainerEl.classList.remove('hidden');
|
|
299
|
+
if (chevron) { chevron.textContent = '▼'; }
|
|
300
|
+
} else {
|
|
301
|
+
this.el.timelineHeaderEl.classList.remove('expanded');
|
|
302
|
+
this.el.timelineHeaderEl.classList.add('collapsed');
|
|
303
|
+
this.el.timelineStreamContainerEl.classList.add('hidden');
|
|
304
|
+
// if (chevron) chevron.textContent = '▶';
|
|
305
|
+
if (chevron) { chevron.textContent = '▼'; }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
override async disconnected(): Promise<void> {
|
|
310
|
+
const lc = `${this.lc}[${this.disconnected.name}]`;
|
|
311
|
+
try {
|
|
312
|
+
// cleanup if needed
|
|
313
|
+
} catch (error) {
|
|
314
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# space-gib-timeline-item-details Component Implementation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
`space-gib-timeline-item-details` is a rich center-panel inspector view for `space-gib` that renders when a user clicks any snapshot in the branch timeline. It displays commit metadata, changed files, and unified diff preview, along with a back navigation button to return directly to code editing.
|
|
5
|
+
|
|
6
|
+
## Architecture
|
|
7
|
+
- **Web Component Tag**: `<space-gib-timeline-item-details>`
|
|
8
|
+
- **Meta Class**: `TimelineItemDetailsComponentMeta`
|
|
9
|
+
- **Instance Class**: `TimelineItemDetailsComponentInstance`
|
|
10
|
+
- **Base Class**: `IbGibDynamicComponentInstanceBase<IbGib_V1, TimelineItemDetailsElements>`
|
|
11
|
+
- **Backing ibGib Address**: `ROOT_ADDR`
|
|
12
|
+
|
|
13
|
+
## UI Elements
|
|
14
|
+
1. **Top Bar / Navigation**:
|
|
15
|
+
- `← Back to Editor` button
|
|
16
|
+
- Snapshot hash badge
|
|
17
|
+
- Worktree branch title
|
|
18
|
+
2. **Metadata Card**:
|
|
19
|
+
- Snapshot hash (full & short)
|
|
20
|
+
- Commit message header
|
|
21
|
+
- Author, date, and parent snapshot link
|
|
22
|
+
3. **Changed Files Section**:
|
|
23
|
+
- List of files modified/added/deleted with status badges (`M`, `A`, `D`) and additions/deletions counts.
|
|
24
|
+
4. **Diff Viewer**:
|
|
25
|
+
- Monospace unified diff view with syntax styling for added (`+`) and removed (`-`) lines.
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
- Dispatches `space-gib-timeline-details-closed`: Emitted when the user clicks the back button to return to code view.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getComponentSvc } from "@ibgib/web-gib/dist/ui/component/ibgib-component-service.mjs";
|
|
2
|
+
import { TimelineItemDetailsComponentMeta, TIMELINE_ITEM_DETAILS_COMPONENT_NAME } from "./timeline-item-details.mjs";
|
|
3
|
+
|
|
4
|
+
export * from "./timeline-item-details.mjs";
|
|
5
|
+
|
|
6
|
+
export async function registerTimelineItemDetailsComponent(): Promise<void> {
|
|
7
|
+
const componentSvc = await getComponentSvc();
|
|
8
|
+
componentSvc.registerComponentMeta(new TimelineItemDetailsComponentMeta());
|
|
9
|
+
}
|