dsh-github-flow 0.1.0 → 0.1.3

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/client.js CHANGED
@@ -6,6 +6,12 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  var React = require("react");
8
8
  var GITHUB_PANEL_CSS = `
9
+ /* ==========================================================================
10
+ DSH GitHub Flow - 主题自适应样式系统 (Light / Dark 动态联动)
11
+ 遵循 DSH 原生 DSW (DeepSeek Web) 设计语言规范
12
+ ========================================================================== */
13
+
14
+ /* 1. 侧边栏图标与外壳 */
9
15
  .dsh-github-icon {
10
16
  display: flex;
11
17
  align-items: center;
@@ -13,52 +19,101 @@ window.__ModuleLoader__.load({
13
19
  width: 100%;
14
20
  height: 100%;
15
21
  cursor: pointer;
16
- color: var(--dsw-alias-label-secondary, #8c8c8c);
22
+ color: var(--dsw-alias-label-secondary, #656d76);
17
23
  transition: color 0.15s ease;
18
24
  }
19
25
  .dsh-github-icon:hover {
26
+ color: var(--dsw-alias-label-primary, #1f2328);
27
+ }
28
+ .dsh-github-icon-inner {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ width: 28px;
33
+ height: 28px;
34
+ border-radius: 7px;
35
+ background: transparent;
36
+ color: inherit;
37
+ border: 1px solid transparent;
38
+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
39
+ }
40
+ .dsh-github-icon-inner.active {
41
+ background: var(--dsw-alias-bg-module-platform, rgba(9, 105, 218, 0.08));
42
+ color: var(--dsw-alias-link, #0969da);
43
+ border-color: var(--dsw-alias-border-l2, rgba(9, 105, 218, 0.2));
44
+ }
45
+
46
+ body[data-ds-dark-theme] .dsh-github-icon {
47
+ color: var(--dsw-alias-label-secondary, #9ca3af);
48
+ }
49
+ body[data-ds-dark-theme] .dsh-github-icon:hover {
20
50
  color: var(--dsw-alias-label-primary, #ffffff);
21
51
  }
22
- .dsh-github-icon svg {
23
- width: 18px;
24
- height: 18px;
25
- fill: currentColor;
52
+ body[data-ds-dark-theme] .dsh-github-icon-inner.active {
53
+ background: linear-gradient(135deg, rgba(46, 160, 67, 0.3) 0%, rgba(31, 111, 235, 0.45) 100%);
54
+ color: #ffffff;
55
+ box-shadow: 0 0 12px rgba(31, 111, 235, 0.4);
56
+ border-color: rgba(88, 166, 255, 0.45);
26
57
  }
27
58
 
28
- /* 右侧栏专属容器 (Right Sidebar Container) */
29
- .dsh-github-rightbar-container {
59
+ /* 2. Octocat 科技勋章 Badge */
60
+ .dsh-octocat-badge {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ background: linear-gradient(135deg, #1f6feb 0%, #0969da 60%, #8957e5 100%);
65
+ box-shadow: 0 2px 6px rgba(9, 105, 218, 0.25);
66
+ flex-shrink: 0;
67
+ }
68
+ body[data-ds-dark-theme] .dsh-octocat-badge {
69
+ background: linear-gradient(135deg, #2ea043 0%, #1f6feb 60%, #8957e5 100%);
70
+ box-shadow: 0 2px 8px rgba(31, 111, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
71
+ }
72
+
73
+ /* 3. 容器视图(主面板与右侧抽屉栏) */
74
+ .dsh-github-panel {
30
75
  display: flex;
31
76
  flex-direction: column;
32
77
  width: 100%;
33
78
  height: 100%;
34
79
  overflow-y: auto;
35
- padding: 16px 18px;
80
+ padding: 24px 32px;
36
81
  box-sizing: border-box;
37
- background: var(--dsw-alias-bg-primary, #1e1e20);
38
- color: var(--dsw-alias-label-primary, #ececec);
39
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
82
+ background: var(--dsw-alias-bg-base, #ffffff);
83
+ color: var(--dsw-alias-label-primary, #1f2328);
84
+ font-family: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
40
85
  }
41
86
 
42
- /* 顶部与通用面板 */
43
- .dsh-github-panel {
87
+ .dsh-github-rightbar-container {
44
88
  display: flex;
45
89
  flex-direction: column;
46
90
  width: 100%;
47
91
  height: 100%;
48
92
  overflow-y: auto;
49
- padding: 24px 32px;
93
+ padding: 16px 18px;
50
94
  box-sizing: border-box;
51
- background: var(--dsw-alias-bg-primary, #1e1e20);
95
+ background: var(--dsw-alias-bg-base, #ffffff);
96
+ color: var(--dsw-alias-label-primary, #1f2328);
97
+ font-family: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
98
+ }
99
+
100
+ body[data-ds-dark-theme] .dsh-github-panel,
101
+ body[data-ds-dark-theme] .dsh-github-rightbar-container {
102
+ background: var(--dsw-alias-bg-base, #151517);
52
103
  color: var(--dsw-alias-label-primary, #ececec);
53
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
54
104
  }
105
+
106
+ /* 4. 头部区域 */
55
107
  .dsh-github-header {
56
108
  display: flex;
57
109
  align-items: center;
58
110
  justify-content: space-between;
59
111
  margin-bottom: 20px;
60
112
  padding-bottom: 12px;
61
- border-bottom: 1px solid var(--dsw-alias-border-l1, #333336);
113
+ border-bottom: 1px solid var(--dsw-alias-border-l2, #e5e7eb);
114
+ }
115
+ body[data-ds-dark-theme] .dsh-github-header {
116
+ border-bottom-color: var(--dsw-alias-border-l1, #2c2c2e);
62
117
  }
63
118
  .dsh-github-title {
64
119
  display: flex;
@@ -69,38 +124,76 @@ window.__ModuleLoader__.load({
69
124
  margin: 0;
70
125
  font-size: 18px;
71
126
  font-weight: 600;
127
+ color: var(--dsw-alias-label-primary, #1f2328);
128
+ }
129
+ body[data-ds-dark-theme] .dsh-github-title h2 {
130
+ color: var(--dsw-alias-label-primary, #f0f6fc);
72
131
  }
132
+
133
+ /* 5. 刷新按钮 */
73
134
  .dsh-github-refresh-btn {
74
135
  display: inline-flex;
75
136
  align-items: center;
76
137
  gap: 6px;
77
138
  padding: 5px 12px;
78
139
  font-size: 12px;
140
+ font-weight: 500;
79
141
  border-radius: 6px;
80
- border: 1px solid var(--dsw-alias-border-l1, #444);
81
- background: var(--dsw-alias-bg-secondary, #2a2a2e);
82
- color: var(--dsw-alias-label-primary, #fff);
142
+ border: 1px solid var(--dsw-alias-border-l2, #e1e4e8);
143
+ background: var(--dsw-alias-bg-module-platform, #f6f8fa);
144
+ color: var(--dsw-alias-label-primary, #1f2328);
83
145
  cursor: pointer;
84
146
  transition: all 0.15s ease;
85
147
  }
86
- .dsh-github-refresh-btn:hover {
87
- background: var(--dsw-alias-interactive-bg-hover, #333);
148
+ .dsh-github-refresh-btn:hover:not(:disabled) {
149
+ background: var(--dsw-alias-interactive-bg-hover, #ebeef2);
150
+ border-color: var(--dsw-alias-border-l3, #d0d7de);
151
+ }
152
+ .dsh-github-refresh-btn:disabled {
153
+ opacity: 0.6;
154
+ cursor: not-allowed;
155
+ }
156
+ body[data-ds-dark-theme] .dsh-github-refresh-btn {
157
+ border-color: var(--dsw-alias-border-l1, #38383c);
158
+ background: var(--dsw-alias-bg-layer-2, #242528);
159
+ color: var(--dsw-alias-label-primary, #f0f6fc);
160
+ }
161
+ body[data-ds-dark-theme] .dsh-github-refresh-btn:hover:not(:disabled) {
162
+ background: var(--dsw-alias-interactive-bg-hover, #2f3034);
163
+ border-color: rgba(255, 255, 255, 0.25);
88
164
  }
89
165
 
90
- /* 概览卡片区 */
166
+ /* 6. 概览卡片与网格 */
167
+ .dsh-github-overview-cards {
168
+ display: grid;
169
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
170
+ gap: 14px;
171
+ margin-bottom: 20px;
172
+ }
91
173
  .dsh-github-card {
92
174
  padding: 14px 16px;
93
175
  border-radius: 8px;
94
- border: 1px solid var(--dsw-alias-border-l1, #38383c);
95
- background: var(--dsw-alias-bg-secondary, #252528);
96
- margin-bottom: 14px;
176
+ border: 1px solid var(--dsw-alias-border-l2, #e5e7eb);
177
+ background: var(--dsw-alias-bg-layer-1, #fcfcfd);
178
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
179
+ margin-bottom: 12px;
180
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
181
+ }
182
+ body[data-ds-dark-theme] .dsh-github-card {
183
+ border-color: var(--dsw-alias-border-l1, #303034);
184
+ background: var(--dsw-alias-bg-layer-2, #212124);
185
+ box-shadow: none;
97
186
  }
98
187
  .dsh-github-card-title {
99
188
  font-size: 11px;
100
189
  text-transform: uppercase;
101
190
  letter-spacing: 0.5px;
102
- color: var(--dsw-alias-label-tertiary, #888);
191
+ color: var(--dsw-alias-label-tertiary, #656d76);
103
192
  margin-bottom: 6px;
193
+ font-weight: 500;
194
+ }
195
+ body[data-ds-dark-theme] .dsh-github-card-title {
196
+ color: var(--dsw-alias-label-tertiary, #888);
104
197
  }
105
198
  .dsh-github-card-value {
106
199
  font-size: 15px;
@@ -109,19 +202,71 @@ window.__ModuleLoader__.load({
109
202
  align-items: center;
110
203
  flex-wrap: wrap;
111
204
  gap: 8px;
205
+ color: var(--dsw-alias-label-primary, #1f2328);
112
206
  }
207
+ body[data-ds-dark-theme] .dsh-github-card-value {
208
+ color: var(--dsw-alias-label-primary, #f0f6fc);
209
+ }
210
+ .dsh-github-card-desc {
211
+ font-size: 12px;
212
+ color: var(--dsw-alias-label-secondary, #656d76);
213
+ margin-top: 4px;
214
+ line-height: 1.4;
215
+ }
216
+ body[data-ds-dark-theme] .dsh-github-card-desc {
217
+ color: var(--dsw-alias-label-secondary, #bbb);
218
+ }
219
+ .dsh-github-card-subtext {
220
+ font-size: 11px;
221
+ color: var(--dsw-alias-label-tertiary, #8c959f);
222
+ margin-top: 6px;
223
+ }
224
+ body[data-ds-dark-theme] .dsh-github-card-subtext {
225
+ color: var(--dsw-alias-label-tertiary, #888);
226
+ }
227
+
228
+ /* 7. 徽章(Badges) */
113
229
  .dsh-github-badge {
114
- display: inline-block;
230
+ display: inline-flex;
231
+ align-items: center;
115
232
  font-size: 11px;
116
233
  padding: 2px 8px;
117
234
  border-radius: 12px;
118
235
  font-weight: 500;
236
+ line-height: 16px;
237
+ }
238
+ .dsh-badge-green {
239
+ background: rgba(46, 160, 67, 0.12);
240
+ color: #1a7f37;
241
+ border: 1px solid rgba(46, 160, 67, 0.2);
242
+ }
243
+ .dsh-badge-red {
244
+ background: rgba(207, 34, 46, 0.12);
245
+ color: #cf222e;
246
+ border: 1px solid rgba(207, 34, 46, 0.2);
247
+ }
248
+ .dsh-badge-yellow {
249
+ background: rgba(154, 103, 0, 0.12);
250
+ color: #9a6700;
251
+ border: 1px solid rgba(154, 103, 0, 0.2);
252
+ }
253
+ body[data-ds-dark-theme] .dsh-badge-green {
254
+ background: rgba(46, 160, 67, 0.22);
255
+ color: #3fb950;
256
+ border-color: rgba(46, 160, 67, 0.3);
257
+ }
258
+ body[data-ds-dark-theme] .dsh-badge-red {
259
+ background: rgba(248, 81, 73, 0.22);
260
+ color: #f85149;
261
+ border-color: rgba(248, 81, 73, 0.3);
262
+ }
263
+ body[data-ds-dark-theme] .dsh-badge-yellow {
264
+ background: rgba(210, 153, 34, 0.22);
265
+ color: #d29922;
266
+ border-color: rgba(210, 153, 34, 0.3);
119
267
  }
120
- .dsh-badge-green { background: rgba(46, 160, 67, 0.2); color: #3fb950; }
121
- .dsh-badge-red { background: rgba(248, 81, 73, 0.2); color: #f85149; }
122
- .dsh-badge-yellow { background: rgba(210, 153, 34, 0.2); color: #d29922; }
123
268
 
124
- /* 快捷操作网格按钮 */
269
+ /* 8. 快捷操作网格 */
125
270
  .dsh-github-quick-actions {
126
271
  display: grid;
127
272
  grid-template-columns: 1fr 1fr;
@@ -135,21 +280,33 @@ window.__ModuleLoader__.load({
135
280
  gap: 6px;
136
281
  padding: 8px 10px;
137
282
  border-radius: 6px;
138
- border: 1px solid var(--dsw-alias-border-l1, #444);
139
- background: var(--dsw-alias-bg-secondary, #28282b);
140
- color: var(--dsw-alias-label-primary, #fff);
283
+ border: 1px solid var(--dsw-alias-border-l2, #e1e4e8);
284
+ background: var(--dsw-alias-bg-module-platform, #f6f8fa);
285
+ color: var(--dsw-alias-label-primary, #1f2328);
141
286
  font-size: 12px;
287
+ font-weight: 500;
142
288
  cursor: pointer;
143
289
  transition: all 0.15s ease;
144
290
  }
145
291
  .dsh-github-action-btn:hover {
292
+ background: var(--dsw-alias-interactive-bg-hover, #ebeef2);
293
+ border-color: var(--dsw-alias-link, #0969da);
294
+ color: var(--dsw-alias-link, #0969da);
295
+ }
296
+ body[data-ds-dark-theme] .dsh-github-action-btn {
297
+ border-color: var(--dsw-alias-border-l1, #444);
298
+ background: var(--dsw-alias-bg-layer-2, #28282b);
299
+ color: var(--dsw-alias-label-primary, #fff);
300
+ }
301
+ body[data-ds-dark-theme] .dsh-github-action-btn:hover {
146
302
  background: var(--dsw-alias-interactive-bg-hover, #343438);
147
303
  border-color: #58a6ff;
304
+ color: #58a6ff;
148
305
  }
149
306
 
150
- /* 列表条目 */
307
+ /* 9. 模块分区与列表 */
151
308
  .dsh-github-section {
152
- margin-bottom: 18px;
309
+ margin-bottom: 20px;
153
310
  }
154
311
  .dsh-github-section-header {
155
312
  display: flex;
@@ -161,56 +318,134 @@ window.__ModuleLoader__.load({
161
318
  margin: 0;
162
319
  font-size: 13px;
163
320
  font-weight: 600;
321
+ color: var(--dsw-alias-label-secondary, #656d76);
322
+ }
323
+ body[data-ds-dark-theme] .dsh-github-section-header h3 {
164
324
  color: var(--dsw-alias-label-secondary, #ccc);
165
325
  }
166
326
  .dsh-github-list {
167
327
  display: flex;
168
328
  flex-direction: column;
169
- gap: 6px;
329
+ gap: 8px;
170
330
  }
171
331
  .dsh-github-item {
172
332
  display: flex;
173
333
  flex-direction: column;
174
334
  gap: 4px;
175
- padding: 10px 12px;
335
+ padding: 10px 14px;
176
336
  border-radius: 6px;
177
- border: 1px solid var(--dsw-alias-border-l1, #333336);
178
- background: var(--dsw-alias-bg-secondary, #252528);
337
+ border: 1px solid var(--dsw-alias-border-l2, #e5e7eb);
338
+ background: var(--dsw-alias-bg-layer-1, #fcfcfd);
339
+ transition: border-color 0.15s ease, background 0.15s ease;
179
340
  }
180
341
  .dsh-github-item:hover {
342
+ border-color: var(--dsw-alias-border-l3, #d0d7de);
343
+ background: var(--dsw-alias-interactive-bg-hover, #f6f8fa);
344
+ }
345
+ body[data-ds-dark-theme] .dsh-github-item {
346
+ border-color: var(--dsw-alias-border-l1, #333336);
347
+ background: var(--dsw-alias-bg-layer-2, #252528);
348
+ }
349
+ body[data-ds-dark-theme] .dsh-github-item:hover {
181
350
  border-color: var(--dsw-alias-border-l2, #555);
351
+ background: var(--dsw-alias-interactive-bg-hover, #2c2c30);
182
352
  }
183
353
  .dsh-github-item-title {
184
354
  font-size: 13px;
185
355
  font-weight: 500;
186
- color: var(--dsw-alias-label-primary, #fff);
356
+ color: var(--dsw-alias-label-primary, #1f2328);
187
357
  text-decoration: none;
358
+ transition: color 0.15s ease;
188
359
  }
189
360
  .dsh-github-item-title:hover {
361
+ color: var(--dsw-alias-link, #0969da);
190
362
  text-decoration: underline;
191
363
  }
364
+ body[data-ds-dark-theme] .dsh-github-item-title {
365
+ color: var(--dsw-alias-label-primary, #f0f6fc);
366
+ }
367
+ body[data-ds-dark-theme] .dsh-github-item-title:hover {
368
+ color: #58a6ff;
369
+ }
370
+ .dsh-github-item-desc {
371
+ font-size: 12px;
372
+ color: var(--dsw-alias-label-secondary, #656d76);
373
+ line-height: 1.4;
374
+ }
375
+ body[data-ds-dark-theme] .dsh-github-item-desc {
376
+ color: var(--dsw-alias-label-secondary, #bbb);
377
+ }
192
378
  .dsh-github-item-meta {
193
379
  font-size: 11px;
194
- color: var(--dsw-alias-label-secondary, #8c8c8c);
380
+ color: var(--dsw-alias-label-tertiary, #656d76);
195
381
  display: flex;
382
+ align-items: center;
196
383
  flex-wrap: wrap;
197
384
  gap: 8px;
198
385
  }
386
+ body[data-ds-dark-theme] .dsh-github-item-meta {
387
+ color: var(--dsw-alias-label-secondary, #8c8c8c);
388
+ }
389
+
390
+ /* 10. 小按钮样式(在 GitHub 打开等) */
391
+ .dsh-github-btn-sm {
392
+ display: inline-flex;
393
+ align-items: center;
394
+ justify-content: center;
395
+ font-size: 12px;
396
+ font-weight: 500;
397
+ padding: 4px 10px;
398
+ border-radius: 6px;
399
+ border: 1px solid var(--dsw-alias-border-l2, #d0d7de);
400
+ background: var(--dsw-alias-bg-module-platform, #f6f8fa);
401
+ color: var(--dsw-alias-label-primary, #1f2328);
402
+ cursor: pointer;
403
+ text-decoration: none !important;
404
+ transition: all 0.15s ease;
405
+ }
406
+ .dsh-github-btn-sm:hover {
407
+ background: var(--dsw-alias-interactive-bg-hover, #ebeef2);
408
+ border-color: var(--dsw-alias-border-l3, #b0b8c1);
409
+ color: var(--dsw-alias-link, #0969da);
410
+ }
411
+ body[data-ds-dark-theme] .dsh-github-btn-sm {
412
+ border-color: var(--dsw-alias-border-l1, #444);
413
+ background: var(--dsw-alias-bg-layer-2, #26272b);
414
+ color: var(--dsw-alias-label-primary, #f0f6fc);
415
+ }
416
+ body[data-ds-dark-theme] .dsh-github-btn-sm:hover {
417
+ background: var(--dsw-alias-interactive-bg-hover, #33343a);
418
+ border-color: rgba(255, 255, 255, 0.25);
419
+ color: #58a6ff;
420
+ }
421
+
422
+ /* 11. 空状态 */
199
423
  .dsh-github-empty {
200
- padding: 18px;
424
+ padding: 24px;
201
425
  text-align: center;
202
426
  font-size: 12px;
203
- color: var(--dsw-alias-label-tertiary, #666);
204
- border: 1px dashed var(--dsw-alias-border-l1, #333);
205
- border-radius: 6px;
427
+ color: var(--dsw-alias-label-tertiary, #656d76);
428
+ border: 1px dashed var(--dsw-alias-border-l2, #d0d7de);
429
+ border-radius: 8px;
430
+ background: rgba(0, 0, 0, 0.01);
431
+ }
432
+ body[data-ds-dark-theme] .dsh-github-empty {
433
+ color: var(--dsw-alias-label-tertiary, #888);
434
+ border-color: var(--dsw-alias-border-l1, #38383c);
435
+ background: rgba(255, 255, 255, 0.01);
206
436
  }
437
+
438
+ /* 12. Tabs 导航栏 */
207
439
  .dsh-github-tabs {
208
440
  display: flex;
209
441
  gap: 8px;
210
442
  margin-bottom: 18px;
211
- border-bottom: 1px solid var(--dsw-alias-border-l1, #333);
443
+ border-bottom: 1px solid var(--dsw-alias-border-l2, #e5e7eb);
212
444
  padding-bottom: 8px;
213
445
  }
446
+ body[data-ds-dark-theme] .dsh-github-tabs {
447
+ border-bottom-color: var(--dsw-alias-border-l1, #303034);
448
+ }
214
449
  .dsh-github-tab-btn {
215
450
  padding: 6px 14px;
216
451
  border-radius: 6px;
@@ -218,39 +453,120 @@ window.__ModuleLoader__.load({
218
453
  font-weight: 500;
219
454
  border: 0;
220
455
  background: transparent;
221
- color: var(--dsw-alias-label-secondary, #8c8c8c);
456
+ color: var(--dsw-alias-label-secondary, #656d76);
222
457
  cursor: pointer;
223
458
  transition: all 0.15s ease;
224
459
  }
225
460
  .dsh-github-tab-btn:hover {
226
- color: var(--dsw-alias-label-primary, #fff);
227
- background: rgba(255, 255, 255, 0.05);
461
+ color: var(--dsw-alias-label-primary, #1f2328);
462
+ background: var(--dsw-alias-interactive-bg-hover, rgba(0, 0, 0, 0.05));
228
463
  }
229
464
  .dsh-github-tab-btn.active {
230
- color: #58a6ff;
231
- background: rgba(88, 166, 255, 0.12);
465
+ color: var(--dsw-alias-link, #0969da);
466
+ background: rgba(9, 105, 218, 0.1);
232
467
  font-weight: 600;
233
468
  }
469
+ body[data-ds-dark-theme] .dsh-github-tab-btn {
470
+ color: var(--dsw-alias-label-secondary, #8c8c8c);
471
+ }
472
+ body[data-ds-dark-theme] .dsh-github-tab-btn:hover {
473
+ color: var(--dsw-alias-label-primary, #fff);
474
+ background: var(--dsw-alias-interactive-bg-hover, rgba(255, 255, 255, 0.06));
475
+ }
476
+ body[data-ds-dark-theme] .dsh-github-tab-btn.active {
477
+ color: #58a6ff;
478
+ background: rgba(88, 166, 255, 0.15);
479
+ }
480
+
481
+ /* 13. 搜索输入框 */
234
482
  .dsh-github-search-input {
235
483
  width: 100%;
236
484
  max-width: 320px;
237
485
  padding: 6px 12px;
238
486
  font-size: 12px;
239
487
  border-radius: 6px;
240
- border: 1px solid var(--dsw-alias-border-l1, #444);
241
- background: var(--dsw-alias-bg-secondary, #252528);
242
- color: #fff;
488
+ border: 1px solid var(--dsw-alias-border-l2, #d0d7de);
489
+ background: var(--dsw-alias-bg-base, #ffffff);
490
+ color: var(--dsw-alias-label-primary, #1f2328);
243
491
  outline: none;
244
492
  margin-bottom: 14px;
493
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
245
494
  }
246
495
  .dsh-github-search-input:focus {
496
+ border-color: var(--dsw-alias-link, #0969da);
497
+ box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
498
+ }
499
+ body[data-ds-dark-theme] .dsh-github-search-input {
500
+ border-color: var(--dsw-alias-border-l1, #444);
501
+ background: var(--dsw-alias-bg-layer-2, #212124);
502
+ color: var(--dsw-alias-label-primary, #f0f6fc);
503
+ }
504
+ body[data-ds-dark-theme] .dsh-github-search-input:focus {
247
505
  border-color: #58a6ff;
506
+ box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
507
+ }
508
+
509
+ /* 14. 工作区矩阵条目专属类 */
510
+ .dsh-github-workspace-card {
511
+ display: flex;
512
+ align-items: center;
513
+ justify-content: space-between;
514
+ margin-bottom: 8px;
515
+ }
516
+ .dsh-github-ws-title {
517
+ font-size: 14px;
518
+ font-weight: 600;
519
+ color: var(--dsw-alias-label-primary, #1f2328);
520
+ }
521
+ body[data-ds-dark-theme] .dsh-github-ws-title {
522
+ color: var(--dsw-alias-label-primary, #f0f6fc);
523
+ }
524
+ .dsh-github-ws-path {
525
+ font-size: 12px;
526
+ color: var(--dsw-alias-label-tertiary, #656d76);
527
+ font-family: var(--ds-font-family-code, monospace);
528
+ }
529
+ body[data-ds-dark-theme] .dsh-github-ws-path {
530
+ color: var(--dsw-alias-label-tertiary, #888);
531
+ }
532
+ .dsh-github-ws-repo-link {
533
+ color: var(--dsw-alias-link, #0969da);
534
+ display: inline-flex;
535
+ align-items: center;
536
+ gap: 5px;
537
+ font-weight: 500;
538
+ }
539
+ body[data-ds-dark-theme] .dsh-github-ws-repo-link {
540
+ color: #58a6ff;
541
+ }
542
+ .dsh-github-repo-link {
543
+ color: var(--dsw-alias-link, #0969da);
544
+ text-decoration: none;
545
+ font-weight: 600;
546
+ }
547
+ .dsh-github-repo-link:hover {
548
+ text-decoration: underline;
549
+ }
550
+ body[data-ds-dark-theme] .dsh-github-repo-link {
551
+ color: #58a6ff;
552
+ }
553
+ .dsh-github-subheading {
554
+ font-size: 14px;
555
+ font-weight: 600;
556
+ margin: 0 0 10px 0;
557
+ color: var(--dsw-alias-label-primary, #1f2328);
558
+ }
559
+ body[data-ds-dark-theme] .dsh-github-subheading {
560
+ color: var(--dsw-alias-label-primary, #f0f6fc);
248
561
  }
249
562
  `;
250
563
  function injectStyles() {
251
564
  var styleId = "dsh-plugin-github-styles";
252
- if (document.getElementById(styleId))
565
+ var existing = document.getElementById(styleId);
566
+ if (existing) {
567
+ existing.textContent = GITHUB_PANEL_CSS;
253
568
  return () => { };
569
+ }
254
570
  var style = document.createElement("style");
255
571
  style.id = styleId;
256
572
  style.textContent = GITHUB_PANEL_CSS;
@@ -271,19 +587,14 @@ window.__ModuleLoader__.load({
271
587
  d: "M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.72 6.56 11.52C4.78 11.32 2.92 10.63 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.32 9.47 11.52C9.76 11.77 10.01 12.25 10.01 13C10.01 14.08 10 14.95 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"
272
588
  }));
273
589
  }
274
- // 现代暗黑科技风勋章图标(深邃蓝紫微渐变 + 白描)
590
+ // 现代暗黑与浅色自适应科技风勋章图标
275
591
  function renderOctocatBadge(size = 32) {
276
592
  return React.createElement("div", {
593
+ className: "dsh-octocat-badge",
277
594
  style: {
278
- display: "flex",
279
- alignItems: "center",
280
- justifyContent: "center",
281
595
  width: size + "px",
282
596
  height: size + "px",
283
597
  borderRadius: Math.round(size * 0.25) + "px",
284
- background: "linear-gradient(135deg, #2ea043 0%, #1f6feb 60%, #8957e5 100%)",
285
- boxShadow: "0 2px 8px rgba(31, 111, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)",
286
- flexShrink: 0
287
598
  }
288
599
  }, renderOctocat(Math.round(size * 0.58), "#ffffff"));
289
600
  }
@@ -317,13 +628,13 @@ window.__ModuleLoader__.load({
317
628
  };
318
629
  // 仓库基础卡片
319
630
  var repoCardEl = h("div", { className: "dsh-github-card" }, h("div", { className: "dsh-github-card-title" }, "当前工作区 GitHub 仓库"), h("div", { className: "dsh-github-card-value" }, repo
320
- ? h("a", { href: repo.url, target: "_blank", style: { color: "#58a6ff", textDecoration: "none" } }, repo.nameWithOwner)
321
- : h("span", { style: { color: "#f85149" } }, "未检测到关联的 GitHub 仓库"), repo ? h("span", { className: "dsh-github-badge dsh-badge-green" }, repo.defaultBranch) : null), repo && repo.description
322
- ? h("div", { style: { fontSize: "12px", color: "#bbb", marginTop: "4px" } }, repo.description)
631
+ ? h("a", { href: repo.url, target: "_blank", className: "dsh-github-repo-link" }, repo.nameWithOwner)
632
+ : h("span", { style: { color: "var(--dsw-alias-state-error-primary, #cf222e)" } }, "未检测到关联的 GitHub 仓库"), repo ? h("span", { className: "dsh-github-badge dsh-badge-green" }, repo.defaultBranch) : null), repo && repo.description
633
+ ? h("div", { className: "dsh-github-card-desc" }, repo.description)
323
634
  : null, auth && auth.loggedIn
324
- ? h("div", { style: { fontSize: "11px", color: "#888", marginTop: "6px" } }, `CLI 认证账号: ${auth.user} (${auth.scopes?.join(", ") || "已登录"})`)
635
+ ? h("div", { className: "dsh-github-card-subtext" }, `CLI 认证账号: ${auth.user} (${auth.scopes?.join(", ") || "已登录"})`)
325
636
  : null, !repo
326
- ? h("div", { style: { fontSize: "11px", color: "#888", marginTop: "6px" } }, "若本地已有 git 仓库,请运行 `git remote add github <url>` 或 `git remote add origin <url>` 关联远程仓库。")
637
+ ? h("div", { className: "dsh-github-card-subtext" }, "若本地已有 git 仓库,请运行 `git remote add github <url>` 或 `git remote add origin <url>` 关联远程仓库。")
327
638
  : null);
328
639
  // 快捷操作栏
329
640
  var actionsBarEl = h("div", { className: "dsh-github-quick-actions" }, h("button", {
@@ -445,29 +756,9 @@ window.__ModuleLoader__.load({
445
756
  return React.createElement("div", {
446
757
  className: "dsh-github-icon" + (active ? " active" : ""),
447
758
  title: "GitHub 全景驾驶舱",
448
- style: {
449
- display: "flex",
450
- alignItems: "center",
451
- justifyContent: "center",
452
- width: "100%",
453
- height: "100%",
454
- cursor: "pointer",
455
- transition: "all 0.2s cubic-bezier(0.16, 1, 0.3, 1)"
456
- }
457
759
  }, React.createElement("div", {
458
- style: {
459
- display: "flex",
460
- alignItems: "center",
461
- justifyContent: "center",
462
- width: "28px",
463
- height: "28px",
464
- borderRadius: "7px",
465
- background: active ? "linear-gradient(135deg, rgba(46,160,67,0.3) 0%, rgba(31,111,235,0.45) 100%)" : "transparent",
466
- color: active ? "#ffffff" : "var(--dsw-alias-label-secondary, #9ca3af)",
467
- boxShadow: active ? "0 0 12px rgba(31, 111, 235, 0.4)" : "none",
468
- border: active ? "1px solid rgba(88, 166, 255, 0.45)" : "1px solid transparent"
469
- }
470
- }, renderOctocat(18, active ? "#ffffff" : "currentColor")));
760
+ className: "dsh-github-icon-inner" + (active ? " active" : "")
761
+ }, renderOctocat(18, "currentColor")));
471
762
  }
472
763
  function GithubWorkspacePanel() {
473
764
  var [loading, setLoading] = React.useState(true);
@@ -510,6 +801,7 @@ window.__ModuleLoader__.load({
510
801
  var workspaceMatrix = (data && data.workspaceMatrix) || [];
511
802
  var myPrs = (data && data.myPrs) || [];
512
803
  var myIssues = (data && data.myIssues) || [];
804
+ var errorEl = error ? h("div", { style: { color: "#f85149", background: "rgba(248,81,73,0.1)", border: "1px solid rgba(248,81,73,0.3)", padding: "8px 12px", borderRadius: "6px", marginBottom: "16px", fontSize: "12px" } }, `⚠️ 加载失败: ${error}`) : null;
513
805
  // 顶部统计卡片
514
806
  var statsCardsEl = h("div", { className: "dsh-github-overview-cards" }, h("div", { className: "dsh-github-card" }, h("div", { className: "dsh-github-card-title" }, "CLI 认证账号"), h("div", { className: "dsh-github-card-value" }, auth?.loggedIn ? `👤 ${auth.user}` : "未登录", auth?.loggedIn ? h("span", { className: "dsh-github-badge dsh-badge-green" }, "Active") : null)), h("div", { className: "dsh-github-card" }, h("div", { className: "dsh-github-card-title" }, "账号云端仓库"), h("div", { className: "dsh-github-card-value" }, `${userRepos.length} 个 Repositories`)), h("div", { className: "dsh-github-card" }, h("div", { className: "dsh-github-card-title" }, "本地工作区联动"), h("div", { className: "dsh-github-card-value" }, `${workspaceMatrix.length} 个工作区 (${workspaceMatrix.filter((w) => w.repo).length} 个已关联)`)));
515
807
  // Tab 栏
@@ -517,10 +809,10 @@ window.__ModuleLoader__.load({
517
809
  // 内容区
518
810
  var contentEl = null;
519
811
  if (activeTab === 'workspaces') {
520
- contentEl = h("div", { className: "dsh-github-list" }, workspaceMatrix.map((ws) => h("div", { key: ws.id, className: "dsh-github-card", style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "8px" } }, h("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, h("div", { style: { fontSize: "14px", fontWeight: "600", color: "#fff" } }, ws.title), h("div", { style: { fontSize: "12px", color: "#888", fontFamily: "monospace" } }, ws.path), h("div", { style: { fontSize: "12px", marginTop: "4px", display: "flex", gap: "8px", alignItems: "center" } }, ws.repo
521
- ? h("span", { style: { color: "#58a6ff" } }, `🐙 关联远程: ${ws.repo.nameWithOwner} (${ws.repo.defaultBranch})`)
522
- : h("span", { style: { color: "#888" } }, ws.hasGit ? "本地有 Git,未关联 GitHub 远程" : "本地无 Git 仓库"), ws.repo ? h("span", { className: "dsh-github-badge dsh-badge-green" }, "已关联") : null)), h("div", { style: { display: "flex", gap: "8px" } }, ws.repo
523
- ? h("a", { className: "dsh-github-btn-sm", href: ws.repo.url, target: "_blank", style: { textDecoration: "none" } }, "在 GitHub 打开")
812
+ contentEl = h("div", { className: "dsh-github-list" }, workspaceMatrix.map((ws) => h("div", { key: ws.id, className: "dsh-github-card dsh-github-workspace-card" }, h("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, h("div", { className: "dsh-github-ws-title" }, ws.title), h("div", { className: "dsh-github-ws-path" }, ws.path), h("div", { style: { fontSize: "12px", marginTop: "4px", display: "flex", gap: "8px", alignItems: "center" } }, ws.repo
813
+ ? h("span", { className: "dsh-github-ws-repo-link" }, renderOctocat(13, "currentColor"), `关联远程: ${ws.repo.nameWithOwner} (${ws.repo.defaultBranch})`)
814
+ : h("span", { className: "dsh-github-ws-path" }, ws.hasGit ? "本地有 Git,未关联 GitHub 远程" : "本地无 Git 仓库"), ws.repo ? h("span", { className: "dsh-github-badge dsh-badge-green" }, "已关联") : null)), h("div", { style: { display: "flex", gap: "8px" } }, ws.repo
815
+ ? h("a", { className: "dsh-github-btn-sm", href: ws.repo.url, target: "_blank" }, "在 GitHub 打开")
524
816
  : null))));
525
817
  }
526
818
  else if (activeTab === 'repos') {
@@ -530,14 +822,14 @@ window.__ModuleLoader__.load({
530
822
  placeholder: "🔍 搜索我的 GitHub 仓库...",
531
823
  value: searchQuery,
532
824
  onChange: (e) => setSearchQuery(e.target.value)
533
- }), h("div", { className: "dsh-github-list" }, filteredRepos.map((r) => h("div", { key: r.nameWithOwner, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: r.url, target: "_blank" }, r.nameWithOwner), r.description ? h("div", { style: { fontSize: "12px", color: "#bbb" } }, r.description) : null, h("div", { className: "dsh-github-item-meta" }, h("span", null, `默认分支: ${r.defaultBranch}`), r.isPrivate ? h("span", { className: "dsh-github-badge dsh-badge-yellow" }, "Private") : h("span", { className: "dsh-github-badge dsh-badge-green" }, "Public"), h("span", null, `⭐ ${r.stargazerCount}`))))));
825
+ }), h("div", { className: "dsh-github-list" }, filteredRepos.map((r) => h("div", { key: r.nameWithOwner, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: r.url, target: "_blank" }, r.nameWithOwner), r.description ? h("div", { className: "dsh-github-item-desc" }, r.description) : null, h("div", { className: "dsh-github-item-meta" }, h("span", null, `默认分支: ${r.defaultBranch}`), r.isPrivate ? h("span", { className: "dsh-github-badge dsh-badge-yellow" }, "Private") : h("span", { className: "dsh-github-badge dsh-badge-green" }, "Public"), h("span", null, `⭐ ${r.stargazerCount}`))))));
534
826
  }
535
827
  else {
536
- contentEl = h("div", null, h("h3", { style: { fontSize: "14px", marginBottom: "8px" } }, `🔀 我发起的 PR (${myPrs.length})`), myPrs.length === 0 ? h("div", { className: "dsh-github-empty", style: { marginBottom: "16px" } }, "暂无开放中的 PR") : h("div", { className: "dsh-github-list", style: { marginBottom: "16px" } }, myPrs.map((pr) => h("div", { key: pr.number, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: pr.url, target: "_blank" }, `[${pr.repository?.nameWithOwner || 'Repo'}] #${pr.number} ${pr.title}`)))), h("h3", { style: { fontSize: "14px", marginBottom: "8px" } }, `📝 我的待办 Issues (${myIssues.length})`), myIssues.length === 0 ? h("div", { className: "dsh-github-empty" }, "暂无开放中的 Issue") : h("div", { className: "dsh-github-list" }, myIssues.map((is) => h("div", { key: is.number, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: is.url, target: "_blank" }, `[${is.repository?.nameWithOwner || 'Repo'}] #${is.number} ${is.title}`)))));
828
+ contentEl = h("div", null, h("h3", { className: "dsh-github-subheading" }, `🔀 我发起的 PR (${myPrs.length})`), myPrs.length === 0 ? h("div", { className: "dsh-github-empty", style: { marginBottom: "16px" } }, "暂无开放中的 PR") : h("div", { className: "dsh-github-list", style: { marginBottom: "16px" } }, myPrs.map((pr) => h("div", { key: pr.number, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: pr.url, target: "_blank" }, `[${pr.repository?.nameWithOwner || 'Repo'}] #${pr.number} ${pr.title}`)))), h("h3", { className: "dsh-github-subheading" }, `📝 我的待办 Issues (${myIssues.length})`), myIssues.length === 0 ? h("div", { className: "dsh-github-empty" }, "暂无开放中的 Issue") : h("div", { className: "dsh-github-list" }, myIssues.map((is) => h("div", { key: is.number, className: "dsh-github-item" }, h("a", { className: "dsh-github-item-title", href: is.url, target: "_blank" }, `[${is.repository?.nameWithOwner || 'Repo'}] #${is.number} ${is.title}`)))));
537
829
  }
538
- return h("div", { className: "dsh-github-panel" }, headerEl, statsCardsEl, tabsEl, contentEl);
830
+ return h("div", { className: "dsh-github-panel" }, headerEl, errorEl, statsCardsEl, tabsEl, contentEl);
539
831
  }
540
- var inject = ["slots", "sidebarRightTabs", "sessions", "layout"];
832
+ var inject = ["slots", "sidebarRightTabs", "sessions", "layout", "theme"];
541
833
  function apply(ctx) {
542
834
  // 彻底清理历史在界面底部错位遗留的 DOM 元素
543
835
  if (typeof window !== "undefined" && window.document) {
@@ -554,6 +846,11 @@ window.__ModuleLoader__.load({
554
846
  else {
555
847
  injectStyles();
556
848
  }
849
+ if (ctx.on) {
850
+ ctx.on("theme/change", () => {
851
+ injectStyles();
852
+ });
853
+ }
557
854
  // A. 原生接入 DSH 右侧栏 Tab 体系 (sidebarRightTabs)
558
855
  // 这会让 GitHub 仓库自动、原生出现在“开始”引导页上(排在浏览器下方,无任何错位代码!)
559
856
  if (ctx.sidebarRightTabs && typeof ctx.sidebarRightTabs.register === "function") {