@autocode-cli/autocode 0.1.33 → 0.1.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/server/dashboard/pages/index.d.ts +3 -0
- package/dist/server/dashboard/pages/index.d.ts.map +1 -1
- package/dist/server/dashboard/pages/index.js +3 -0
- package/dist/server/dashboard/pages/index.js.map +1 -1
- package/dist/server/dashboard/pages/issue-comments.d.ts +8 -0
- package/dist/server/dashboard/pages/issue-comments.d.ts.map +1 -0
- package/dist/server/dashboard/pages/issue-comments.js +283 -0
- package/dist/server/dashboard/pages/issue-comments.js.map +1 -0
- package/dist/server/dashboard/pages/issue-history.d.ts +8 -0
- package/dist/server/dashboard/pages/issue-history.d.ts.map +1 -0
- package/dist/server/dashboard/pages/issue-history.js +149 -0
- package/dist/server/dashboard/pages/issue-history.js.map +1 -0
- package/dist/server/dashboard/pages/issue-shared.d.ts +27 -0
- package/dist/server/dashboard/pages/issue-shared.d.ts.map +1 -0
- package/dist/server/dashboard/pages/issue-shared.js +365 -0
- package/dist/server/dashboard/pages/issue-shared.js.map +1 -0
- package/dist/server/dashboard/pages/issue-terminal.d.ts +8 -0
- package/dist/server/dashboard/pages/issue-terminal.d.ts.map +1 -0
- package/dist/server/dashboard/pages/issue-terminal.js +363 -0
- package/dist/server/dashboard/pages/issue-terminal.js.map +1 -0
- package/dist/server/dashboard/pages/issue-view.d.ts +2 -2
- package/dist/server/dashboard/pages/issue-view.d.ts.map +1 -1
- package/dist/server/dashboard/pages/issue-view.js +49 -1027
- package/dist/server/dashboard/pages/issue-view.js.map +1 -1
- package/dist/server/dashboard.d.ts +1 -1
- package/dist/server/dashboard.d.ts.map +1 -1
- package/dist/server/dashboard.js +1 -1
- package/dist/server/dashboard.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +35 -5
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -1
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
export { generateDashboard } from './main-dashboard.js';
|
|
7
7
|
export { generateColumnEditPage } from './column-edit.js';
|
|
8
8
|
export { generateIssueViewPage } from './issue-view.js';
|
|
9
|
+
export { generateIssueCommentsPage } from './issue-comments.js';
|
|
10
|
+
export { generateIssueHistoryPage } from './issue-history.js';
|
|
11
|
+
export { generateIssueTerminalPage } from './issue-terminal.js';
|
|
9
12
|
export { generateColumnTerminalPage } from './column-terminal.js';
|
|
10
13
|
export { generateColumnPromptPage } from './column-prompt.js';
|
|
11
14
|
export { generatePipelineConfiguratorPage } from './pipeline-configurator.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
export { generateDashboard } from './main-dashboard.js';
|
|
7
7
|
export { generateColumnEditPage } from './column-edit.js';
|
|
8
8
|
export { generateIssueViewPage } from './issue-view.js';
|
|
9
|
+
export { generateIssueCommentsPage } from './issue-comments.js';
|
|
10
|
+
export { generateIssueHistoryPage } from './issue-history.js';
|
|
11
|
+
export { generateIssueTerminalPage } from './issue-terminal.js';
|
|
9
12
|
export { generateColumnTerminalPage } from './column-terminal.js';
|
|
10
13
|
export { generateColumnPromptPage } from './column-prompt.js';
|
|
11
14
|
export { generatePipelineConfiguratorPage } from './pipeline-configurator.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-comments.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkRhF"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue comments page generator
|
|
3
|
+
*/
|
|
4
|
+
import { getConfig } from '../../../utils/config.js';
|
|
5
|
+
import { getIssue } from '../../../core/issue.js';
|
|
6
|
+
import { escapeHtml } from '../utils.js';
|
|
7
|
+
import { generate404Page } from './shared.js';
|
|
8
|
+
import { generateIssueBaseStyles, generateIssueHeader, generateTabsNav, generateIssueBaseScript, } from './issue-shared.js';
|
|
9
|
+
/**
|
|
10
|
+
* Generate the issue comments page
|
|
11
|
+
*/
|
|
12
|
+
export function generateIssueCommentsPage(issueKey, lang) {
|
|
13
|
+
const config = getConfig();
|
|
14
|
+
const issue = getIssue(config.root, issueKey);
|
|
15
|
+
if (!issue) {
|
|
16
|
+
return generate404Page(issueKey, lang);
|
|
17
|
+
}
|
|
18
|
+
const pageData = {
|
|
19
|
+
issueKey,
|
|
20
|
+
title: issue.title,
|
|
21
|
+
commentsCount: issue.comments?.length || 0,
|
|
22
|
+
historyCount: issue.history?.length || 0,
|
|
23
|
+
lang,
|
|
24
|
+
};
|
|
25
|
+
const commentsData = JSON.stringify(issue.comments || []);
|
|
26
|
+
return `<!DOCTYPE html>
|
|
27
|
+
<html lang="${lang}">
|
|
28
|
+
<head>
|
|
29
|
+
<meta charset="UTF-8">
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
31
|
+
<title>Comments - ${escapeHtml(issue.title)} - ${issueKey} - AutoCode</title>
|
|
32
|
+
<style>
|
|
33
|
+
${generateIssueBaseStyles()}
|
|
34
|
+
|
|
35
|
+
.comments-list {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 12px;
|
|
39
|
+
margin-bottom: 16px;
|
|
40
|
+
}
|
|
41
|
+
.comment {
|
|
42
|
+
padding: 16px;
|
|
43
|
+
background: var(--bg-tertiary);
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
border-left: 3px solid var(--border);
|
|
46
|
+
transition: all 0.2s ease;
|
|
47
|
+
}
|
|
48
|
+
.comment:hover {
|
|
49
|
+
border-left-color: var(--blue);
|
|
50
|
+
}
|
|
51
|
+
.comment-meta {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
user-select: none;
|
|
58
|
+
}
|
|
59
|
+
.comment-meta::before {
|
|
60
|
+
content: '▶';
|
|
61
|
+
font-size: 10px;
|
|
62
|
+
color: var(--muted);
|
|
63
|
+
transition: transform 0.2s ease;
|
|
64
|
+
}
|
|
65
|
+
.comment.expanded .comment-meta::before {
|
|
66
|
+
transform: rotate(90deg);
|
|
67
|
+
}
|
|
68
|
+
.comment-source {
|
|
69
|
+
font-size: 10px;
|
|
70
|
+
padding: 3px 8px;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
text-transform: uppercase;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
letter-spacing: 0.5px;
|
|
75
|
+
}
|
|
76
|
+
.comment-source.user { background: #3b82f6; color: white; }
|
|
77
|
+
.comment-source.claude { background: #8b5cf6; color: white; }
|
|
78
|
+
.comment-column {
|
|
79
|
+
font-size: 10px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
text-transform: uppercase;
|
|
82
|
+
letter-spacing: 0.5px;
|
|
83
|
+
color: var(--blue);
|
|
84
|
+
padding: 3px 8px;
|
|
85
|
+
background: rgba(77,171,247,0.15);
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
}
|
|
88
|
+
.comment-date {
|
|
89
|
+
font-size: 11px;
|
|
90
|
+
color: var(--muted);
|
|
91
|
+
}
|
|
92
|
+
.comment-text {
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
line-height: 1.6;
|
|
95
|
+
color: var(--text);
|
|
96
|
+
max-height: 0;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
transition: max-height 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
|
|
99
|
+
margin-top: 0;
|
|
100
|
+
padding-top: 0;
|
|
101
|
+
}
|
|
102
|
+
.comment.expanded .comment-text {
|
|
103
|
+
max-height: none;
|
|
104
|
+
overflow: visible;
|
|
105
|
+
margin-top: 12px;
|
|
106
|
+
padding-top: 12px;
|
|
107
|
+
border-top: 1px solid var(--border);
|
|
108
|
+
}
|
|
109
|
+
.comment-text code {
|
|
110
|
+
background: var(--bg);
|
|
111
|
+
padding: 2px 6px;
|
|
112
|
+
border-radius: 4px;
|
|
113
|
+
font-family: 'SF Mono', Monaco, monospace;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
}
|
|
116
|
+
.add-comment {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
gap: 8px;
|
|
120
|
+
margin-top: 20px;
|
|
121
|
+
padding-top: 20px;
|
|
122
|
+
border-top: 1px solid var(--border);
|
|
123
|
+
}
|
|
124
|
+
.add-comment textarea {
|
|
125
|
+
width: 100%;
|
|
126
|
+
min-height: 120px;
|
|
127
|
+
padding: 12px;
|
|
128
|
+
background: var(--bg-tertiary);
|
|
129
|
+
border: 1px solid var(--border);
|
|
130
|
+
border-radius: 8px;
|
|
131
|
+
color: var(--text);
|
|
132
|
+
font-family: inherit;
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
resize: vertical;
|
|
135
|
+
}
|
|
136
|
+
.add-comment textarea:focus {
|
|
137
|
+
outline: none;
|
|
138
|
+
border-color: var(--accent);
|
|
139
|
+
}
|
|
140
|
+
.btn-comment {
|
|
141
|
+
align-self: flex-end;
|
|
142
|
+
padding: 10px 20px;
|
|
143
|
+
background: var(--accent);
|
|
144
|
+
color: white;
|
|
145
|
+
border: none;
|
|
146
|
+
border-radius: 6px;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
font-weight: 500;
|
|
150
|
+
}
|
|
151
|
+
.btn-comment:hover { opacity: 0.9; }
|
|
152
|
+
.btn-comment:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
153
|
+
.no-comments {
|
|
154
|
+
text-align: center;
|
|
155
|
+
color: var(--muted);
|
|
156
|
+
padding: 40px;
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
160
|
+
</head>
|
|
161
|
+
<body>
|
|
162
|
+
${generateIssueHeader(issueKey, issue.title)}
|
|
163
|
+
${generateTabsNav(issueKey, 'comments', pageData)}
|
|
164
|
+
|
|
165
|
+
<main class="main-content">
|
|
166
|
+
<div class="section">
|
|
167
|
+
<div class="section-title">
|
|
168
|
+
<span data-i18n="issueView.comments">Comments</span>
|
|
169
|
+
<span id="comments-count">(${issue.comments?.length || 0})</span>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="comments-list" id="comments-list"></div>
|
|
172
|
+
<div class="add-comment">
|
|
173
|
+
<textarea id="new-comment" placeholder="Add a comment..." data-i18n-placeholder="issueView.addComment"></textarea>
|
|
174
|
+
<button class="btn-comment" onclick="addComment()" data-i18n="btn.add">Add</button>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</main>
|
|
178
|
+
|
|
179
|
+
<div class="notification" id="notification"></div>
|
|
180
|
+
|
|
181
|
+
<script>
|
|
182
|
+
${generateIssueBaseScript(issueKey)}
|
|
183
|
+
|
|
184
|
+
let currentComments = ${commentsData};
|
|
185
|
+
|
|
186
|
+
function renderComments() {
|
|
187
|
+
const list = document.getElementById('comments-list');
|
|
188
|
+
const count = document.getElementById('comments-count');
|
|
189
|
+
count.textContent = '(' + currentComments.length + ')';
|
|
190
|
+
|
|
191
|
+
if (currentComments.length === 0) {
|
|
192
|
+
list.innerHTML = '<div class="no-comments">' + t('issueView.noComments') + '</div>';
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const sorted = [...currentComments].sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
|
197
|
+
list.innerHTML = sorted.map((comment, index) => {
|
|
198
|
+
const date = new Date(comment.created_at);
|
|
199
|
+
const dateStr = date.toLocaleDateString('en-US', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
|
200
|
+
const source = comment.source || 'user';
|
|
201
|
+
const sourceBadge = source === 'claude'
|
|
202
|
+
? '<span class="comment-source claude">Claude</span>'
|
|
203
|
+
: '<span class="comment-source user">User</span>';
|
|
204
|
+
return '<div class="comment expanded" id="comment-' + index + '">' +
|
|
205
|
+
'<div class="comment-meta" onclick="toggleComment(' + index + ')">' + sourceBadge + '<span class="comment-column">' + (comment.column || 'N/A') + '</span>' +
|
|
206
|
+
'<span class="comment-date">' + dateStr + '</span></div>' +
|
|
207
|
+
'<div class="comment-text">' + renderMarkdown(comment.text) + '</div></div>';
|
|
208
|
+
}).join('');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function toggleComment(index) {
|
|
212
|
+
const comments = document.querySelectorAll('.comment');
|
|
213
|
+
comments.forEach((comment, i) => {
|
|
214
|
+
if (i === index) {
|
|
215
|
+
comment.classList.toggle('expanded');
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function addComment() {
|
|
221
|
+
const textarea = document.getElementById('new-comment');
|
|
222
|
+
const text = textarea.value.trim();
|
|
223
|
+
if (!text) return;
|
|
224
|
+
|
|
225
|
+
const btn = document.querySelector('.btn-comment');
|
|
226
|
+
btn.disabled = true;
|
|
227
|
+
btn.textContent = t('btn.sending');
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
const res = await fetch('/api/issues/' + ISSUE_KEY + '/comments', {
|
|
231
|
+
method: 'POST',
|
|
232
|
+
headers: { 'Content-Type': 'application/json' },
|
|
233
|
+
body: JSON.stringify({ text, source: 'user' })
|
|
234
|
+
});
|
|
235
|
+
const result = await res.json();
|
|
236
|
+
textarea.value = '';
|
|
237
|
+
if (result.success && result.data && result.data.comments) {
|
|
238
|
+
currentComments = result.data.comments;
|
|
239
|
+
renderComments();
|
|
240
|
+
}
|
|
241
|
+
showNotification(t('notify.commentAdded'));
|
|
242
|
+
} catch (e) {
|
|
243
|
+
showNotification(t('notify.error') + ': ' + e.message, true);
|
|
244
|
+
} finally {
|
|
245
|
+
btn.disabled = false;
|
|
246
|
+
btn.textContent = t('btn.add');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function onLangChange() {
|
|
251
|
+
renderComments();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// WebSocket for real-time updates
|
|
255
|
+
let ws;
|
|
256
|
+
function connectWebSocket() {
|
|
257
|
+
const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
258
|
+
ws = new WebSocket(protocol + '//' + location.host + '/ws');
|
|
259
|
+
|
|
260
|
+
ws.onmessage = (event) => {
|
|
261
|
+
try {
|
|
262
|
+
const data = JSON.parse(event.data);
|
|
263
|
+
if (data.type === 'issue_updated' && data.key === ISSUE_KEY) {
|
|
264
|
+
location.reload();
|
|
265
|
+
}
|
|
266
|
+
} catch (e) {
|
|
267
|
+
console.error('WebSocket message error:', e);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
ws.onclose = () => {
|
|
272
|
+
setTimeout(connectWebSocket, 3000);
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Init
|
|
277
|
+
renderComments();
|
|
278
|
+
connectWebSocket();
|
|
279
|
+
</script>
|
|
280
|
+
</body>
|
|
281
|
+
</html>`;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=issue-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-comments.js","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,uBAAuB,GAExB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAgB,EAAE,IAAY;IACtE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAkB;QAC9B,QAAQ;QACR,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,aAAa,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;QAC1C,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;QACxC,IAAI;KACL,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAE1D,OAAO;cACK,IAAI;;;;sBAII,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,QAAQ;;MAErD,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiI3B,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC;IAC1C,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC;;;;;;qCAMd,KAAK,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;;;;;;;;;;;;;MAa1D,uBAAuB,CAAC,QAAQ,CAAC;;4BAEX,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiGhC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-history.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA4I/E"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue history page generator
|
|
3
|
+
*/
|
|
4
|
+
import { getConfig } from '../../../utils/config.js';
|
|
5
|
+
import { getIssue } from '../../../core/issue.js';
|
|
6
|
+
import { escapeHtml } from '../utils.js';
|
|
7
|
+
import { generate404Page } from './shared.js';
|
|
8
|
+
import { generateIssueBaseStyles, generateIssueHeader, generateTabsNav, generateIssueBaseScript, } from './issue-shared.js';
|
|
9
|
+
/**
|
|
10
|
+
* Generate the issue history page
|
|
11
|
+
*/
|
|
12
|
+
export function generateIssueHistoryPage(issueKey, lang) {
|
|
13
|
+
const config = getConfig();
|
|
14
|
+
const issue = getIssue(config.root, issueKey);
|
|
15
|
+
if (!issue) {
|
|
16
|
+
return generate404Page(issueKey, lang);
|
|
17
|
+
}
|
|
18
|
+
const pageData = {
|
|
19
|
+
issueKey,
|
|
20
|
+
title: issue.title,
|
|
21
|
+
commentsCount: issue.comments?.length || 0,
|
|
22
|
+
historyCount: issue.history?.length || 0,
|
|
23
|
+
lang,
|
|
24
|
+
};
|
|
25
|
+
const historyHtml = issue.history && issue.history.length > 0
|
|
26
|
+
? issue.history.map((h) => {
|
|
27
|
+
const date = new Date(h.at);
|
|
28
|
+
const dateStr = date.toLocaleDateString('en-US', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
|
29
|
+
const showPromptBtn = h.to && h.action !== 'created' ? `<a href="/issue/${issueKey}/${escapeHtml(h.to)}/prompt" class="btn-action" title="View prompt">View Prompt</a>` : '';
|
|
30
|
+
const showLogBtn = h.to && h.action !== 'created' ? `<a href="/issue/${issueKey}/${escapeHtml(h.to)}/terminal" class="btn-action" title="View terminal log">View Terminal</a>` : '';
|
|
31
|
+
return `<li class="history-item">
|
|
32
|
+
<div class="history-main">
|
|
33
|
+
<span class="history-action history-action-${h.action}">${h.action}</span>
|
|
34
|
+
${h.from ? `<span class="history-from">${escapeHtml(h.from)}</span> <span class="history-arrow">→</span>` : ''}
|
|
35
|
+
<span class="history-to">${escapeHtml(h.to)}</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="history-actions">
|
|
38
|
+
${showPromptBtn}
|
|
39
|
+
${showLogBtn}
|
|
40
|
+
</div>
|
|
41
|
+
<span class="history-date">${dateStr}</span>
|
|
42
|
+
</li>`;
|
|
43
|
+
}).join('')
|
|
44
|
+
: '<li class="no-history">No history yet</li>';
|
|
45
|
+
return `<!DOCTYPE html>
|
|
46
|
+
<html lang="${lang}">
|
|
47
|
+
<head>
|
|
48
|
+
<meta charset="UTF-8">
|
|
49
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
50
|
+
<title>History - ${escapeHtml(issue.title)} - ${issueKey} - AutoCode</title>
|
|
51
|
+
<style>
|
|
52
|
+
${generateIssueBaseStyles()}
|
|
53
|
+
|
|
54
|
+
.history-list {
|
|
55
|
+
list-style: none;
|
|
56
|
+
}
|
|
57
|
+
.history-item {
|
|
58
|
+
padding: 16px;
|
|
59
|
+
background: var(--bg-tertiary);
|
|
60
|
+
border-radius: 8px;
|
|
61
|
+
margin-bottom: 12px;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 16px;
|
|
65
|
+
flex-wrap: wrap;
|
|
66
|
+
}
|
|
67
|
+
.history-main {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 8px;
|
|
71
|
+
flex: 1;
|
|
72
|
+
}
|
|
73
|
+
.history-action {
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
text-transform: capitalize;
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
padding: 4px 10px;
|
|
78
|
+
border-radius: 4px;
|
|
79
|
+
}
|
|
80
|
+
.history-action-created { background: rgba(74, 222, 128, 0.2); color: var(--green); }
|
|
81
|
+
.history-action-moved { background: rgba(77, 171, 247, 0.2); color: var(--blue); }
|
|
82
|
+
.history-action-started { background: rgba(250, 204, 21, 0.2); color: var(--yellow); }
|
|
83
|
+
.history-action-forced { background: rgba(251, 146, 60, 0.2); color: var(--orange); }
|
|
84
|
+
.history-from, .history-to {
|
|
85
|
+
padding: 4px 10px;
|
|
86
|
+
background: var(--bg-secondary);
|
|
87
|
+
border-radius: 4px;
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
font-family: 'SF Mono', Monaco, monospace;
|
|
90
|
+
}
|
|
91
|
+
.history-arrow {
|
|
92
|
+
color: var(--muted);
|
|
93
|
+
}
|
|
94
|
+
.history-actions {
|
|
95
|
+
display: flex;
|
|
96
|
+
gap: 8px;
|
|
97
|
+
}
|
|
98
|
+
.btn-action {
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
padding: 6px 12px;
|
|
101
|
+
background: var(--bg-secondary);
|
|
102
|
+
color: var(--accent);
|
|
103
|
+
border: 1px solid var(--border);
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
transition: all 0.2s;
|
|
107
|
+
}
|
|
108
|
+
.btn-action:hover {
|
|
109
|
+
border-color: var(--accent);
|
|
110
|
+
background: rgba(99, 102, 241, 0.1);
|
|
111
|
+
}
|
|
112
|
+
.history-date {
|
|
113
|
+
color: var(--muted);
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
}
|
|
117
|
+
.no-history {
|
|
118
|
+
text-align: center;
|
|
119
|
+
color: var(--muted);
|
|
120
|
+
padding: 40px;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
</head>
|
|
125
|
+
<body>
|
|
126
|
+
${generateIssueHeader(issueKey, issue.title)}
|
|
127
|
+
${generateTabsNav(issueKey, 'history', pageData)}
|
|
128
|
+
|
|
129
|
+
<main class="main-content">
|
|
130
|
+
<div class="section">
|
|
131
|
+
<div class="section-title">
|
|
132
|
+
<span data-i18n="issueView.history">History</span>
|
|
133
|
+
<span>(${issue.history?.length || 0})</span>
|
|
134
|
+
</div>
|
|
135
|
+
<ul class="history-list">
|
|
136
|
+
${historyHtml}
|
|
137
|
+
</ul>
|
|
138
|
+
</div>
|
|
139
|
+
</main>
|
|
140
|
+
|
|
141
|
+
<div class="notification" id="notification"></div>
|
|
142
|
+
|
|
143
|
+
<script>
|
|
144
|
+
${generateIssueBaseScript(issueKey)}
|
|
145
|
+
</script>
|
|
146
|
+
</body>
|
|
147
|
+
</html>`;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=issue-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-history.js","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-history.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared components for issue pages
|
|
3
|
+
*/
|
|
4
|
+
export interface IssuePageData {
|
|
5
|
+
issueKey: string;
|
|
6
|
+
title: string;
|
|
7
|
+
commentsCount: number;
|
|
8
|
+
historyCount: number;
|
|
9
|
+
lang: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate the base CSS styles shared across all issue pages
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateIssueBaseStyles(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Generate the tabs navigation HTML
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateTabsNav(issueKey: string, activeTab: 'details' | 'comments' | 'history' | 'terminal', data: IssuePageData): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate the header HTML
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateIssueHeader(issueKey: string, title: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Generate the shared JavaScript for i18n and notifications
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateIssueBaseScript(issueKey: string): string;
|
|
27
|
+
//# sourceMappingURL=issue-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-shared.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAiKhD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,MAAM,CAiBzI;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAc3E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAyJhE"}
|