agent-loft 0.2.89 → 0.2.93

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.
Files changed (42) hide show
  1. package/README.md +10 -1
  2. package/package.json +23 -1
  3. package/src/channels/web/api.ts +14 -66
  4. package/src/channels/web/file-serve.ts +72 -0
  5. package/src/channels/web/tasks-api.ts +43 -11
  6. package/src/channels/web/workspace-api.ts +249 -0
  7. package/src/core/db.ts +19 -0
  8. package/src/core/footers.ts +26 -10
  9. package/src/core/git.ts +782 -0
  10. package/src/core/hub.ts +237 -31
  11. package/src/core/reply-files.ts +2 -1
  12. package/src/core/store.ts +8 -1
  13. package/src/core/task-runner.ts +5 -2
  14. package/src/core/tasks-bridge.ts +18 -4
  15. package/src/core/turn-changes.ts +179 -0
  16. package/src/core/types.ts +13 -0
  17. package/src/core/users.ts +15 -2
  18. package/src/core/workspace-files.ts +315 -0
  19. package/src/mcp/tasks-server.ts +6 -1
  20. package/web/css/experts.css +6 -3
  21. package/web/css/settings.css +31 -0
  22. package/web/css/tasks.css +21 -0
  23. package/web/css/workspace.css +1064 -0
  24. package/web/index.html +1 -0
  25. package/web/lib/api.js +1 -0
  26. package/web/lib/csv.js +53 -0
  27. package/web/lib/diff-parse.js +85 -0
  28. package/web/lib/dom.js +5 -0
  29. package/web/lib/eol.js +15 -0
  30. package/web/settings/users.js +23 -2
  31. package/web/vendor-built/LICENSE.codemirror +21 -0
  32. package/web/vendor-built/codemirror.js +41 -0
  33. package/web/views/diff-view.js +91 -0
  34. package/web/views/file-editor.js +146 -0
  35. package/web/views/file-preview.js +83 -6
  36. package/web/views/messages.js +55 -2
  37. package/web/views/sidebar-gestures.js +1 -1
  38. package/web/views/sidebar.js +1 -1
  39. package/web/views/tasks.js +108 -33
  40. package/web/views/topbar.js +10 -4
  41. package/web/views/workspace-entry.js +130 -0
  42. package/web/views/workspace.js +1346 -0
@@ -0,0 +1,1064 @@
1
+ /* ---------- 顶栏:分支标记和面板按钮 ---------- */
2
+
3
+ .top-git {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: 5px;
7
+ max-width: 220px;
8
+ height: 30px;
9
+ padding: 0 10px;
10
+ border: 1px solid var(--border);
11
+ border-radius: 999px;
12
+ background: transparent;
13
+ color: var(--fg-soft);
14
+ font-size: 12.5px;
15
+ font-family: var(--mono);
16
+ cursor: pointer;
17
+ flex-shrink: 0;
18
+ }
19
+
20
+ .top-git[hidden] {
21
+ display: none;
22
+ }
23
+
24
+ .top-git:hover {
25
+ background: var(--bg-hover);
26
+ }
27
+
28
+ .top-git svg {
29
+ width: 13px;
30
+ height: 13px;
31
+ flex-shrink: 0;
32
+ }
33
+
34
+ .top-git-name {
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ white-space: nowrap;
38
+ }
39
+
40
+ .top-git-count {
41
+ flex-shrink: 0;
42
+ padding: 0 5px;
43
+ border-radius: 999px;
44
+ background: var(--warn-bg);
45
+ color: var(--fg);
46
+ font-size: 11px;
47
+ line-height: 16px;
48
+ }
49
+
50
+ .top-git-count[hidden] {
51
+ display: none;
52
+ }
53
+
54
+ /* ---------- 面板 ---------- */
55
+
56
+ .ws-panel {
57
+ --ws-w: 480px;
58
+ position: relative;
59
+ display: flex;
60
+ flex-direction: column;
61
+ flex-shrink: 0;
62
+ width: var(--ws-w);
63
+ min-width: 280px;
64
+ max-width: calc(100% - var(--side-w) - 320px);
65
+ height: 100%;
66
+ border-left: 1px solid var(--border);
67
+ background: var(--bg);
68
+ z-index: 7;
69
+ }
70
+
71
+ .ws-panel[hidden] {
72
+ display: none;
73
+ }
74
+
75
+ .ws-resizer {
76
+ position: absolute;
77
+ top: 0;
78
+ bottom: 0;
79
+ left: -3px;
80
+ width: 6px;
81
+ cursor: col-resize;
82
+ z-index: 2;
83
+ }
84
+
85
+ .ws-head {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 4px;
89
+ padding: calc(10px + env(safe-area-inset-top)) 8px 8px 12px;
90
+ border-bottom: 1px solid var(--border);
91
+ flex-shrink: 0;
92
+ }
93
+
94
+ .ws-head .grow {
95
+ flex: 1;
96
+ }
97
+
98
+ .ws-tabs {
99
+ display: flex;
100
+ gap: 2px;
101
+ }
102
+
103
+ .ws-tab {
104
+ display: inline-flex;
105
+ align-items: center;
106
+ gap: 6px;
107
+ padding: 5px 12px;
108
+ border: none;
109
+ border-radius: 8px;
110
+ background: transparent;
111
+ color: var(--fg-soft);
112
+ font-size: 13.5px;
113
+ cursor: pointer;
114
+ }
115
+
116
+ .ws-tab:hover {
117
+ background: var(--bg-hover);
118
+ }
119
+
120
+ .ws-tab.on {
121
+ background: var(--bg-soft);
122
+ color: var(--fg);
123
+ font-weight: 500;
124
+ }
125
+
126
+ .ws-tab-count {
127
+ padding: 0 6px;
128
+ border-radius: 999px;
129
+ background: var(--bg-hover);
130
+ font-size: 11px;
131
+ line-height: 17px;
132
+ }
133
+
134
+ .ws-body {
135
+ flex: 1;
136
+ min-height: 0;
137
+ display: flex;
138
+ flex-direction: column;
139
+ }
140
+
141
+ .ws-list {
142
+ flex: 1;
143
+ min-height: 0;
144
+ overflow-y: auto;
145
+ padding: 6px 0 16px;
146
+ }
147
+
148
+ .ws-empty {
149
+ flex: 1;
150
+ display: flex;
151
+ flex-direction: column;
152
+ align-items: center;
153
+ justify-content: center;
154
+ gap: 10px;
155
+ padding: 32px 20px;
156
+ color: var(--fg-faint);
157
+ font-size: 13.5px;
158
+ text-align: center;
159
+ }
160
+
161
+ .ws-row {
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 7px;
165
+ width: 100%;
166
+ min-height: 28px;
167
+ padding: 3px 12px;
168
+ border: none;
169
+ background: transparent;
170
+ color: var(--fg);
171
+ font: inherit;
172
+ font-size: 13px;
173
+ text-align: left;
174
+ cursor: pointer;
175
+ }
176
+
177
+ button.ws-row:hover {
178
+ background: var(--bg-hover);
179
+ }
180
+
181
+ .ws-row.faint .ws-name {
182
+ color: var(--fg-soft);
183
+ }
184
+
185
+ .ws-row-note {
186
+ color: var(--fg-faint);
187
+ font-size: 12px;
188
+ cursor: default;
189
+ }
190
+
191
+ .ws-icon {
192
+ display: inline-grid;
193
+ place-items: center;
194
+ flex-shrink: 0;
195
+ width: 16px;
196
+ height: 16px;
197
+ color: var(--fg-faint);
198
+ }
199
+
200
+ .ws-icon svg {
201
+ width: 15px;
202
+ height: 15px;
203
+ }
204
+
205
+ .ws-name {
206
+ overflow: hidden;
207
+ text-overflow: ellipsis;
208
+ white-space: nowrap;
209
+ flex-shrink: 1;
210
+ min-width: 40px;
211
+ }
212
+
213
+ .ws-dir {
214
+ flex: 1;
215
+ min-width: 0;
216
+ overflow: hidden;
217
+ color: var(--fg-faint);
218
+ font-size: 12px;
219
+ text-overflow: ellipsis;
220
+ white-space: nowrap;
221
+ direction: rtl;
222
+ text-align: left;
223
+ }
224
+
225
+ .ws-size {
226
+ margin-left: auto;
227
+ padding-left: 8px;
228
+ flex-shrink: 0;
229
+ color: var(--fg-faint);
230
+ font-size: 11.5px;
231
+ }
232
+
233
+ .ws-tag {
234
+ flex-shrink: 0;
235
+ padding: 0 5px;
236
+ border: 1px solid var(--border);
237
+ border-radius: 5px;
238
+ color: var(--fg-faint);
239
+ font-size: 10.5px;
240
+ line-height: 15px;
241
+ }
242
+
243
+ .ws-group {
244
+ display: flex;
245
+ align-items: center;
246
+ gap: 6px;
247
+ padding: 10px 12px 4px;
248
+ color: var(--fg-faint);
249
+ font-size: 11.5px;
250
+ font-weight: 500;
251
+ }
252
+
253
+ .ws-group-count {
254
+ font-weight: 400;
255
+ }
256
+
257
+ .ws-state {
258
+ flex-shrink: 0;
259
+ width: 16px;
260
+ font-family: var(--mono);
261
+ font-size: 12px;
262
+ font-weight: 600;
263
+ text-align: center;
264
+ }
265
+
266
+ .s-modified,
267
+ .s-typechange {
268
+ color: #b7791f;
269
+ }
270
+
271
+ .s-added,
272
+ .s-untracked,
273
+ .s-copied {
274
+ color: var(--ok);
275
+ }
276
+
277
+ .s-deleted,
278
+ .s-conflicted {
279
+ color: var(--danger);
280
+ }
281
+
282
+ .s-renamed {
283
+ color: var(--accent);
284
+ }
285
+
286
+ /* ---------- 文件树的操作 ---------- */
287
+
288
+ .ws-toolbar {
289
+ display: flex;
290
+ gap: 4px;
291
+ flex-shrink: 0;
292
+ padding: 6px 10px;
293
+ border-bottom: 1px solid var(--border);
294
+ }
295
+
296
+ .ws-toolbar .btn {
297
+ padding: 3px 9px;
298
+ font-size: 12.5px;
299
+ }
300
+
301
+ .ws-entry {
302
+ position: relative;
303
+ }
304
+
305
+ .ws-entry .ws-row {
306
+ padding-right: 34px;
307
+ }
308
+
309
+ .ws-entry-more {
310
+ position: absolute;
311
+ top: 50%;
312
+ right: 6px;
313
+ width: 24px;
314
+ height: 24px;
315
+ transform: translateY(-50%);
316
+ opacity: 0;
317
+ }
318
+
319
+ .ws-entry-more svg {
320
+ width: 15px;
321
+ height: 15px;
322
+ }
323
+
324
+ .ws-entry:hover .ws-entry-more,
325
+ .ws-entry-more:focus-visible {
326
+ opacity: 1;
327
+ }
328
+
329
+ @media (pointer: coarse) {
330
+ .ws-entry-more {
331
+ opacity: 0.7;
332
+ }
333
+ }
334
+
335
+ .ws-panel.ws-dropping .ws-body {
336
+ outline: 2px dashed var(--accent);
337
+ outline-offset: -4px;
338
+ }
339
+
340
+ /* ---------- 编辑器 ---------- */
341
+
342
+ .ws-editor {
343
+ flex: 1;
344
+ min-height: 0;
345
+ display: flex;
346
+ overflow: hidden;
347
+ }
348
+
349
+ .ws-editor[hidden] {
350
+ display: none;
351
+ }
352
+
353
+ .ws-editor .cm-editor {
354
+ flex: 1;
355
+ min-width: 0;
356
+ height: 100%;
357
+ font-size: 13px;
358
+ }
359
+
360
+ .ws-editor .cm-editor.cm-focused {
361
+ outline: none;
362
+ }
363
+
364
+ /* 跟着应用的底色走,不要主题自带的(深色主题偏蓝) */
365
+ .ws-editor .cm-editor {
366
+ background: var(--bg);
367
+ }
368
+
369
+ .ws-editor .cm-gutters {
370
+ background: var(--bg-soft);
371
+ border-right: 1px solid var(--border);
372
+ }
373
+
374
+ .ws-editor .cm-scroller {
375
+ font-family: var(--mono);
376
+ line-height: 1.55;
377
+ }
378
+
379
+ .ws-dirty {
380
+ display: inline-block;
381
+ width: 7px;
382
+ height: 7px;
383
+ margin-left: 6px;
384
+ border-radius: 50%;
385
+ background: var(--accent);
386
+ vertical-align: middle;
387
+ }
388
+
389
+ .ws-dirty[hidden] {
390
+ display: none;
391
+ }
392
+
393
+ /* ---------- 暂存、丢弃、提交 ---------- */
394
+
395
+ .ws-changes {
396
+ flex: 1;
397
+ min-height: 0;
398
+ display: flex;
399
+ flex-direction: column;
400
+ }
401
+
402
+ .ws-branch-slot {
403
+ display: flex;
404
+ flex-direction: column;
405
+ flex-shrink: 0;
406
+ }
407
+
408
+ .ws-row-actions {
409
+ position: absolute;
410
+ top: 50%;
411
+ right: 6px;
412
+ display: flex;
413
+ gap: 2px;
414
+ padding-left: 6px;
415
+ background: var(--bg-hover);
416
+ transform: translateY(-50%);
417
+ opacity: 0;
418
+ pointer-events: none;
419
+ }
420
+
421
+ .ws-entry:hover .ws-row-actions,
422
+ .ws-row-actions:focus-within {
423
+ opacity: 1;
424
+ pointer-events: auto;
425
+ }
426
+
427
+ .ws-entry:hover > .ws-change {
428
+ background: var(--bg-hover);
429
+ }
430
+
431
+ .ws-row-act {
432
+ width: 24px;
433
+ height: 24px;
434
+ }
435
+
436
+ .ws-row-act svg {
437
+ width: 14px;
438
+ height: 14px;
439
+ }
440
+
441
+ .ws-group-act {
442
+ width: 22px;
443
+ height: 22px;
444
+ margin-left: auto;
445
+ }
446
+
447
+ .ws-group-act svg {
448
+ width: 13px;
449
+ height: 13px;
450
+ }
451
+
452
+ /* 没有悬停的设备:按钮一直在,文件名让出位置 */
453
+ @media (pointer: coarse) {
454
+ .ws-row-actions {
455
+ position: static;
456
+ background: transparent;
457
+ transform: none;
458
+ opacity: 1;
459
+ pointer-events: auto;
460
+ flex-shrink: 0;
461
+ padding: 0 6px 0 0;
462
+ }
463
+
464
+ .ws-entry:has(> .ws-change) {
465
+ display: flex;
466
+ align-items: center;
467
+ }
468
+
469
+ .ws-entry > .ws-change {
470
+ flex: 1;
471
+ min-width: 0;
472
+ padding-right: 4px;
473
+ }
474
+
475
+ .ws-row-act {
476
+ width: 34px;
477
+ height: 34px;
478
+ }
479
+ }
480
+
481
+ .ws-commit {
482
+ flex-shrink: 0;
483
+ padding: 8px 10px;
484
+ border-bottom: 1px solid var(--border);
485
+ }
486
+
487
+ .ws-commit-msg {
488
+ display: block;
489
+ box-sizing: border-box;
490
+ width: 100%;
491
+ min-height: 44px;
492
+ max-height: 160px;
493
+ padding: 6px 8px;
494
+ border: 1px solid var(--border);
495
+ border-radius: 8px;
496
+ background: var(--bg-input);
497
+ color: var(--fg);
498
+ font: inherit;
499
+ font-size: 13px;
500
+ resize: vertical;
501
+ }
502
+
503
+ .ws-commit-msg:focus {
504
+ border-color: var(--accent);
505
+ outline: none;
506
+ }
507
+
508
+ .ws-commit-foot {
509
+ display: flex;
510
+ align-items: center;
511
+ gap: 8px;
512
+ margin-top: 6px;
513
+ }
514
+
515
+ .ws-commit-hooks {
516
+ display: inline-flex;
517
+ align-items: center;
518
+ gap: 5px;
519
+ color: var(--fg-soft);
520
+ font-size: 12px;
521
+ cursor: pointer;
522
+ }
523
+
524
+ .ws-commit-foot .btn {
525
+ margin-left: auto;
526
+ padding: 4px 10px;
527
+ font-size: 12.5px;
528
+ }
529
+
530
+ /* ---------- 提交历史 ---------- */
531
+
532
+ .ws-commit-row {
533
+ display: block;
534
+ width: 100%;
535
+ padding: 7px 12px;
536
+ border: none;
537
+ background: transparent;
538
+ color: var(--fg);
539
+ font: inherit;
540
+ text-align: left;
541
+ cursor: pointer;
542
+ }
543
+
544
+ .ws-commit-row:hover {
545
+ background: var(--bg-hover);
546
+ }
547
+
548
+ .ws-commit-subject {
549
+ overflow: hidden;
550
+ font-size: 13px;
551
+ text-overflow: ellipsis;
552
+ white-space: nowrap;
553
+ }
554
+
555
+ .ws-commit-meta {
556
+ overflow: hidden;
557
+ color: var(--fg-faint);
558
+ font-size: 11.5px;
559
+ text-overflow: ellipsis;
560
+ white-space: nowrap;
561
+ }
562
+
563
+ /* ---------- 分支 ---------- */
564
+
565
+ .ws-branch {
566
+ display: flex;
567
+ align-items: center;
568
+ gap: 6px;
569
+ flex-shrink: 0;
570
+ padding: 8px 12px;
571
+ border: none;
572
+ border-bottom: 1px solid var(--border);
573
+ background: transparent;
574
+ color: var(--fg);
575
+ font-size: 13px;
576
+ text-align: left;
577
+ cursor: pointer;
578
+ }
579
+
580
+ .ws-branch:hover {
581
+ background: var(--bg-hover);
582
+ }
583
+
584
+ .ws-branch > span:first-child {
585
+ flex-shrink: 0;
586
+ color: var(--fg-faint);
587
+ }
588
+
589
+ .ws-branch > span:first-child svg {
590
+ width: 14px;
591
+ height: 14px;
592
+ }
593
+
594
+ .ws-branch-name {
595
+ overflow: hidden;
596
+ font-family: var(--mono);
597
+ font-weight: 500;
598
+ text-overflow: ellipsis;
599
+ white-space: nowrap;
600
+ }
601
+
602
+ .ws-branch-up {
603
+ overflow: hidden;
604
+ color: var(--fg-faint);
605
+ font-family: var(--mono);
606
+ font-size: 11.5px;
607
+ text-overflow: ellipsis;
608
+ white-space: nowrap;
609
+ }
610
+
611
+ .ws-sync {
612
+ flex-shrink: 0;
613
+ color: var(--fg-soft);
614
+ font-family: var(--mono);
615
+ font-size: 12px;
616
+ }
617
+
618
+ .ws-caret {
619
+ display: inline-grid;
620
+ margin-left: auto;
621
+ flex-shrink: 0;
622
+ color: var(--fg-faint);
623
+ }
624
+
625
+ .ws-caret svg {
626
+ width: 10px;
627
+ height: 10px;
628
+ }
629
+
630
+ .menu.ws-branches {
631
+ width: min(380px, calc(100vw - 24px));
632
+ max-height: min(420px, 70vh);
633
+ overflow-y: auto;
634
+ padding: 4px 0 8px;
635
+ }
636
+
637
+ .ws-branches-note {
638
+ padding: 12px;
639
+ color: var(--fg-faint);
640
+ font-size: 13px;
641
+ }
642
+
643
+ .menu.ws-branches button.ws-branch-row {
644
+ display: flex;
645
+ gap: 6px;
646
+ width: 100%;
647
+ padding: 6px 12px 6px 8px;
648
+ border: none;
649
+ background: transparent;
650
+ color: var(--fg);
651
+ font: inherit;
652
+ text-align: left;
653
+ cursor: pointer;
654
+ }
655
+
656
+ .menu.ws-branches button.ws-branch-row:hover,
657
+ .menu.ws-branches button.ws-branch-new:hover {
658
+ background: var(--bg-hover);
659
+ }
660
+
661
+ .menu.ws-branches button.ws-branch-new {
662
+ display: flex;
663
+ align-items: center;
664
+ gap: 6px;
665
+ width: 100%;
666
+ padding: 7px 10px;
667
+ border: none;
668
+ background: transparent;
669
+ color: var(--fg);
670
+ font: inherit;
671
+ font-size: 13px;
672
+ text-align: left;
673
+ cursor: pointer;
674
+ }
675
+
676
+ .ws-branch-new svg {
677
+ width: 13px;
678
+ height: 13px;
679
+ }
680
+
681
+ .ws-branch-check {
682
+ flex-shrink: 0;
683
+ width: 16px;
684
+ height: 16px;
685
+ color: var(--accent);
686
+ }
687
+
688
+ .ws-branch-check svg {
689
+ width: 14px;
690
+ height: 14px;
691
+ }
692
+
693
+ .ws-branch-text {
694
+ min-width: 0;
695
+ }
696
+
697
+ .ws-branch-title {
698
+ overflow: hidden;
699
+ font-family: var(--mono);
700
+ font-size: 12.5px;
701
+ text-overflow: ellipsis;
702
+ white-space: nowrap;
703
+ }
704
+
705
+ .ws-branch-row.on .ws-branch-title {
706
+ font-weight: 600;
707
+ }
708
+
709
+ .ws-branch-sub {
710
+ overflow: hidden;
711
+ color: var(--fg-faint);
712
+ font-size: 11.5px;
713
+ text-overflow: ellipsis;
714
+ white-space: nowrap;
715
+ }
716
+
717
+ /* ---------- 详情页 ---------- */
718
+
719
+ .ws-detail-head {
720
+ display: flex;
721
+ align-items: center;
722
+ gap: 6px;
723
+ flex-shrink: 0;
724
+ padding: 6px 10px 6px 4px;
725
+ border-bottom: 1px solid var(--border);
726
+ }
727
+
728
+ .ws-detail-title {
729
+ flex: 1;
730
+ min-width: 0;
731
+ }
732
+
733
+ .ws-detail-name {
734
+ overflow: hidden;
735
+ font-size: 13.5px;
736
+ font-weight: 500;
737
+ text-overflow: ellipsis;
738
+ white-space: nowrap;
739
+ }
740
+
741
+ .ws-detail-sub {
742
+ overflow: hidden;
743
+ color: var(--fg-faint);
744
+ font-size: 11.5px;
745
+ text-overflow: ellipsis;
746
+ white-space: nowrap;
747
+ }
748
+
749
+ .ws-detail-head .btn {
750
+ flex-shrink: 0;
751
+ padding: 3px 9px;
752
+ font-size: 12.5px;
753
+ }
754
+
755
+ .ws-detail-head .fv-actions {
756
+ flex-shrink: 0;
757
+ }
758
+
759
+ .ws-preview {
760
+ flex: 1;
761
+ min-height: 0;
762
+ }
763
+
764
+ .ws-stat {
765
+ display: inline-flex;
766
+ gap: 5px;
767
+ flex-shrink: 0;
768
+ font-family: var(--mono);
769
+ font-size: 12px;
770
+ }
771
+
772
+ .ws-add {
773
+ color: var(--ok);
774
+ }
775
+
776
+ .ws-del {
777
+ color: var(--danger);
778
+ }
779
+
780
+ /* ---------- diff ---------- */
781
+
782
+ .ws-diff-scroll {
783
+ flex: 1;
784
+ min-height: 0;
785
+ display: flex;
786
+ flex-direction: column;
787
+ overflow: auto;
788
+ }
789
+
790
+ .diff {
791
+ --d-add: color-mix(in srgb, var(--ok) 14%, transparent);
792
+ --d-del: color-mix(in srgb, var(--danger) 13%, transparent);
793
+ font-family: var(--mono);
794
+ font-size: 12px;
795
+ line-height: 1.55;
796
+ }
797
+
798
+ .d-row {
799
+ display: grid;
800
+ grid-template-columns: 4.5ch 4.5ch 2ch minmax(0, 1fr);
801
+ }
802
+
803
+ .d-split-row {
804
+ grid-template-columns: 4.5ch minmax(0, 1fr) 4.5ch minmax(0, 1fr);
805
+ }
806
+
807
+ .d-ln {
808
+ padding-right: 6px;
809
+ color: var(--fg-faint);
810
+ text-align: right;
811
+ user-select: none;
812
+ }
813
+
814
+ .d-mark {
815
+ color: var(--fg-faint);
816
+ text-align: center;
817
+ user-select: none;
818
+ }
819
+
820
+ .d-code {
821
+ min-width: 0;
822
+ padding-right: 8px;
823
+ white-space: pre-wrap;
824
+ overflow-wrap: anywhere;
825
+ }
826
+
827
+ .d-row.d-add,
828
+ .d-ln.d-add,
829
+ .d-code.d-add {
830
+ background: var(--d-add);
831
+ }
832
+
833
+ .d-row.d-del,
834
+ .d-ln.d-del,
835
+ .d-code.d-del {
836
+ background: var(--d-del);
837
+ }
838
+
839
+ .d-row.d-note .d-code,
840
+ .d-code.d-note {
841
+ color: var(--fg-faint);
842
+ font-style: italic;
843
+ }
844
+
845
+ .d-blank {
846
+ background: var(--bg-soft);
847
+ }
848
+
849
+ .d-hunk {
850
+ display: flex;
851
+ gap: 10px;
852
+ padding: 3px 10px;
853
+ background: var(--bg-soft);
854
+ color: var(--fg-faint);
855
+ font-size: 11.5px;
856
+ }
857
+
858
+ .d-section {
859
+ overflow: hidden;
860
+ text-overflow: ellipsis;
861
+ white-space: nowrap;
862
+ }
863
+
864
+ .d-note-bar {
865
+ padding: 6px 12px;
866
+ background: var(--warn-bg);
867
+ color: var(--fg-soft);
868
+ font-size: 12px;
869
+ }
870
+
871
+ .d-raw {
872
+ margin: 0;
873
+ padding: 10px 12px;
874
+ white-space: pre-wrap;
875
+ overflow-wrap: anywhere;
876
+ }
877
+
878
+ .d-more {
879
+ display: block;
880
+ margin: 12px auto;
881
+ }
882
+
883
+ /* ---------- 回复下面的改动卡片 ---------- */
884
+
885
+ .turn-changes {
886
+ margin: 10px 0 2px;
887
+ max-width: 560px;
888
+ overflow: hidden;
889
+ border: 1px solid var(--border);
890
+ border-radius: 10px;
891
+ font-size: 13px;
892
+ }
893
+
894
+ .turn-head,
895
+ .turn-file,
896
+ .turn-more {
897
+ display: flex;
898
+ align-items: center;
899
+ gap: 7px;
900
+ width: 100%;
901
+ border: none;
902
+ background: transparent;
903
+ color: var(--fg);
904
+ font: inherit;
905
+ text-align: left;
906
+ cursor: pointer;
907
+ }
908
+
909
+ .turn-head {
910
+ padding: 7px 10px;
911
+ }
912
+
913
+ .turn-head:hover,
914
+ .turn-file:hover,
915
+ .turn-more:hover {
916
+ background: var(--bg-hover);
917
+ }
918
+
919
+ .turn-head > span:first-child {
920
+ flex-shrink: 0;
921
+ color: var(--fg-faint);
922
+ }
923
+
924
+ .turn-head svg {
925
+ width: 15px;
926
+ height: 15px;
927
+ }
928
+
929
+ .turn-title {
930
+ font-weight: 500;
931
+ }
932
+
933
+ .turn-open {
934
+ margin-left: auto;
935
+ color: var(--fg-faint);
936
+ font-size: 12px;
937
+ }
938
+
939
+ .turn-file {
940
+ padding: 4px 10px;
941
+ border-top: 1px solid var(--border);
942
+ }
943
+
944
+ .turn-file-name {
945
+ flex: 1;
946
+ min-width: 0;
947
+ overflow: hidden;
948
+ font-family: var(--mono);
949
+ font-size: 12px;
950
+ text-overflow: ellipsis;
951
+ white-space: nowrap;
952
+ direction: rtl;
953
+ text-align: left;
954
+ }
955
+
956
+ .turn-count {
957
+ display: inline-flex;
958
+ gap: 5px;
959
+ flex-shrink: 0;
960
+ color: var(--fg-faint);
961
+ font-family: var(--mono);
962
+ font-size: 12px;
963
+ }
964
+
965
+ .turn-more {
966
+ padding: 4px 10px;
967
+ border-top: 1px solid var(--border);
968
+ color: var(--fg-soft);
969
+ font-size: 12px;
970
+ }
971
+
972
+ .turn-note {
973
+ padding: 5px 10px;
974
+ border-top: 1px solid var(--border);
975
+ background: var(--warn-bg);
976
+ color: var(--fg-soft);
977
+ font-size: 12px;
978
+ }
979
+
980
+ /* ---------- 手机:全屏 ---------- */
981
+
982
+ @media (max-width: 768px) {
983
+ .top-git {
984
+ display: none;
985
+ }
986
+
987
+ .top-actions .top-workspace {
988
+ width: 44px;
989
+ height: 44px;
990
+ border-radius: 999px;
991
+ color: var(--fg);
992
+ }
993
+
994
+ .ws-panel {
995
+ position: fixed;
996
+ inset: 0;
997
+ width: 100%;
998
+ min-width: 0;
999
+ max-width: none;
1000
+ height: calc(100% - var(--kb-inset, 0px));
1001
+ border-left: none;
1002
+ /* 盖过手机上的侧栏(30),弹窗(40)要盖在它上面 */
1003
+ z-index: 35;
1004
+ }
1005
+
1006
+ .ws-resizer {
1007
+ display: none;
1008
+ }
1009
+
1010
+ .ws-row {
1011
+ min-height: 38px;
1012
+ font-size: 14px;
1013
+ }
1014
+
1015
+ .diff {
1016
+ font-size: 11.5px;
1017
+ }
1018
+
1019
+ /* 小于 16px 的输入框,iOS 聚焦时会放大页面 */
1020
+ .ws-editor .cm-editor {
1021
+ font-size: 16px;
1022
+ }
1023
+ }
1024
+
1025
+ /* ---------- 表格(预览弹层和面板共用) ---------- */
1026
+
1027
+ .fv-csv {
1028
+ flex: 1;
1029
+ min-height: 0;
1030
+ overflow: auto;
1031
+ }
1032
+
1033
+ .fv-csv table {
1034
+ border-collapse: separate;
1035
+ border-spacing: 0;
1036
+ font-size: 12.5px;
1037
+ }
1038
+
1039
+ .fv-csv th,
1040
+ .fv-csv td {
1041
+ max-width: 360px;
1042
+ overflow: hidden;
1043
+ padding: 4px 10px;
1044
+ border-right: 1px solid var(--border);
1045
+ border-bottom: 1px solid var(--border);
1046
+ text-align: left;
1047
+ text-overflow: ellipsis;
1048
+ white-space: nowrap;
1049
+ }
1050
+
1051
+ .fv-csv thead th {
1052
+ position: sticky;
1053
+ top: 0;
1054
+ z-index: 1;
1055
+ background: var(--bg-soft);
1056
+ font-weight: 600;
1057
+ }
1058
+
1059
+ .fv-csv-no {
1060
+ color: var(--fg-faint);
1061
+ font-weight: 400;
1062
+ text-align: right;
1063
+ user-select: none;
1064
+ }