@rvagg/marginalia 0.0.1
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/README.md +185 -0
- package/dist/comments.js +44 -0
- package/dist/comments.js.map +1 -0
- package/dist/comments.test.js +36 -0
- package/dist/comments.test.js.map +1 -0
- package/dist/diff.js +42 -0
- package/dist/diff.js.map +1 -0
- package/dist/diff.test.js +54 -0
- package/dist/diff.test.js.map +1 -0
- package/dist/http.js +123 -0
- package/dist/http.js.map +1 -0
- package/dist/http.test.js +13 -0
- package/dist/http.test.js.map +1 -0
- package/dist/mcp.js +266 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mcp.test.js +109 -0
- package/dist/mcp.test.js.map +1 -0
- package/dist/poller.js +54 -0
- package/dist/poller.js.map +1 -0
- package/dist/poller.test.js +70 -0
- package/dist/poller.test.js.map +1 -0
- package/dist/server.js +147 -0
- package/dist/server.js.map +1 -0
- package/marginalia.png +0 -0
- package/package.json +151 -0
- package/ui/app.js +717 -0
- package/ui/diff2html-theme.css +124 -0
- package/ui/index.html +60 -0
- package/ui/style.css +426 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* diff2html overrides for marginalia
|
|
2
|
+
All the !important rules that fight diff2html's defaults live here.
|
|
3
|
+
Uses CSS variables from style.css (:root). */
|
|
4
|
+
|
|
5
|
+
/* --- Container --- */
|
|
6
|
+
|
|
7
|
+
.d2h-wrapper { background: var(--mg-bg) !important; }
|
|
8
|
+
|
|
9
|
+
/* --- File cards --- */
|
|
10
|
+
|
|
11
|
+
.d2h-file-wrapper {
|
|
12
|
+
border: 1px solid var(--mg-border) !important;
|
|
13
|
+
border-radius: 6px !important;
|
|
14
|
+
margin: 16px 16px 0 16px !important;
|
|
15
|
+
overflow: visible !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.d2h-file-header {
|
|
19
|
+
background: var(--mg-surface) !important;
|
|
20
|
+
border-bottom: 1px solid var(--mg-border) !important;
|
|
21
|
+
padding: 8px 12px !important;
|
|
22
|
+
height: auto !important;
|
|
23
|
+
position: sticky !important;
|
|
24
|
+
top: 0 !important;
|
|
25
|
+
z-index: 2 !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.d2h-file-name-wrapper { background: transparent !important; font-size: 13px !important; }
|
|
29
|
+
.d2h-file-name { color: var(--mg-text) !important; font-family: var(--mg-mono) !important; font-size: 12px !important; }
|
|
30
|
+
.d2h-file-stats { font-size: 12px !important; }
|
|
31
|
+
.d2h-file-collapse { display: none !important; }
|
|
32
|
+
.d2h-file-diff { border: none !important; overflow: hidden !important; }
|
|
33
|
+
|
|
34
|
+
/* --- Table --- */
|
|
35
|
+
|
|
36
|
+
.d2h-diff-table {
|
|
37
|
+
font-family: var(--mg-mono) !important;
|
|
38
|
+
font-size: 12px !important;
|
|
39
|
+
border-collapse: collapse !important;
|
|
40
|
+
border-spacing: 0 !important;
|
|
41
|
+
width: 100% !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* --- Line numbers: static table-cell instead of absolute --- */
|
|
45
|
+
|
|
46
|
+
.d2h-code-linenumber {
|
|
47
|
+
position: static !important;
|
|
48
|
+
display: table-cell !important;
|
|
49
|
+
width: 1% !important;
|
|
50
|
+
white-space: nowrap !important;
|
|
51
|
+
vertical-align: top !important;
|
|
52
|
+
cursor: pointer !important;
|
|
53
|
+
color: var(--mg-text-muted) !important;
|
|
54
|
+
border-right: 1px solid var(--mg-border) !important;
|
|
55
|
+
padding: 0 4px !important;
|
|
56
|
+
font-size: 0 !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.line-num1, .line-num2 {
|
|
60
|
+
display: inline-block !important;
|
|
61
|
+
min-width: 4ch !important;
|
|
62
|
+
width: 4ch !important;
|
|
63
|
+
text-align: right !important;
|
|
64
|
+
float: none !important;
|
|
65
|
+
font-size: 12px !important;
|
|
66
|
+
line-height: 18px !important;
|
|
67
|
+
padding: 0 2px !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* --- Code line --- */
|
|
71
|
+
|
|
72
|
+
.d2h-code-line { padding: 0 !important; width: calc(100% - 32px) !important; }
|
|
73
|
+
.d2h-code-line-prefix { padding: 0 4px 0 16px !important; vertical-align: top !important; }
|
|
74
|
+
.d2h-code-line-ctn { font-family: var(--mg-mono) !important; font-size: 12px !important; padding: 1px 4px 1px 2px !important; white-space: pre-wrap !important; word-wrap: break-word !important; overflow-wrap: break-word !important; }
|
|
75
|
+
[data-theme="light"] .d2h-code-line-ctn { color: var(--mg-text) !important; }
|
|
76
|
+
|
|
77
|
+
/* --- Row colours: GitHub-matching del/ins/info --- */
|
|
78
|
+
|
|
79
|
+
/* Deletions: soft red */
|
|
80
|
+
.d2h-del { background: var(--mg-diff-del-line-bg) !important; }
|
|
81
|
+
.d2h-del .d2h-code-linenumber { background: var(--mg-diff-del-gutter-bg) !important; color: var(--mg-diff-line-number-color) !important; }
|
|
82
|
+
.d2h-del .d2h-code-line, .d2h-del .d2h-code-line-ctn { background: var(--mg-diff-del-line-bg) !important; }
|
|
83
|
+
|
|
84
|
+
/* Insertions: soft green */
|
|
85
|
+
.d2h-ins { background: var(--mg-diff-ins-line-bg) !important; }
|
|
86
|
+
.d2h-ins .d2h-code-linenumber { background: var(--mg-diff-ins-gutter-bg) !important; color: var(--mg-diff-line-number-color) !important; }
|
|
87
|
+
.d2h-ins .d2h-code-line, .d2h-ins .d2h-code-line-ctn { background: var(--mg-diff-ins-line-bg) !important; }
|
|
88
|
+
|
|
89
|
+
/* Character-level highlights within changed lines */
|
|
90
|
+
.d2h-del del, .d2h-code-line-ctn del {
|
|
91
|
+
background: var(--mg-diff-del-word-bg) !important;
|
|
92
|
+
text-decoration: none !important;
|
|
93
|
+
border-radius: 2px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.d2h-ins ins, .d2h-code-line-ctn ins {
|
|
97
|
+
background: var(--mg-diff-ins-word-bg) !important;
|
|
98
|
+
text-decoration: none !important;
|
|
99
|
+
border-radius: 2px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Context/unchanged lines */
|
|
103
|
+
.d2h-code-linenumber { background: var(--mg-bg) !important; }
|
|
104
|
+
|
|
105
|
+
/* Hunk headers */
|
|
106
|
+
.d2h-info { background: #ddf4ff !important; }
|
|
107
|
+
.d2h-info .d2h-code-linenumber { background: #ddf4ff !important; }
|
|
108
|
+
.d2h-info .d2h-code-line, .d2h-info .d2h-code-line-ctn { background: #ddf4ff !important; color: var(--mg-diff-hunk-text) !important; }
|
|
109
|
+
|
|
110
|
+
/* --- Tags --- */
|
|
111
|
+
|
|
112
|
+
.d2h-tag { background: var(--mg-bg) !important; }
|
|
113
|
+
|
|
114
|
+
/* --- Dark mode diff colours --- */
|
|
115
|
+
|
|
116
|
+
[data-theme="dark"] .d2h-info { background: rgba(56, 139, 253, 0.1) !important; }
|
|
117
|
+
[data-theme="dark"] .d2h-info .d2h-code-linenumber { background: rgba(56, 139, 253, 0.1) !important; }
|
|
118
|
+
[data-theme="dark"] .d2h-info .d2h-code-line, [data-theme="dark"] .d2h-info .d2h-code-line-ctn { background: rgba(56, 139, 253, 0.1) !important; color: var(--mg-text-muted) !important; }
|
|
119
|
+
|
|
120
|
+
/* --- Viewed / collapsed --- */
|
|
121
|
+
|
|
122
|
+
.d2h-file-wrapper.mg-collapsed .d2h-file-diff { display: none !important; }
|
|
123
|
+
.d2h-file-wrapper.mg-collapsed { opacity: 0.7; }
|
|
124
|
+
.d2h-file-wrapper.mg-collapsed .d2h-file-header { border-bottom: none !important; }
|
package/ui/index.html
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>marginalia</title>
|
|
7
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📝</text></svg>">
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/diff2html@3/bundles/css/diff2html.min.css">
|
|
9
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11/styles/github.min.css" id="hljs-light">
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11/styles/github-dark.min.css" id="hljs-dark" disabled>
|
|
11
|
+
<link rel="stylesheet" href="/diff2html-theme.css">
|
|
12
|
+
<link rel="stylesheet" href="/style.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
<header id="header">
|
|
17
|
+
<span class="brand">marginalia</span>
|
|
18
|
+
<span class="sep">·</span>
|
|
19
|
+
<span id="project-dir"></span>
|
|
20
|
+
<span class="sep">·</span>
|
|
21
|
+
<button id="file-count" title="Toggle file list"></button>
|
|
22
|
+
<span class="sep">·</span>
|
|
23
|
+
<span id="status">connecting...</span>
|
|
24
|
+
<button id="theme-toggle" title="Toggle dark mode"></button>
|
|
25
|
+
</header>
|
|
26
|
+
|
|
27
|
+
<div id="filenav" class="hidden"></div>
|
|
28
|
+
|
|
29
|
+
<main id="diff-container">
|
|
30
|
+
<div id="loading-state">
|
|
31
|
+
<div class="spinner"></div>
|
|
32
|
+
<p>Connecting...</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div id="empty-state" class="hidden">
|
|
35
|
+
<p>No changes detected. Edit some files and they will appear here.</p>
|
|
36
|
+
</div>
|
|
37
|
+
</main>
|
|
38
|
+
|
|
39
|
+
<div id="permission-bar" class="hidden">
|
|
40
|
+
<span id="permission-text"></span>
|
|
41
|
+
<button id="permission-approve" class="small">Approve</button>
|
|
42
|
+
<button id="permission-deny" class="small secondary">Deny</button>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<footer id="chat-footer">
|
|
46
|
+
<div id="chat-toggle">
|
|
47
|
+
<span id="chat-indicator">+</span>
|
|
48
|
+
<input type="text" id="general-input" placeholder="general comment...">
|
|
49
|
+
<button id="general-send" class="small">Send</button>
|
|
50
|
+
</div>
|
|
51
|
+
<div id="chat-history" class="hidden"></div>
|
|
52
|
+
</footer>
|
|
53
|
+
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/diff2html@3/bundles/js/diff2html.min.js"></script>
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/diff2html@3/bundles/js/diff2html-ui.min.js"></script>
|
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/marked@17/lib/marked.umd.js"></script>
|
|
57
|
+
<script src="/app.js"></script>
|
|
58
|
+
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
package/ui/style.css
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/* marginalia — own styles (no !important, no diff2html overrides)
|
|
2
|
+
diff2html overrides are in diff2html-theme.css */
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--mg-bg: #ffffff;
|
|
6
|
+
--mg-surface: #f6f8fa;
|
|
7
|
+
--mg-border: #d1d9e0;
|
|
8
|
+
--mg-border-light: #e8ecf0;
|
|
9
|
+
--mg-accent: #0969da;
|
|
10
|
+
--mg-text: #1f2328;
|
|
11
|
+
--mg-text-muted: #656d76;
|
|
12
|
+
--mg-comment-bg: #f6f8fa;
|
|
13
|
+
--mg-comment-user: #0969da;
|
|
14
|
+
--mg-comment-assistant: #3fb950;
|
|
15
|
+
--mg-btn-primary: #1a7f37;
|
|
16
|
+
--mg-btn-primary-hover: #15692e;
|
|
17
|
+
--mg-viewed-bg: #dafbe1;
|
|
18
|
+
--mg-viewed-border: #aceebb;
|
|
19
|
+
--mg-diff-del-line-bg: #ffebe9;
|
|
20
|
+
--mg-diff-del-gutter-bg: #ffcecb;
|
|
21
|
+
--mg-diff-del-word-bg: #ffcecb;
|
|
22
|
+
--mg-diff-ins-line-bg: #dafbe1;
|
|
23
|
+
--mg-diff-ins-gutter-bg: #aceebb;
|
|
24
|
+
--mg-diff-ins-word-bg: #aceebb;
|
|
25
|
+
--mg-diff-line-number-color: rgba(31, 35, 40, 0.38);
|
|
26
|
+
--mg-diff-hunk-text: #59636e;
|
|
27
|
+
--mg-permission-bg: #fff8c5;
|
|
28
|
+
--mg-permission-border: #d4a72c;
|
|
29
|
+
--mg-permission-text: #6f5200;
|
|
30
|
+
--mg-header-height: 40px;
|
|
31
|
+
--mg-footer-height: 44px;
|
|
32
|
+
--mg-mono: 'Monaspace Neon', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-theme="dark"] {
|
|
36
|
+
--mg-bg: #0d1117;
|
|
37
|
+
--mg-surface: #161b22;
|
|
38
|
+
--mg-border: #30363d;
|
|
39
|
+
--mg-border-light: #21262d;
|
|
40
|
+
--mg-accent: #58a6ff;
|
|
41
|
+
--mg-text: #e6edf3;
|
|
42
|
+
--mg-text-muted: #7d8590;
|
|
43
|
+
--mg-comment-bg: #161b22;
|
|
44
|
+
--mg-comment-user: #58a6ff;
|
|
45
|
+
--mg-comment-assistant: #3fb950;
|
|
46
|
+
--mg-btn-primary: #238636;
|
|
47
|
+
--mg-btn-primary-hover: #2ea043;
|
|
48
|
+
--mg-viewed-bg: rgba(46, 160, 67, 0.15);
|
|
49
|
+
--mg-viewed-border: rgba(46, 160, 67, 0.4);
|
|
50
|
+
--mg-diff-del-line-bg: rgba(248, 81, 73, 0.17);
|
|
51
|
+
--mg-diff-del-gutter-bg: rgba(248, 81, 73, 0.22);
|
|
52
|
+
--mg-diff-del-word-bg: rgba(248, 81, 73, 0.3);
|
|
53
|
+
--mg-diff-ins-line-bg: rgba(46, 160, 67, 0.22);
|
|
54
|
+
--mg-diff-ins-gutter-bg: rgba(46, 160, 67, 0.27);
|
|
55
|
+
--mg-diff-ins-word-bg: rgba(46, 160, 67, 0.32);
|
|
56
|
+
--mg-diff-line-number-color: var(--mg-text-muted);
|
|
57
|
+
--mg-diff-hunk-text: var(--mg-text-muted);
|
|
58
|
+
--mg-permission-bg: rgba(187, 128, 9, 0.15);
|
|
59
|
+
--mg-permission-border: #bb8009;
|
|
60
|
+
--mg-permission-text: #d29922;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
64
|
+
|
|
65
|
+
html, body {
|
|
66
|
+
height: 100%;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
background: var(--mg-bg);
|
|
69
|
+
color: var(--mg-text);
|
|
70
|
+
font-family: 'Mona Sans VF', -apple-system, system-ui, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
line-height: 1.5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
body { display: flex; flex-direction: column; }
|
|
76
|
+
|
|
77
|
+
/* --- Header --- */
|
|
78
|
+
|
|
79
|
+
#header {
|
|
80
|
+
height: var(--mg-header-height);
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 8px;
|
|
84
|
+
padding: 0 16px;
|
|
85
|
+
background: var(--mg-surface);
|
|
86
|
+
border-bottom: 1px solid var(--mg-border);
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
user-select: none;
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#header .brand { font-weight: 600; }
|
|
93
|
+
#header .sep { color: var(--mg-border); }
|
|
94
|
+
#header #project-dir { color: var(--mg-text); font-size: 14px; font-weight: 400; }
|
|
95
|
+
#header #status { color: var(--mg-text-muted); margin-left: auto; }
|
|
96
|
+
|
|
97
|
+
#theme-toggle {
|
|
98
|
+
background: none; border: none; cursor: pointer;
|
|
99
|
+
color: var(--mg-text-muted); font-size: 16px; padding: 2px 4px;
|
|
100
|
+
line-height: 1;
|
|
101
|
+
}
|
|
102
|
+
#theme-toggle:hover { color: var(--mg-text); }
|
|
103
|
+
|
|
104
|
+
/* --- Diff container --- */
|
|
105
|
+
|
|
106
|
+
/* --- File nav --- */
|
|
107
|
+
|
|
108
|
+
#filenav {
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
max-height: 30vh;
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
border-bottom: 1px solid var(--mg-border);
|
|
113
|
+
background: var(--mg-surface);
|
|
114
|
+
padding: 4px 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#filenav.hidden { display: none; }
|
|
118
|
+
|
|
119
|
+
.filenav-item {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: 6px;
|
|
123
|
+
padding: 3px 16px;
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
font-family: inherit;
|
|
126
|
+
color: var(--mg-text);
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.filenav-item:hover { background: var(--mg-border-light); }
|
|
132
|
+
.filenav-item .filenav-badge { font-size: 10px; padding: 1px 5px; border-radius: 4px; font-family: inherit; }
|
|
133
|
+
.filenav-badge-added { background: var(--mg-viewed-bg); color: var(--mg-comment-assistant); }
|
|
134
|
+
.filenav-badge-changed { background: rgba(9, 105, 218, 0.1); color: var(--mg-accent); }
|
|
135
|
+
.filenav-badge-deleted { background: rgba(248, 81, 73, 0.1); color: #cf222e; }
|
|
136
|
+
[data-theme="dark"] .filenav-badge-deleted { color: #f85149; }
|
|
137
|
+
.filenav-item.filenav-viewed { opacity: 0.5; }
|
|
138
|
+
|
|
139
|
+
#file-count {
|
|
140
|
+
background: none; border: none; cursor: pointer;
|
|
141
|
+
color: var(--mg-text); font-size: 14px; font-family: inherit; padding: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#file-count:hover { color: var(--mg-text); text-decoration: underline; }
|
|
145
|
+
#file-count.active { color: var(--mg-text); }
|
|
146
|
+
|
|
147
|
+
/* --- Context snippets --- */
|
|
148
|
+
|
|
149
|
+
#context-snippets:empty { display: none; }
|
|
150
|
+
|
|
151
|
+
.context-snippet {
|
|
152
|
+
margin: 8px 16px;
|
|
153
|
+
border: 1px solid var(--mg-accent);
|
|
154
|
+
border-radius: 6px;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
background: var(--mg-bg);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.context-snippet-header {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
gap: 8px;
|
|
163
|
+
padding: 4px 8px;
|
|
164
|
+
background: var(--mg-surface);
|
|
165
|
+
border-bottom: 1px solid var(--mg-border);
|
|
166
|
+
font-size: 12px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.context-snippet-file { font-family: var(--mg-mono); color: var(--mg-accent); }
|
|
170
|
+
.context-snippet-label { color: var(--mg-text-muted); font-style: italic; }
|
|
171
|
+
.context-snippet-header .comment-dismiss { margin-left: auto; }
|
|
172
|
+
|
|
173
|
+
.context-snippet-code {
|
|
174
|
+
margin: 0;
|
|
175
|
+
padding: 4px 0;
|
|
176
|
+
font-family: var(--mg-mono);
|
|
177
|
+
font-size: 12px;
|
|
178
|
+
line-height: 18px;
|
|
179
|
+
overflow-x: auto;
|
|
180
|
+
background: var(--mg-bg);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.context-snippet-code code { background: none; padding: 0; font-size: inherit; }
|
|
184
|
+
|
|
185
|
+
.context-ln {
|
|
186
|
+
display: inline-block;
|
|
187
|
+
width: 4ch;
|
|
188
|
+
text-align: right;
|
|
189
|
+
color: var(--mg-text-muted);
|
|
190
|
+
padding-right: 8px;
|
|
191
|
+
margin-right: 8px;
|
|
192
|
+
border-right: 1px solid var(--mg-border);
|
|
193
|
+
user-select: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* --- Diff container --- */
|
|
197
|
+
|
|
198
|
+
#diff-container { flex: 1; overflow-y: auto; overflow-x: hidden; }
|
|
199
|
+
|
|
200
|
+
#loading-state, #empty-state {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
height: 100%;
|
|
206
|
+
color: var(--mg-text-muted);
|
|
207
|
+
font-size: 14px;
|
|
208
|
+
gap: 12px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
#loading-state.hidden, #empty-state.hidden { display: none; }
|
|
212
|
+
|
|
213
|
+
.spinner {
|
|
214
|
+
width: 24px; height: 24px;
|
|
215
|
+
border: 3px solid var(--mg-border);
|
|
216
|
+
border-top-color: var(--mg-accent);
|
|
217
|
+
border-radius: 50%;
|
|
218
|
+
animation: spin 0.8s linear infinite;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
222
|
+
|
|
223
|
+
/* --- Gutter affordance --- */
|
|
224
|
+
|
|
225
|
+
.d2h-diff-tbody tr { position: relative; }
|
|
226
|
+
.d2h-diff-tbody tr .d2h-code-linenumber { position: relative !important; }
|
|
227
|
+
|
|
228
|
+
.d2h-diff-tbody tr .d2h-code-linenumber::after {
|
|
229
|
+
content: '+';
|
|
230
|
+
position: absolute;
|
|
231
|
+
right: -16px; top: 50%;
|
|
232
|
+
transform: translateY(-50%);
|
|
233
|
+
width: 20px; height: 20px; line-height: 20px;
|
|
234
|
+
text-align: center;
|
|
235
|
+
font-size: 15px !important; font-weight: 700;
|
|
236
|
+
color: #fff;
|
|
237
|
+
background: var(--mg-accent);
|
|
238
|
+
border-radius: 3px;
|
|
239
|
+
opacity: 0;
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
transition: opacity 0.1s;
|
|
242
|
+
z-index: 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.d2h-diff-tbody tr:hover .d2h-code-linenumber::after { opacity: 1; }
|
|
246
|
+
.d2h-diff-tbody tr.d2h-info:hover .d2h-code-linenumber::after { opacity: 0; }
|
|
247
|
+
.d2h-diff-tbody tr:hover .d2h-code-linenumber { background: rgba(9, 105, 218, 0.1) !important; }
|
|
248
|
+
.d2h-diff-tbody tr.d2h-info:hover .d2h-code-linenumber { background: inherit !important; }
|
|
249
|
+
|
|
250
|
+
.d2h-diff-tbody tr.mg-commenting td {
|
|
251
|
+
background: rgba(9, 105, 218, 0.06) !important;
|
|
252
|
+
box-shadow: inset 2px 0 0 var(--mg-accent);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* --- Viewed toggle --- */
|
|
256
|
+
|
|
257
|
+
.mg-viewed-toggle {
|
|
258
|
+
margin-left: auto;
|
|
259
|
+
padding: 3px 10px;
|
|
260
|
+
font-size: 12px; font-family: inherit;
|
|
261
|
+
border-radius: 6px;
|
|
262
|
+
border: 1px solid var(--mg-border);
|
|
263
|
+
background: var(--mg-bg);
|
|
264
|
+
color: var(--mg-text-muted);
|
|
265
|
+
cursor: pointer;
|
|
266
|
+
user-select: none;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.mg-viewed-toggle:hover { background: var(--mg-surface); border-color: var(--mg-text-muted); }
|
|
270
|
+
.mg-viewed-toggle.viewed { background: var(--mg-viewed-bg); color: var(--mg-comment-assistant); border-color: var(--mg-viewed-border); }
|
|
271
|
+
|
|
272
|
+
.mg-file-comment {
|
|
273
|
+
padding: 3px 6px;
|
|
274
|
+
border-radius: 6px;
|
|
275
|
+
border: 1px solid transparent;
|
|
276
|
+
background: transparent;
|
|
277
|
+
color: var(--mg-text-muted);
|
|
278
|
+
cursor: pointer;
|
|
279
|
+
user-select: none;
|
|
280
|
+
margin-left: 6px;
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.mg-file-comment:hover { background: var(--mg-surface); border-color: var(--mg-border); }
|
|
286
|
+
|
|
287
|
+
.mg-copy-path {
|
|
288
|
+
padding: 3px 6px;
|
|
289
|
+
border-radius: 6px;
|
|
290
|
+
border: 1px solid transparent;
|
|
291
|
+
background: transparent;
|
|
292
|
+
color: var(--mg-text-muted);
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
user-select: none;
|
|
295
|
+
display: inline-flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
margin-left: 6px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.mg-copy-path:hover { background: var(--mg-surface); border-color: var(--mg-border); }
|
|
301
|
+
.mg-copy-path.mg-copied { color: var(--mg-comment-assistant); }
|
|
302
|
+
|
|
303
|
+
/* --- Inline comments --- */
|
|
304
|
+
|
|
305
|
+
.comment-input-row td, .comment-thread-row td {
|
|
306
|
+
padding: 0 !important;
|
|
307
|
+
background: var(--mg-bg) !important;
|
|
308
|
+
border: none !important;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.comment-input-box, .comment-thread {
|
|
312
|
+
background: var(--mg-comment-bg);
|
|
313
|
+
border: 1px solid var(--mg-border);
|
|
314
|
+
border-radius: 6px;
|
|
315
|
+
margin: 4px 12px;
|
|
316
|
+
padding: 8px 12px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.comment-input-context { font-size: 12px; color: var(--mg-text-muted); margin-bottom: 6px; font-family: var(--mg-mono); }
|
|
320
|
+
.mg-textarea {
|
|
321
|
+
width: 100%;
|
|
322
|
+
background: var(--mg-bg); color: var(--mg-text);
|
|
323
|
+
border: 1px solid var(--mg-border); border-radius: 6px;
|
|
324
|
+
padding: 8px 10px;
|
|
325
|
+
font-family: inherit; font-size: 13px; line-height: 1.5;
|
|
326
|
+
resize: vertical; outline: none;
|
|
327
|
+
}
|
|
328
|
+
.mg-textarea:focus { border-color: var(--mg-accent); box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15); }
|
|
329
|
+
.comment-input-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
|
|
330
|
+
|
|
331
|
+
.comment-message { padding: 2px 0; line-height: 1.3; font-size: 13px; }
|
|
332
|
+
.comment-message + .comment-message { margin-top: 3px; padding-top: 4px; border-top: 1px solid var(--mg-border-light); }
|
|
333
|
+
.comment-user > strong { color: var(--mg-comment-user); font-size: 12px; }
|
|
334
|
+
.comment-assistant > strong { color: var(--mg-comment-assistant); font-size: 12px; }
|
|
335
|
+
.comment-dismiss {
|
|
336
|
+
float: right;
|
|
337
|
+
background: none; border: none; cursor: pointer;
|
|
338
|
+
color: var(--mg-text-muted); font-size: 16px; line-height: 1;
|
|
339
|
+
padding: 0 2px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.comment-dismiss:hover { color: var(--mg-text); }
|
|
343
|
+
|
|
344
|
+
.thread-reply-box {
|
|
345
|
+
margin-top: 6px; padding-top: 6px;
|
|
346
|
+
border-top: 1px solid var(--mg-border-light);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
/* Shared markdown content styles */
|
|
352
|
+
|
|
353
|
+
.mg-md { white-space: normal; line-height: 1.3; color: var(--mg-text) !important; }
|
|
354
|
+
.mg-md strong { color: var(--mg-text); }
|
|
355
|
+
.mg-md p { margin: 0.1em 0; }
|
|
356
|
+
.mg-md ul, .mg-md ol { padding-left: 1.4em; margin: 0; line-height: 1.2; }
|
|
357
|
+
.mg-md li { margin: 0; padding: 0; }
|
|
358
|
+
.mg-md li > p { margin: 0; display: inline; }
|
|
359
|
+
.mg-md code { background: var(--mg-surface); padding: 1px 3px; border-radius: 3px; font-family: var(--mg-mono); font-size: 13px; }
|
|
360
|
+
.mg-md pre { background: var(--mg-surface); padding: 4px 6px; border-radius: 4px; overflow-x: auto; margin: 2px 0; line-height: 1.2; }
|
|
361
|
+
.mg-md pre code { background: none; padding: 0; }
|
|
362
|
+
|
|
363
|
+
.comment-ephemeral, .chat-ephemeral { opacity: 0.6; font-style: italic; }
|
|
364
|
+
|
|
365
|
+
/* --- Permission bar --- */
|
|
366
|
+
|
|
367
|
+
#permission-bar {
|
|
368
|
+
display: flex; align-items: center; gap: 10px;
|
|
369
|
+
padding: 8px 16px;
|
|
370
|
+
background: var(--mg-permission-bg); border-top: 1px solid var(--mg-permission-border);
|
|
371
|
+
font-size: 13px; flex-shrink: 0;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
#permission-bar.hidden { display: none; }
|
|
375
|
+
#permission-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mg-permission-text); }
|
|
376
|
+
#permission-approve { background: var(--mg-btn-primary); color: #fff; }
|
|
377
|
+
#permission-deny { background: var(--mg-bg); color: var(--mg-text); border-color: var(--mg-border); }
|
|
378
|
+
|
|
379
|
+
/* --- Chat footer --- */
|
|
380
|
+
|
|
381
|
+
#chat-footer { flex-shrink: 0; border-top: 1px solid var(--mg-border); background: var(--mg-surface); }
|
|
382
|
+
|
|
383
|
+
#chat-toggle {
|
|
384
|
+
display: flex; align-items: center; gap: 8px;
|
|
385
|
+
padding: 6px 16px; height: var(--mg-footer-height); cursor: pointer;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
#chat-indicator { color: var(--mg-text-muted); font-weight: 700; width: 16px; text-align: center; user-select: none; }
|
|
389
|
+
|
|
390
|
+
#general-input {
|
|
391
|
+
flex: 1;
|
|
392
|
+
background: var(--mg-bg); color: var(--mg-text);
|
|
393
|
+
border: 1px solid var(--mg-border); border-radius: 6px;
|
|
394
|
+
padding: 5px 10px;
|
|
395
|
+
font-family: inherit; font-size: 13px; outline: none;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
#general-input:focus { border-color: var(--mg-accent); box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15); }
|
|
399
|
+
|
|
400
|
+
#chat-history { max-height: 200px; overflow-y: auto; padding: 8px 16px; border-top: 1px solid var(--mg-border); }
|
|
401
|
+
#chat-history.hidden { display: none; }
|
|
402
|
+
|
|
403
|
+
.chat-message { padding: 3px 0; line-height: 1.3; font-size: 13px; }
|
|
404
|
+
.chat-you > strong { color: var(--mg-comment-user); }
|
|
405
|
+
.chat-assistant > strong { color: var(--mg-comment-assistant); }
|
|
406
|
+
|
|
407
|
+
/* --- Buttons --- */
|
|
408
|
+
|
|
409
|
+
button.small {
|
|
410
|
+
padding: 4px 12px;
|
|
411
|
+
font-size: 12px; font-family: inherit; font-weight: 500;
|
|
412
|
+
border-radius: 6px; border: 1px solid rgba(27, 31, 36, 0.15);
|
|
413
|
+
background: var(--mg-btn-primary); color: #fff;
|
|
414
|
+
cursor: pointer; line-height: 1.4; white-space: nowrap;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
button.small:hover { background: var(--mg-btn-primary-hover); }
|
|
418
|
+
button.small.secondary { background: var(--mg-surface); color: var(--mg-text); border: 1px solid var(--mg-border); }
|
|
419
|
+
button.small.secondary:hover { background: var(--mg-border-light); }
|
|
420
|
+
|
|
421
|
+
/* --- Scrollbar --- */
|
|
422
|
+
|
|
423
|
+
::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
424
|
+
::-webkit-scrollbar-track { background: var(--mg-bg); }
|
|
425
|
+
::-webkit-scrollbar-thumb { background: var(--mg-border); border-radius: 4px; }
|
|
426
|
+
::-webkit-scrollbar-thumb:hover { background: var(--mg-text-muted); }
|