@industry-theme/github-panels 0.1.53 → 0.1.55

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.
@@ -130,7 +130,7 @@ const createLucideIcon = (iconName, iconNode) => {
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
132
  */
133
- const __iconNode$F = [
133
+ const __iconNode$G = [
134
134
  ["path", { d: "M12 7v14", key: "1akyts" }],
135
135
  [
136
136
  "path",
@@ -140,14 +140,14 @@ const __iconNode$F = [
140
140
  }
141
141
  ]
142
142
  ];
143
- const BookOpen = createLucideIcon("book-open", __iconNode$F);
143
+ const BookOpen = createLucideIcon("book-open", __iconNode$G);
144
144
  /**
145
145
  * @license lucide-react v0.552.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
149
  */
150
- const __iconNode$E = [
150
+ const __iconNode$F = [
151
151
  ["path", { d: "M10 12h4", key: "a56b0p" }],
152
152
  ["path", { d: "M10 8h4", key: "1sr2af" }],
153
153
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -160,108 +160,108 @@ const __iconNode$E = [
160
160
  ],
161
161
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
162
162
  ];
163
- const Building2 = createLucideIcon("building-2", __iconNode$E);
163
+ const Building2 = createLucideIcon("building-2", __iconNode$F);
164
164
  /**
165
165
  * @license lucide-react v0.552.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
169
  */
170
- const __iconNode$D = [
170
+ const __iconNode$E = [
171
171
  ["path", { d: "M8 2v4", key: "1cmpym" }],
172
172
  ["path", { d: "M16 2v4", key: "4m81vk" }],
173
173
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
174
174
  ["path", { d: "M3 10h18", key: "8toen8" }]
175
175
  ];
176
- const Calendar = createLucideIcon("calendar", __iconNode$D);
176
+ const Calendar = createLucideIcon("calendar", __iconNode$E);
177
177
  /**
178
178
  * @license lucide-react v0.552.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
182
  */
183
- const __iconNode$C = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
- const Check = createLucideIcon("check", __iconNode$C);
183
+ const __iconNode$D = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
+ const Check = createLucideIcon("check", __iconNode$D);
185
185
  /**
186
186
  * @license lucide-react v0.552.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
190
  */
191
- const __iconNode$B = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$B);
191
+ const __iconNode$C = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$C);
193
193
  /**
194
194
  * @license lucide-react v0.552.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
198
  */
199
- const __iconNode$A = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$A);
199
+ const __iconNode$B = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$B);
201
201
  /**
202
202
  * @license lucide-react v0.552.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const __iconNode$z = [
207
+ const __iconNode$A = [
208
208
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
209
209
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
210
210
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
211
211
  ];
212
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$z);
212
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$A);
213
213
  /**
214
214
  * @license lucide-react v0.552.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const __iconNode$y = [
219
+ const __iconNode$z = [
220
220
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
221
221
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
222
222
  ];
223
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$y);
223
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$z);
224
224
  /**
225
225
  * @license lucide-react v0.552.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const __iconNode$x = [
230
+ const __iconNode$y = [
231
231
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
232
232
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
233
233
  ];
234
- const CircleDot = createLucideIcon("circle-dot", __iconNode$x);
234
+ const CircleDot = createLucideIcon("circle-dot", __iconNode$y);
235
235
  /**
236
236
  * @license lucide-react v0.552.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
240
  */
241
- const __iconNode$w = [
241
+ const __iconNode$x = [
242
242
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
243
243
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
244
244
  ];
245
- const Copy = createLucideIcon("copy", __iconNode$w);
245
+ const Copy = createLucideIcon("copy", __iconNode$x);
246
246
  /**
247
247
  * @license lucide-react v0.552.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
251
  */
252
- const __iconNode$v = [
252
+ const __iconNode$w = [
253
253
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
254
254
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
255
255
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
256
256
  ];
257
- const Download = createLucideIcon("download", __iconNode$v);
257
+ const Download = createLucideIcon("download", __iconNode$w);
258
258
  /**
259
259
  * @license lucide-react v0.552.0 - ISC
260
260
  *
261
261
  * This source code is licensed under the ISC license.
262
262
  * See the LICENSE file in the root directory of this source tree.
263
263
  */
264
- const __iconNode$u = [
264
+ const __iconNode$v = [
265
265
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
266
266
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
267
267
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -271,19 +271,44 @@ const __iconNode$u = [
271
271
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
272
272
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
273
273
  ];
274
- const Expand = createLucideIcon("expand", __iconNode$u);
274
+ const Expand = createLucideIcon("expand", __iconNode$v);
275
275
  /**
276
276
  * @license lucide-react v0.552.0 - ISC
277
277
  *
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
280
  */
281
- const __iconNode$t = [
281
+ const __iconNode$u = [
282
282
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
283
283
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
284
284
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
285
285
  ];
286
- const ExternalLink = createLucideIcon("external-link", __iconNode$t);
286
+ const ExternalLink = createLucideIcon("external-link", __iconNode$u);
287
+ /**
288
+ * @license lucide-react v0.552.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */
293
+ const __iconNode$t = [
294
+ [
295
+ "path",
296
+ {
297
+ d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
298
+ key: "ct8e1f"
299
+ }
300
+ ],
301
+ ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
302
+ [
303
+ "path",
304
+ {
305
+ d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
306
+ key: "13bj9a"
307
+ }
308
+ ],
309
+ ["path", { d: "m2 2 20 20", key: "1ooewy" }]
310
+ ];
311
+ const EyeOff = createLucideIcon("eye-off", __iconNode$t);
287
312
  /**
288
313
  * @license lucide-react v0.552.0 - ISC
289
314
  *
@@ -49149,22 +49174,38 @@ const formatDate$1 = (dateString) => {
49149
49174
  return `${years} ${years === 1 ? "year" : "years"} ago`;
49150
49175
  };
49151
49176
  const GitHubIssueDetailPanelContent = ({ events }) => {
49177
+ var _a;
49152
49178
  const { theme: theme2 } = useTheme();
49153
49179
  const [selectedIssue, setSelectedIssue] = useState(null);
49154
49180
  const [owner, setOwner] = useState("");
49155
49181
  const [repo, setRepo] = useState("");
49156
49182
  const [taskCreation, setTaskCreation] = useState({ status: "idle" });
49183
+ const [showTaskTypeModal, setShowTaskTypeModal] = useState(false);
49184
+ const [modalStep, setModalStep] = useState("type");
49185
+ const [selectedTaskType, setSelectedTaskType] = useState(null);
49186
+ const [additionalInstructions, setAdditionalInstructions] = useState("");
49157
49187
  const panelRef = useRef(null);
49158
49188
  gt(
49159
49189
  "github-issue-detail",
49160
49190
  events,
49161
49191
  () => {
49162
- var _a;
49163
- return (_a = panelRef.current) == null ? void 0 : _a.focus();
49192
+ var _a2;
49193
+ return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
49164
49194
  }
49165
49195
  );
49166
49196
  const handleCreateTask = () => {
49167
- if (!events || !selectedIssue) return;
49197
+ setShowTaskTypeModal(true);
49198
+ setModalStep("type");
49199
+ setSelectedTaskType(null);
49200
+ setAdditionalInstructions("");
49201
+ };
49202
+ const handleSelectTaskType = (taskType2) => {
49203
+ setSelectedTaskType(taskType2);
49204
+ setModalStep("instructions");
49205
+ };
49206
+ const handleSubmitTask = () => {
49207
+ if (!events || !selectedIssue || !selectedTaskType) return;
49208
+ setShowTaskTypeModal(false);
49168
49209
  setTaskCreation({ status: "loading" });
49169
49210
  events.emit({
49170
49211
  type: "issue:create-task",
@@ -49173,9 +49214,19 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49173
49214
  payload: {
49174
49215
  issue: selectedIssue,
49175
49216
  owner,
49176
- repo
49217
+ repo,
49218
+ taskType: selectedTaskType,
49219
+ additionalInstructions: additionalInstructions.trim() || void 0
49177
49220
  }
49178
49221
  });
49222
+ setModalStep("type");
49223
+ setSelectedTaskType(null);
49224
+ setAdditionalInstructions("");
49225
+ };
49226
+ const handleBackToTaskType = () => {
49227
+ setModalStep("type");
49228
+ setSelectedTaskType(null);
49229
+ setAdditionalInstructions("");
49179
49230
  };
49180
49231
  useEffect(() => {
49181
49232
  if (!events) return;
@@ -49293,6 +49344,11 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49293
49344
  const statusColor = isOpen ? theme2.colors.success || "#22c55e" : theme2.colors.error || "#ef4444";
49294
49345
  const statusBg = `${statusColor}20`;
49295
49346
  const statusLabel = isOpen ? "Open" : "Closed";
49347
+ const taskLabel = (_a = selectedIssue.labels) == null ? void 0 : _a.find(
49348
+ (label) => label.name === "backlog-task:investigate" || label.name === "backlog-task:fix"
49349
+ );
49350
+ const hasTask = !!taskLabel;
49351
+ taskLabel == null ? void 0 : taskLabel.name.split(":")[1];
49296
49352
  return /* @__PURE__ */ jsxs("div", { ref: panelRef, tabIndex: -1, style: { ...containerStyle, outline: "none" }, children: [
49297
49353
  /* @__PURE__ */ jsxs(
49298
49354
  "div",
@@ -49358,197 +49414,359 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49358
49414
  ]
49359
49415
  }
49360
49416
  ),
49361
- selectedIssue.comments > 0 && /* @__PURE__ */ jsxs(
49362
- "span",
49417
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
49418
+ /* @__PURE__ */ jsx(
49419
+ "a",
49363
49420
  {
49421
+ href: selectedIssue.html_url,
49422
+ target: "_blank",
49423
+ rel: "noopener noreferrer",
49424
+ title: "View on GitHub",
49364
49425
  style: {
49365
49426
  display: "inline-flex",
49366
49427
  alignItems: "center",
49367
- gap: "4px",
49428
+ justifyContent: "center",
49429
+ width: "28px",
49430
+ height: "28px",
49431
+ padding: 0,
49432
+ border: `1px solid ${theme2.colors.border}`,
49433
+ borderRadius: "6px",
49434
+ backgroundColor: theme2.colors.background,
49368
49435
  color: theme2.colors.textSecondary,
49369
- fontSize: theme2.fontSizes[0]
49436
+ textDecoration: "none"
49370
49437
  },
49371
- children: [
49372
- /* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
49373
- selectedIssue.comments
49374
- ]
49438
+ children: /* @__PURE__ */ jsx(Github, { size: 16 })
49375
49439
  }
49376
49440
  ),
49377
- selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
49378
- "span",
49441
+ /* @__PURE__ */ jsx(
49442
+ "button",
49379
49443
  {
49444
+ type: "button",
49445
+ onClick: handleBack,
49446
+ title: "Close",
49380
49447
  style: {
49381
49448
  display: "inline-flex",
49382
49449
  alignItems: "center",
49383
- gap: "4px",
49450
+ justifyContent: "center",
49451
+ width: "28px",
49452
+ height: "28px",
49453
+ padding: 0,
49454
+ border: `1px solid ${theme2.colors.border}`,
49455
+ borderRadius: "6px",
49456
+ backgroundColor: theme2.colors.background,
49384
49457
  color: theme2.colors.textSecondary,
49385
- fontSize: theme2.fontSizes[0],
49386
- fontFamily: theme2.fonts.body
49458
+ cursor: "pointer"
49387
49459
  },
49388
- children: [
49389
- "assigned to",
49390
- " ",
49391
- selectedIssue.assignees.map((assignee, index2) => /* @__PURE__ */ jsxs("span", { children: [
49392
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: assignee.login }),
49393
- index2 < selectedIssue.assignees.length - 1 && ", "
49394
- ] }, assignee.login))
49395
- ]
49460
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
49396
49461
  }
49397
- ),
49398
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
49399
- taskCreation.status === "idle" && /* @__PURE__ */ jsxs(
49400
- "button",
49462
+ )
49463
+ ]
49464
+ }
49465
+ ),
49466
+ selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
49467
+ "div",
49468
+ {
49469
+ style: {
49470
+ padding: "12px 16px",
49471
+ backgroundColor: theme2.colors.backgroundSecondary,
49472
+ borderBottom: `1px solid ${theme2.colors.border}`,
49473
+ display: "flex",
49474
+ alignItems: "center",
49475
+ gap: "12px"
49476
+ },
49477
+ children: [
49478
+ /* @__PURE__ */ jsx(
49479
+ "span",
49401
49480
  {
49402
- onClick: handleCreateTask,
49403
49481
  style: {
49404
- display: "flex",
49405
- alignItems: "center",
49406
- gap: "6px",
49407
- padding: "6px 12px",
49408
- border: `1px solid ${theme2.colors.primary}`,
49409
- borderRadius: theme2.radii[1],
49410
- background: "transparent",
49411
- cursor: "pointer",
49412
- color: theme2.colors.primary,
49482
+ color: theme2.colors.textSecondary,
49413
49483
  fontSize: theme2.fontSizes[1],
49414
- fontWeight: theme2.fontWeights.medium,
49415
- transition: "all 0.2s ease"
49416
- },
49417
- onMouseEnter: (e) => {
49418
- e.currentTarget.style.background = theme2.colors.primary;
49419
- e.currentTarget.style.color = theme2.colors.background;
49420
- },
49421
- onMouseLeave: (e) => {
49422
- e.currentTarget.style.background = "transparent";
49423
- e.currentTarget.style.color = theme2.colors.primary;
49484
+ fontFamily: theme2.fonts.body,
49485
+ fontWeight: theme2.fontWeights.medium
49424
49486
  },
49425
- title: "Create task in backlog.md",
49426
- children: [
49427
- /* @__PURE__ */ jsx(FileText, { size: 14 }),
49428
- "Create Task"
49429
- ]
49487
+ children: "Assigned to:"
49430
49488
  }
49431
49489
  ),
49432
- taskCreation.status === "loading" && /* @__PURE__ */ jsxs(
49490
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" }, children: selectedIssue.assignees.map((assignee) => /* @__PURE__ */ jsxs(
49433
49491
  "div",
49434
49492
  {
49435
49493
  style: {
49436
49494
  display: "flex",
49437
49495
  alignItems: "center",
49438
49496
  gap: "6px",
49439
- padding: "6px 12px",
49440
- color: theme2.colors.textSecondary,
49441
- fontSize: theme2.fontSizes[1]
49497
+ padding: "4px 10px",
49498
+ backgroundColor: theme2.colors.background,
49499
+ border: `1px solid ${theme2.colors.border}`,
49500
+ borderRadius: "16px"
49442
49501
  },
49443
49502
  children: [
49444
- /* @__PURE__ */ jsx(LoaderCircle, { size: 14, style: { animation: "spin 1s linear infinite" } }),
49445
- "Creating..."
49503
+ assignee.avatar_url && /* @__PURE__ */ jsx(
49504
+ "img",
49505
+ {
49506
+ src: assignee.avatar_url,
49507
+ alt: assignee.login,
49508
+ style: {
49509
+ width: "20px",
49510
+ height: "20px",
49511
+ borderRadius: "50%"
49512
+ }
49513
+ }
49514
+ ),
49515
+ /* @__PURE__ */ jsx(
49516
+ "span",
49517
+ {
49518
+ style: {
49519
+ color: theme2.colors.text,
49520
+ fontSize: theme2.fontSizes[1],
49521
+ fontFamily: theme2.fonts.body,
49522
+ fontWeight: theme2.fontWeights.medium
49523
+ },
49524
+ children: assignee.login
49525
+ }
49526
+ )
49446
49527
  ]
49447
- }
49448
- ),
49449
- taskCreation.status === "success" && /* @__PURE__ */ jsxs(
49450
- "div",
49528
+ },
49529
+ assignee.login
49530
+ )) })
49531
+ ]
49532
+ }
49533
+ ),
49534
+ /* @__PURE__ */ jsxs(
49535
+ "div",
49536
+ {
49537
+ style: {
49538
+ display: "flex",
49539
+ gap: "1px",
49540
+ backgroundColor: theme2.colors.border,
49541
+ borderBottom: `1px solid ${theme2.colors.border}`
49542
+ },
49543
+ children: [
49544
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, backgroundColor: theme2.colors.background }, children: [
49545
+ taskCreation.status === "idle" && !hasTask && /* @__PURE__ */ jsxs(
49546
+ "button",
49547
+ {
49548
+ onClick: handleCreateTask,
49549
+ style: {
49550
+ width: "100%",
49551
+ height: "100%",
49552
+ display: "flex",
49553
+ alignItems: "center",
49554
+ justifyContent: "center",
49555
+ gap: "8px",
49556
+ padding: "12px 16px",
49557
+ border: "none",
49558
+ background: "transparent",
49559
+ cursor: "pointer",
49560
+ color: theme2.colors.primary,
49561
+ fontSize: theme2.fontSizes[1],
49562
+ fontWeight: theme2.fontWeights.medium,
49563
+ transition: "background 0.2s ease"
49564
+ },
49565
+ onMouseEnter: (e) => {
49566
+ e.currentTarget.style.background = theme2.colors.backgroundSecondary;
49567
+ },
49568
+ onMouseLeave: (e) => {
49569
+ e.currentTarget.style.background = "transparent";
49570
+ },
49571
+ children: [
49572
+ /* @__PURE__ */ jsx(FileText, { size: 16 }),
49573
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "Create Task" })
49574
+ ]
49575
+ }
49576
+ ),
49577
+ taskCreation.status === "idle" && hasTask && /* @__PURE__ */ jsxs(
49578
+ "button",
49579
+ {
49580
+ onClick: () => {
49581
+ if (events) {
49582
+ events.emit({
49583
+ type: "task:view",
49584
+ source: "github-issue-detail-panel",
49585
+ timestamp: Date.now(),
49586
+ payload: {
49587
+ issue: selectedIssue,
49588
+ owner,
49589
+ repo
49590
+ }
49591
+ });
49592
+ }
49593
+ },
49594
+ style: {
49595
+ width: "100%",
49596
+ height: "100%",
49597
+ display: "flex",
49598
+ alignItems: "center",
49599
+ justifyContent: "center",
49600
+ gap: "8px",
49601
+ padding: "12px 16px",
49602
+ border: "none",
49603
+ background: "transparent",
49604
+ cursor: "pointer",
49605
+ color: theme2.colors.success,
49606
+ fontSize: theme2.fontSizes[1],
49607
+ fontWeight: theme2.fontWeights.medium,
49608
+ transition: "background 0.2s ease"
49609
+ },
49610
+ onMouseEnter: (e) => {
49611
+ e.currentTarget.style.background = theme2.colors.backgroundSecondary;
49612
+ },
49613
+ onMouseLeave: (e) => {
49614
+ e.currentTarget.style.background = "transparent";
49615
+ },
49616
+ children: [
49617
+ /* @__PURE__ */ jsx(CircleCheckBig, { size: 16 }),
49618
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "Task Started" })
49619
+ ]
49620
+ }
49621
+ ),
49622
+ taskCreation.status === "loading" && /* @__PURE__ */ jsxs(
49623
+ "button",
49624
+ {
49625
+ disabled: true,
49626
+ style: {
49627
+ width: "100%",
49628
+ height: "100%",
49629
+ display: "flex",
49630
+ alignItems: "center",
49631
+ justifyContent: "center",
49632
+ gap: "8px",
49633
+ padding: "12px 16px",
49634
+ border: "none",
49635
+ background: "transparent",
49636
+ cursor: "default",
49637
+ color: theme2.colors.textSecondary,
49638
+ fontSize: theme2.fontSizes[1]
49639
+ },
49640
+ children: [
49641
+ /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
49642
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "Creating Task..." })
49643
+ ]
49644
+ }
49645
+ ),
49646
+ taskCreation.status === "success" && /* @__PURE__ */ jsxs(
49647
+ "button",
49648
+ {
49649
+ disabled: true,
49650
+ style: {
49651
+ width: "100%",
49652
+ height: "100%",
49653
+ display: "flex",
49654
+ alignItems: "center",
49655
+ justifyContent: "center",
49656
+ gap: "8px",
49657
+ padding: "12px 16px",
49658
+ border: "none",
49659
+ background: "transparent",
49660
+ cursor: "default",
49661
+ color: theme2.colors.success,
49662
+ fontSize: theme2.fontSizes[1],
49663
+ fontWeight: theme2.fontWeights.medium
49664
+ },
49665
+ children: [
49666
+ /* @__PURE__ */ jsx(CircleCheckBig, { size: 16 }),
49667
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "Task Created" })
49668
+ ]
49669
+ }
49670
+ ),
49671
+ taskCreation.status === "error" && /* @__PURE__ */ jsxs(
49672
+ "button",
49673
+ {
49674
+ onClick: () => setTaskCreation({ status: "idle" }),
49675
+ style: {
49676
+ width: "100%",
49677
+ height: "100%",
49678
+ display: "flex",
49679
+ alignItems: "center",
49680
+ justifyContent: "center",
49681
+ gap: "8px",
49682
+ padding: "12px 16px",
49683
+ border: "none",
49684
+ background: "transparent",
49685
+ cursor: "pointer",
49686
+ color: theme2.colors.error,
49687
+ fontSize: theme2.fontSizes[1],
49688
+ fontWeight: theme2.fontWeights.medium,
49689
+ transition: "background 0.2s ease"
49690
+ },
49691
+ onMouseEnter: (e) => {
49692
+ e.currentTarget.style.background = theme2.colors.backgroundSecondary;
49693
+ },
49694
+ onMouseLeave: (e) => {
49695
+ e.currentTarget.style.background = "transparent";
49696
+ },
49697
+ title: taskCreation.error,
49698
+ children: [
49699
+ /* @__PURE__ */ jsx(CircleAlert, { size: 16 }),
49700
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "Retry Task Creation" })
49701
+ ]
49702
+ }
49703
+ )
49704
+ ] }),
49705
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, backgroundColor: theme2.colors.background }, children: /* @__PURE__ */ jsxs(
49706
+ "button",
49451
49707
  {
49708
+ onClick: () => {
49709
+ if (events) {
49710
+ events.emit({
49711
+ type: "issue:view-discussion",
49712
+ source: "github-issue-detail-panel",
49713
+ timestamp: Date.now(),
49714
+ payload: {
49715
+ issue: selectedIssue,
49716
+ owner,
49717
+ repo
49718
+ }
49719
+ });
49720
+ }
49721
+ },
49452
49722
  style: {
49723
+ width: "100%",
49724
+ height: "100%",
49453
49725
  display: "flex",
49454
49726
  alignItems: "center",
49455
- gap: "6px",
49456
- padding: "6px 12px",
49457
- border: `1px solid ${theme2.colors.success}`,
49458
- borderRadius: theme2.radii[1],
49459
- background: `${theme2.colors.success}15`,
49460
- color: theme2.colors.success,
49727
+ justifyContent: "center",
49728
+ gap: "8px",
49729
+ padding: "12px 16px",
49730
+ border: "none",
49731
+ background: "transparent",
49732
+ cursor: "pointer",
49733
+ color: theme2.colors.text,
49461
49734
  fontSize: theme2.fontSizes[1],
49462
- fontWeight: theme2.fontWeights.medium
49735
+ fontWeight: theme2.fontWeights.medium,
49736
+ transition: "background 0.2s ease"
49463
49737
  },
49464
- children: [
49465
- /* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
49466
- "Task Created"
49467
- ]
49468
- }
49469
- ),
49470
- taskCreation.status === "error" && /* @__PURE__ */ jsxs(
49471
- "div",
49472
- {
49473
- style: {
49474
- display: "flex",
49475
- alignItems: "center",
49476
- gap: "6px",
49477
- padding: "6px 12px",
49478
- border: `1px solid ${theme2.colors.error}`,
49479
- borderRadius: theme2.radii[1],
49480
- background: `${theme2.colors.error}15`,
49481
- color: theme2.colors.error,
49482
- fontSize: theme2.fontSizes[1]
49738
+ onMouseEnter: (e) => {
49739
+ e.currentTarget.style.background = theme2.colors.backgroundSecondary;
49740
+ },
49741
+ onMouseLeave: (e) => {
49742
+ e.currentTarget.style.background = "transparent";
49483
49743
  },
49484
- title: taskCreation.error,
49485
49744
  children: [
49486
- /* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
49487
- "Failed",
49488
- /* @__PURE__ */ jsx(
49489
- "button",
49745
+ /* @__PURE__ */ jsx(MessageSquare, { size: 16 }),
49746
+ /* @__PURE__ */ jsx("span", { style: { lineHeight: 1 }, children: "View Discussion" }),
49747
+ selectedIssue.comments > 0 && /* @__PURE__ */ jsx(
49748
+ "span",
49490
49749
  {
49491
- onClick: () => setTaskCreation({ status: "idle" }),
49492
49750
  style: {
49493
- background: "none",
49494
- border: "none",
49495
- color: theme2.colors.error,
49496
- cursor: "pointer",
49497
- padding: "0 0 0 4px",
49751
+ display: "inline-flex",
49752
+ alignItems: "center",
49753
+ justifyContent: "center",
49754
+ minWidth: "20px",
49755
+ padding: "2px 6px",
49756
+ backgroundColor: theme2.colors.backgroundSecondary,
49757
+ border: `1px solid ${theme2.colors.border}`,
49758
+ borderRadius: "10px",
49498
49759
  fontSize: theme2.fontSizes[0],
49499
- textDecoration: "underline"
49760
+ fontWeight: theme2.fontWeights.semibold,
49761
+ color: theme2.colors.textSecondary,
49762
+ lineHeight: 1
49500
49763
  },
49501
- children: "Retry"
49764
+ children: selectedIssue.comments
49502
49765
  }
49503
49766
  )
49504
49767
  ]
49505
49768
  }
49506
- ),
49507
- /* @__PURE__ */ jsx(
49508
- "a",
49509
- {
49510
- href: selectedIssue.html_url,
49511
- target: "_blank",
49512
- rel: "noopener noreferrer",
49513
- title: "View on GitHub",
49514
- style: {
49515
- display: "inline-flex",
49516
- alignItems: "center",
49517
- justifyContent: "center",
49518
- width: "28px",
49519
- height: "28px",
49520
- padding: 0,
49521
- border: `1px solid ${theme2.colors.border}`,
49522
- borderRadius: "6px",
49523
- backgroundColor: theme2.colors.background,
49524
- color: theme2.colors.textSecondary,
49525
- textDecoration: "none"
49526
- },
49527
- children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
49528
- }
49529
- ),
49530
- /* @__PURE__ */ jsx(
49531
- "button",
49532
- {
49533
- type: "button",
49534
- onClick: handleBack,
49535
- title: "Close",
49536
- style: {
49537
- display: "inline-flex",
49538
- alignItems: "center",
49539
- justifyContent: "center",
49540
- width: "28px",
49541
- height: "28px",
49542
- padding: 0,
49543
- border: `1px solid ${theme2.colors.border}`,
49544
- borderRadius: "6px",
49545
- backgroundColor: theme2.colors.background,
49546
- color: theme2.colors.textSecondary,
49547
- cursor: "pointer"
49548
- },
49549
- children: /* @__PURE__ */ jsx(X, { size: 16 })
49550
- }
49551
- )
49769
+ ) })
49552
49770
  ]
49553
49771
  }
49554
49772
  ),
@@ -49605,6 +49823,280 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49605
49823
  }
49606
49824
  )
49607
49825
  }
49826
+ ),
49827
+ showTaskTypeModal && /* @__PURE__ */ jsx(
49828
+ "div",
49829
+ {
49830
+ style: {
49831
+ position: "fixed",
49832
+ top: 0,
49833
+ left: 0,
49834
+ right: 0,
49835
+ bottom: 0,
49836
+ backgroundColor: "rgba(0, 0, 0, 0.7)",
49837
+ display: "flex",
49838
+ alignItems: "center",
49839
+ justifyContent: "center",
49840
+ zIndex: 1e4
49841
+ },
49842
+ onClick: () => setShowTaskTypeModal(false),
49843
+ children: /* @__PURE__ */ jsxs(
49844
+ "div",
49845
+ {
49846
+ style: {
49847
+ backgroundColor: theme2.colors.surface,
49848
+ borderRadius: "12px",
49849
+ padding: "24px",
49850
+ maxWidth: "500px",
49851
+ width: "90%",
49852
+ boxShadow: "0 8px 32px rgba(0, 0, 0, 0.3)"
49853
+ },
49854
+ onClick: (e) => e.stopPropagation(),
49855
+ children: [
49856
+ modalStep === "type" && /* @__PURE__ */ jsxs(Fragment, { children: [
49857
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
49858
+ /* @__PURE__ */ jsx(
49859
+ "h2",
49860
+ {
49861
+ style: {
49862
+ margin: 0,
49863
+ marginBottom: "8px",
49864
+ fontFamily: theme2.fonts.heading,
49865
+ fontSize: theme2.fontSizes[3],
49866
+ fontWeight: 600,
49867
+ color: theme2.colors.text
49868
+ },
49869
+ children: "Choose Task Type"
49870
+ }
49871
+ ),
49872
+ /* @__PURE__ */ jsx(
49873
+ "p",
49874
+ {
49875
+ style: {
49876
+ margin: 0,
49877
+ fontFamily: theme2.fonts.body,
49878
+ fontSize: theme2.fontSizes[1],
49879
+ color: theme2.colors.textSecondary,
49880
+ lineHeight: 1.5
49881
+ },
49882
+ children: "What type of task do you want to create for this issue?"
49883
+ }
49884
+ )
49885
+ ] }),
49886
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
49887
+ /* @__PURE__ */ jsxs(
49888
+ "button",
49889
+ {
49890
+ onClick: () => handleSelectTaskType("investigate"),
49891
+ style: {
49892
+ padding: "16px",
49893
+ border: `2px solid ${theme2.colors.border}`,
49894
+ borderRadius: "8px",
49895
+ backgroundColor: theme2.colors.background,
49896
+ cursor: "pointer",
49897
+ textAlign: "left",
49898
+ transition: "all 0.2s ease"
49899
+ },
49900
+ onMouseEnter: (e) => {
49901
+ e.currentTarget.style.borderColor = theme2.colors.primary;
49902
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
49903
+ },
49904
+ onMouseLeave: (e) => {
49905
+ e.currentTarget.style.borderColor = theme2.colors.border;
49906
+ e.currentTarget.style.backgroundColor = theme2.colors.background;
49907
+ },
49908
+ children: [
49909
+ /* @__PURE__ */ jsx(
49910
+ "div",
49911
+ {
49912
+ style: {
49913
+ fontFamily: theme2.fonts.heading,
49914
+ fontSize: theme2.fontSizes[2],
49915
+ fontWeight: 600,
49916
+ color: theme2.colors.text,
49917
+ marginBottom: "4px"
49918
+ },
49919
+ children: "🔍 Investigate Issue"
49920
+ }
49921
+ ),
49922
+ /* @__PURE__ */ jsx(
49923
+ "div",
49924
+ {
49925
+ style: {
49926
+ fontFamily: theme2.fonts.body,
49927
+ fontSize: theme2.fontSizes[1],
49928
+ color: theme2.colors.textSecondary,
49929
+ lineHeight: 1.4
49930
+ },
49931
+ children: "Research and identify the root cause of the problem"
49932
+ }
49933
+ )
49934
+ ]
49935
+ }
49936
+ ),
49937
+ /* @__PURE__ */ jsxs(
49938
+ "button",
49939
+ {
49940
+ onClick: () => handleSelectTaskType("fix"),
49941
+ style: {
49942
+ padding: "16px",
49943
+ border: `2px solid ${theme2.colors.border}`,
49944
+ borderRadius: "8px",
49945
+ backgroundColor: theme2.colors.background,
49946
+ cursor: "pointer",
49947
+ textAlign: "left",
49948
+ transition: "all 0.2s ease"
49949
+ },
49950
+ onMouseEnter: (e) => {
49951
+ e.currentTarget.style.borderColor = theme2.colors.primary;
49952
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
49953
+ },
49954
+ onMouseLeave: (e) => {
49955
+ e.currentTarget.style.borderColor = theme2.colors.border;
49956
+ e.currentTarget.style.backgroundColor = theme2.colors.background;
49957
+ },
49958
+ children: [
49959
+ /* @__PURE__ */ jsx(
49960
+ "div",
49961
+ {
49962
+ style: {
49963
+ fontFamily: theme2.fonts.heading,
49964
+ fontSize: theme2.fontSizes[2],
49965
+ fontWeight: 600,
49966
+ color: theme2.colors.text,
49967
+ marginBottom: "4px"
49968
+ },
49969
+ children: "🔧 Fix Issue"
49970
+ }
49971
+ ),
49972
+ /* @__PURE__ */ jsx(
49973
+ "div",
49974
+ {
49975
+ style: {
49976
+ fontFamily: theme2.fonts.body,
49977
+ fontSize: theme2.fontSizes[1],
49978
+ color: theme2.colors.textSecondary,
49979
+ lineHeight: 1.4
49980
+ },
49981
+ children: "Implement a solution to resolve the issue"
49982
+ }
49983
+ )
49984
+ ]
49985
+ }
49986
+ )
49987
+ ] }),
49988
+ /* @__PURE__ */ jsx("div", { style: { marginTop: "20px", textAlign: "center" }, children: /* @__PURE__ */ jsx(
49989
+ "button",
49990
+ {
49991
+ onClick: () => setShowTaskTypeModal(false),
49992
+ style: {
49993
+ padding: "8px 16px",
49994
+ border: "none",
49995
+ background: "transparent",
49996
+ cursor: "pointer",
49997
+ color: theme2.colors.textSecondary,
49998
+ fontSize: theme2.fontSizes[1],
49999
+ fontFamily: theme2.fonts.body
50000
+ },
50001
+ children: "Cancel"
50002
+ }
50003
+ ) })
50004
+ ] }),
50005
+ modalStep === "instructions" && /* @__PURE__ */ jsxs(Fragment, { children: [
50006
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
50007
+ /* @__PURE__ */ jsx(
50008
+ "h2",
50009
+ {
50010
+ style: {
50011
+ margin: 0,
50012
+ marginBottom: "8px",
50013
+ fontFamily: theme2.fonts.heading,
50014
+ fontSize: theme2.fontSizes[3],
50015
+ fontWeight: 600,
50016
+ color: theme2.colors.text
50017
+ },
50018
+ children: "Additional Instructions"
50019
+ }
50020
+ ),
50021
+ /* @__PURE__ */ jsx(
50022
+ "p",
50023
+ {
50024
+ style: {
50025
+ margin: 0,
50026
+ fontFamily: theme2.fonts.body,
50027
+ fontSize: theme2.fontSizes[1],
50028
+ color: theme2.colors.textSecondary,
50029
+ lineHeight: 1.5
50030
+ },
50031
+ children: "Add any specific instructions or context for this task (optional)"
50032
+ }
50033
+ )
50034
+ ] }),
50035
+ /* @__PURE__ */ jsx(
50036
+ "textarea",
50037
+ {
50038
+ value: additionalInstructions,
50039
+ onChange: (e) => setAdditionalInstructions(e.target.value),
50040
+ placeholder: "e.g., Focus on the authentication flow, check error handling in useWebSocket hook, etc.",
50041
+ style: {
50042
+ width: "100%",
50043
+ minHeight: "120px",
50044
+ padding: "12px",
50045
+ border: `1px solid ${theme2.colors.border}`,
50046
+ borderRadius: "6px",
50047
+ backgroundColor: theme2.colors.background,
50048
+ color: theme2.colors.text,
50049
+ fontFamily: theme2.fonts.body,
50050
+ fontSize: theme2.fontSizes[1],
50051
+ lineHeight: 1.5,
50052
+ resize: "vertical",
50053
+ boxSizing: "border-box"
50054
+ }
50055
+ }
50056
+ ),
50057
+ /* @__PURE__ */ jsxs("div", { style: { marginTop: "20px", display: "flex", gap: "12px", justifyContent: "flex-end" }, children: [
50058
+ /* @__PURE__ */ jsx(
50059
+ "button",
50060
+ {
50061
+ onClick: handleBackToTaskType,
50062
+ style: {
50063
+ padding: "8px 16px",
50064
+ border: `1px solid ${theme2.colors.border}`,
50065
+ borderRadius: "6px",
50066
+ background: theme2.colors.background,
50067
+ cursor: "pointer",
50068
+ color: theme2.colors.text,
50069
+ fontSize: theme2.fontSizes[1],
50070
+ fontFamily: theme2.fonts.body,
50071
+ fontWeight: theme2.fontWeights.medium
50072
+ },
50073
+ children: "Back"
50074
+ }
50075
+ ),
50076
+ /* @__PURE__ */ jsx(
50077
+ "button",
50078
+ {
50079
+ onClick: handleSubmitTask,
50080
+ style: {
50081
+ padding: "8px 24px",
50082
+ border: "none",
50083
+ borderRadius: "6px",
50084
+ background: theme2.colors.primary,
50085
+ cursor: "pointer",
50086
+ color: theme2.colors.textOnPrimary || "#ffffff",
50087
+ fontSize: theme2.fontSizes[1],
50088
+ fontFamily: theme2.fonts.body,
50089
+ fontWeight: theme2.fontWeights.medium
50090
+ },
50091
+ children: "Create Task"
50092
+ }
50093
+ )
50094
+ ] })
50095
+ ] })
50096
+ ]
50097
+ }
50098
+ )
50099
+ }
49608
50100
  )
49609
50101
  ] });
49610
50102
  };
@@ -49620,6 +50112,26 @@ const GitHubIssueDetailPanelMetadata = {
49620
50112
  slices: [],
49621
50113
  surfaces: ["panel"]
49622
50114
  };
50115
+ const REACTION_EMOJI = {
50116
+ "+1": "👍",
50117
+ "-1": "👎",
50118
+ "laugh": "😄",
50119
+ "hooray": "🎉",
50120
+ "confused": "😕",
50121
+ "heart": "❤️",
50122
+ "rocket": "🚀",
50123
+ "eyes": "👀"
50124
+ };
50125
+ const REACTION_ORDER = [
50126
+ "+1",
50127
+ "heart",
50128
+ "hooray",
50129
+ "rocket",
50130
+ "eyes",
50131
+ "laugh",
50132
+ "confused",
50133
+ "-1"
50134
+ ];
49623
50135
  const formatDate = (dateString) => {
49624
50136
  const date = new Date(dateString);
49625
50137
  const now = /* @__PURE__ */ new Date();
@@ -49644,6 +50156,12 @@ const formatDate = (dateString) => {
49644
50156
  return `${years}y ago`;
49645
50157
  };
49646
50158
  const formatSha = (sha) => sha.substring(0, 7);
50159
+ const getEventTimestamp = (event) => {
50160
+ if ("created_at" in event) return event.created_at;
50161
+ if ("submitted_at" in event) return event.submitted_at;
50162
+ if ("committer" in event) return event.committer.date;
50163
+ return "";
50164
+ };
49647
50165
  const Avatar = ({ user, size = 32 }) => {
49648
50166
  const { theme: theme2 } = useTheme();
49649
50167
  return /* @__PURE__ */ jsx(
@@ -49660,57 +50178,148 @@ const Avatar = ({ user, size = 32 }) => {
49660
50178
  }
49661
50179
  );
49662
50180
  };
49663
- const ReactionsDisplay = ({ reactions }) => {
50181
+ const ReactionBar = ({ reactions, onToggleReaction, disabled }) => {
49664
50182
  const { theme: theme2 } = useTheme();
49665
- if (reactions.total_count === 0) return null;
49666
- const reactionEmojis = {
49667
- "+1": "👍",
49668
- "-1": "👎",
49669
- laugh: "😄",
49670
- hooray: "🎉",
49671
- confused: "😕",
49672
- heart: "❤️",
49673
- rocket: "🚀",
49674
- eyes: "👀"
49675
- };
49676
- const reactionCounts = {
49677
- "+1": reactions["+1"],
49678
- "-1": reactions["-1"],
49679
- laugh: reactions.laugh,
49680
- hooray: reactions.hooray,
49681
- confused: reactions.confused,
49682
- heart: reactions.heart,
49683
- rocket: reactions.rocket,
49684
- eyes: reactions.eyes
49685
- };
49686
- const activeReactions = Object.entries(reactionEmojis).filter(([key]) => reactionCounts[key] > 0).map(([key, emoji]) => ({
49687
- emoji,
49688
- count: reactionCounts[key]
49689
- }));
49690
- return /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: activeReactions.map(({ emoji, count }) => /* @__PURE__ */ jsxs(
49691
- "span",
49692
- {
49693
- style: {
49694
- display: "inline-flex",
49695
- alignItems: "center",
49696
- gap: "4px",
49697
- padding: "2px 8px",
49698
- borderRadius: "12px",
49699
- backgroundColor: theme2.colors.backgroundSecondary,
49700
- border: `1px solid ${theme2.colors.border}`,
49701
- fontSize: theme2.fontSizes[0]
50183
+ const [showPicker, setShowPicker] = useState(false);
50184
+ const sortedReactions = REACTION_ORDER.filter((type) => reactions[type] > 0).map((type) => {
50185
+ var _a, _b;
50186
+ return {
50187
+ type,
50188
+ count: reactions[type],
50189
+ viewerReacted: !!((_a = reactions.viewerReactions) == null ? void 0 : _a[type]),
50190
+ reactionId: (_b = reactions.viewerReactions) == null ? void 0 : _b[type]
50191
+ };
50192
+ });
50193
+ const handleReactionClick = (type, reactionId) => {
50194
+ if (disabled || !onToggleReaction) return;
50195
+ onToggleReaction(type, reactionId);
50196
+ };
50197
+ const handlePickerSelect = (type) => {
50198
+ var _a;
50199
+ setShowPicker(false);
50200
+ if (disabled || !onToggleReaction) return;
50201
+ const reactionId = (_a = reactions.viewerReactions) == null ? void 0 : _a[type];
50202
+ onToggleReaction(type, reactionId);
50203
+ };
50204
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", marginTop: "8px", flexWrap: "wrap", position: "relative" }, children: [
50205
+ sortedReactions.map(({ type, count, viewerReacted, reactionId }) => /* @__PURE__ */ jsxs(
50206
+ "button",
50207
+ {
50208
+ type: "button",
50209
+ onClick: (e) => {
50210
+ e.stopPropagation();
50211
+ handleReactionClick(type, reactionId);
50212
+ },
50213
+ disabled,
50214
+ style: {
50215
+ display: "inline-flex",
50216
+ alignItems: "center",
50217
+ gap: "4px",
50218
+ padding: "2px 8px",
50219
+ borderRadius: "12px",
50220
+ backgroundColor: viewerReacted ? `${theme2.colors.primary}20` : theme2.colors.backgroundSecondary,
50221
+ border: `1px solid ${viewerReacted ? theme2.colors.primary : theme2.colors.border}`,
50222
+ fontSize: theme2.fontSizes[0],
50223
+ cursor: disabled ? "default" : "pointer",
50224
+ opacity: disabled ? 0.5 : 1,
50225
+ transition: "all 0.2s"
50226
+ },
50227
+ title: viewerReacted ? "Remove reaction" : "Add reaction",
50228
+ children: [
50229
+ /* @__PURE__ */ jsx("span", { children: REACTION_EMOJI[type] }),
50230
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: viewerReacted ? theme2.colors.primary : theme2.colors.textSecondary }, children: count })
50231
+ ]
49702
50232
  },
49703
- children: [
49704
- /* @__PURE__ */ jsx("span", { children: emoji }),
49705
- /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: theme2.colors.textSecondary }, children: count })
49706
- ]
49707
- },
49708
- emoji
49709
- )) });
50233
+ type
50234
+ )),
50235
+ onToggleReaction && /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
50236
+ /* @__PURE__ */ jsx(
50237
+ "button",
50238
+ {
50239
+ type: "button",
50240
+ onClick: (e) => {
50241
+ e.stopPropagation();
50242
+ setShowPicker(!showPicker);
50243
+ },
50244
+ disabled,
50245
+ style: {
50246
+ display: "inline-flex",
50247
+ alignItems: "center",
50248
+ justifyContent: "center",
50249
+ width: "24px",
50250
+ height: "24px",
50251
+ borderRadius: "12px",
50252
+ backgroundColor: theme2.colors.backgroundSecondary,
50253
+ border: `1px solid ${theme2.colors.border}`,
50254
+ fontSize: theme2.fontSizes[1],
50255
+ color: theme2.colors.textMuted,
50256
+ cursor: disabled ? "default" : "pointer",
50257
+ opacity: disabled ? 0.5 : 1,
50258
+ transition: "all 0.2s"
50259
+ },
50260
+ title: "Add reaction",
50261
+ children: "+"
50262
+ }
50263
+ ),
50264
+ showPicker && /* @__PURE__ */ jsx(
50265
+ "div",
50266
+ {
50267
+ style: {
50268
+ position: "absolute",
50269
+ bottom: "100%",
50270
+ left: 0,
50271
+ marginBottom: "4px",
50272
+ padding: "4px",
50273
+ borderRadius: "8px",
50274
+ backgroundColor: theme2.colors.background,
50275
+ border: `1px solid ${theme2.colors.border}`,
50276
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
50277
+ display: "flex",
50278
+ gap: "2px",
50279
+ zIndex: 1e3
50280
+ },
50281
+ onClick: (e) => e.stopPropagation(),
50282
+ children: REACTION_ORDER.map((type) => {
50283
+ var _a;
50284
+ const viewerReacted = !!((_a = reactions.viewerReactions) == null ? void 0 : _a[type]);
50285
+ return /* @__PURE__ */ jsx(
50286
+ "button",
50287
+ {
50288
+ type: "button",
50289
+ onClick: (e) => {
50290
+ e.stopPropagation();
50291
+ handlePickerSelect(type);
50292
+ },
50293
+ style: {
50294
+ padding: "4px",
50295
+ borderRadius: "4px",
50296
+ backgroundColor: viewerReacted ? `${theme2.colors.primary}20` : "transparent",
50297
+ border: "none",
50298
+ cursor: "pointer",
50299
+ fontSize: "16px",
50300
+ transition: "transform 0.2s"
50301
+ },
50302
+ title: type,
50303
+ onMouseEnter: (e) => {
50304
+ e.currentTarget.style.transform = "scale(1.25)";
50305
+ },
50306
+ onMouseLeave: (e) => {
50307
+ e.currentTarget.style.transform = "scale(1)";
50308
+ },
50309
+ children: REACTION_EMOJI[type]
50310
+ },
50311
+ type
50312
+ );
50313
+ })
50314
+ }
50315
+ )
50316
+ ] })
50317
+ ] });
49710
50318
  };
49711
- const CommentEvent = ({ event }) => {
50319
+ const CommentEvent = ({ event, onToggleReaction, getMergedReactions }) => {
49712
50320
  const { theme: theme2 } = useTheme();
49713
50321
  const user = event.user || event.actor;
50322
+ const mergedReactions = getMergedReactions ? getMergedReactions(event.id, "comment", event.reactions) : event.reactions;
49714
50323
  return /* @__PURE__ */ jsxs(
49715
50324
  "div",
49716
50325
  {
@@ -49798,7 +50407,13 @@ const CommentEvent = ({ event }) => {
49798
50407
  )
49799
50408
  }
49800
50409
  ),
49801
- event.reactions && /* @__PURE__ */ jsx(ReactionsDisplay, { reactions: event.reactions })
50410
+ mergedReactions && /* @__PURE__ */ jsx(
50411
+ ReactionBar,
50412
+ {
50413
+ reactions: mergedReactions,
50414
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(event.id, "comment", type, reactionId) : void 0
50415
+ }
50416
+ )
49802
50417
  ] })
49803
50418
  ]
49804
50419
  }
@@ -49931,7 +50546,7 @@ const CommitEvent = ({ event }) => {
49931
50546
  gap: "12px",
49932
50547
  padding: "12px 16px",
49933
50548
  borderBottom: `1px solid ${theme2.colors.border}`,
49934
- backgroundColor: theme2.colors.background
50549
+ backgroundColor: theme2.colors.backgroundSecondary
49935
50550
  },
49936
50551
  children: [
49937
50552
  /* @__PURE__ */ jsx(
@@ -50216,8 +50831,9 @@ const RefEvent = ({ event }) => {
50216
50831
  }
50217
50832
  );
50218
50833
  };
50219
- const InlineReviewComment = ({ comment: comment2 }) => {
50834
+ const InlineReviewComment = ({ comment: comment2, onToggleReaction, getMergedReactions }) => {
50220
50835
  const { theme: theme2 } = useTheme();
50836
+ const mergedReactions = getMergedReactions ? getMergedReactions(comment2.id, "review_comment", comment2.reactions) : comment2.reactions;
50221
50837
  return /* @__PURE__ */ jsxs(
50222
50838
  "div",
50223
50839
  {
@@ -50285,24 +50901,6 @@ const InlineReviewComment = ({ comment: comment2 }) => {
50285
50901
  ]
50286
50902
  }
50287
50903
  ),
50288
- comment2.diff_hunk && /* @__PURE__ */ jsx(
50289
- "pre",
50290
- {
50291
- style: {
50292
- margin: "0 0 8px 0",
50293
- padding: "8px",
50294
- backgroundColor: theme2.colors.background,
50295
- border: `1px solid ${theme2.colors.border}`,
50296
- borderRadius: "6px",
50297
- fontFamily: theme2.fonts.monospace,
50298
- fontSize: "11px",
50299
- color: theme2.colors.textSecondary,
50300
- overflow: "auto",
50301
- maxHeight: "100px"
50302
- },
50303
- children: comment2.diff_hunk
50304
- }
50305
- ),
50306
50904
  /* @__PURE__ */ jsx(
50307
50905
  "div",
50308
50906
  {
@@ -50310,7 +50908,8 @@ const InlineReviewComment = ({ comment: comment2 }) => {
50310
50908
  backgroundColor: theme2.colors.background,
50311
50909
  border: `1px solid ${theme2.colors.border}`,
50312
50910
  borderRadius: "6px",
50313
- overflow: "hidden"
50911
+ overflow: "hidden",
50912
+ marginBottom: comment2.diff_hunk ? "8px" : 0
50314
50913
  },
50315
50914
  children: /* @__PURE__ */ jsx(
50316
50915
  DocumentView,
@@ -50323,16 +50922,47 @@ const InlineReviewComment = ({ comment: comment2 }) => {
50323
50922
  )
50324
50923
  }
50325
50924
  ),
50326
- comment2.reactions && /* @__PURE__ */ jsx(ReactionsDisplay, { reactions: comment2.reactions })
50925
+ comment2.diff_hunk && /* @__PURE__ */ jsx(
50926
+ "pre",
50927
+ {
50928
+ style: {
50929
+ margin: 0,
50930
+ padding: "8px",
50931
+ backgroundColor: theme2.colors.background,
50932
+ border: `1px solid ${theme2.colors.border}`,
50933
+ borderRadius: "6px",
50934
+ fontFamily: theme2.fonts.monospace,
50935
+ fontSize: "11px",
50936
+ color: theme2.colors.textSecondary,
50937
+ overflow: "auto",
50938
+ maxHeight: "100px"
50939
+ },
50940
+ children: comment2.diff_hunk
50941
+ }
50942
+ ),
50943
+ mergedReactions && /* @__PURE__ */ jsx(
50944
+ ReactionBar,
50945
+ {
50946
+ reactions: mergedReactions,
50947
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(comment2.id, "review_comment", type, reactionId) : void 0
50948
+ }
50949
+ )
50327
50950
  ] })
50328
50951
  ]
50329
50952
  }
50330
50953
  );
50331
50954
  };
50332
- const TimelineEventRenderer = ({ event }) => {
50955
+ const TimelineEventRenderer = ({ event, onToggleReaction, getMergedReactions }) => {
50333
50956
  switch (event.event) {
50334
50957
  case "commented":
50335
- return /* @__PURE__ */ jsx(CommentEvent, { event });
50958
+ return /* @__PURE__ */ jsx(
50959
+ CommentEvent,
50960
+ {
50961
+ event,
50962
+ onToggleReaction,
50963
+ getMergedReactions
50964
+ }
50965
+ );
50336
50966
  case "reviewed":
50337
50967
  return /* @__PURE__ */ jsx(ReviewEvent, { event });
50338
50968
  case "committed":
@@ -50362,6 +50992,146 @@ const TimelineEventRenderer = ({ event }) => {
50362
50992
  const GitHubMessagesPanelContent = ({ context, events }) => {
50363
50993
  const { theme: theme2 } = useTheme();
50364
50994
  const panelRef = useRef(null);
50995
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
50996
+ const [localReactions, setLocalReactions] = useState({});
50997
+ const [hiddenMessages, setHiddenMessages] = useState(() => {
50998
+ if (typeof window !== "undefined") {
50999
+ const stored = localStorage.getItem("github-messages-hidden");
51000
+ return stored ? new Set(JSON.parse(stored)) : /* @__PURE__ */ new Set();
51001
+ }
51002
+ return /* @__PURE__ */ new Set();
51003
+ });
51004
+ const [showHiddenMessages, setShowHiddenMessages] = useState(false);
51005
+ const handleDelete2 = () => {
51006
+ const messagesSlice2 = context.getSlice("github-messages");
51007
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51008
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && events) {
51009
+ const { target: target2, owner, repo } = messagesData2;
51010
+ events.emit({
51011
+ type: target2.type === "pull_request" ? "github-pr:delete" : "github-issue:delete",
51012
+ source: "github-messages-panel",
51013
+ timestamp: Date.now(),
51014
+ payload: {
51015
+ owner,
51016
+ repo,
51017
+ number: target2.number
51018
+ }
51019
+ });
51020
+ }
51021
+ setShowDeleteConfirm(false);
51022
+ };
51023
+ const handleToggleReaction = useCallback((itemId, itemType, reactionType, currentReactionId) => {
51024
+ const messagesSlice2 = context.getSlice("github-messages");
51025
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51026
+ if (!(messagesData2 == null ? void 0 : messagesData2.target) || !events) return;
51027
+ const { owner, repo, target: target2 } = messagesData2;
51028
+ const key = `${itemType}-${itemId}`;
51029
+ setLocalReactions((prev) => {
51030
+ const current = prev[key] || {
51031
+ url: "",
51032
+ total_count: 0,
51033
+ "+1": 0,
51034
+ "-1": 0,
51035
+ laugh: 0,
51036
+ hooray: 0,
51037
+ confused: 0,
51038
+ heart: 0,
51039
+ rocket: 0,
51040
+ eyes: 0,
51041
+ viewerReactions: {}
51042
+ };
51043
+ const updated = { ...current };
51044
+ const viewerReactions = { ...updated.viewerReactions };
51045
+ if (currentReactionId) {
51046
+ updated[reactionType] = Math.max(0, (updated[reactionType] || 0) - 1);
51047
+ updated.total_count = Math.max(0, updated.total_count - 1);
51048
+ delete viewerReactions[reactionType];
51049
+ } else {
51050
+ updated[reactionType] = (updated[reactionType] || 0) + 1;
51051
+ updated.total_count = (updated.total_count || 0) + 1;
51052
+ viewerReactions[reactionType] = -1;
51053
+ }
51054
+ updated.viewerReactions = viewerReactions;
51055
+ return { ...prev, [key]: updated };
51056
+ });
51057
+ if (currentReactionId) {
51058
+ events.emit({
51059
+ type: "github-messages:reaction:remove",
51060
+ source: "github-messages-panel",
51061
+ timestamp: Date.now(),
51062
+ payload: {
51063
+ owner,
51064
+ repo,
51065
+ targetType: target2.type,
51066
+ targetNumber: target2.number,
51067
+ itemType,
51068
+ itemId,
51069
+ reactionId: currentReactionId
51070
+ }
51071
+ });
51072
+ } else {
51073
+ events.emit({
51074
+ type: "github-messages:reaction:add",
51075
+ source: "github-messages-panel",
51076
+ timestamp: Date.now(),
51077
+ payload: {
51078
+ owner,
51079
+ repo,
51080
+ targetType: target2.type,
51081
+ targetNumber: target2.number,
51082
+ itemType,
51083
+ itemId,
51084
+ reactionType
51085
+ }
51086
+ });
51087
+ setHiddenMessages((prev) => {
51088
+ const next2 = new Set(prev);
51089
+ next2.add(key);
51090
+ if (typeof window !== "undefined") {
51091
+ localStorage.setItem("github-messages-hidden", JSON.stringify([...next2]));
51092
+ }
51093
+ return next2;
51094
+ });
51095
+ }
51096
+ }, [context, events]);
51097
+ const getMergedReactions = useCallback((itemId, itemType, apiReactions) => {
51098
+ const key = `${itemType}-${itemId}`;
51099
+ const local = localReactions[key];
51100
+ if (!apiReactions && !local) {
51101
+ return {
51102
+ url: "",
51103
+ total_count: 0,
51104
+ "+1": 0,
51105
+ "-1": 0,
51106
+ laugh: 0,
51107
+ hooray: 0,
51108
+ confused: 0,
51109
+ heart: 0,
51110
+ rocket: 0,
51111
+ eyes: 0,
51112
+ viewerReactions: {}
51113
+ };
51114
+ }
51115
+ if (local) {
51116
+ return local;
51117
+ }
51118
+ return {
51119
+ ...apiReactions,
51120
+ viewerReactions: {}
51121
+ };
51122
+ }, [localReactions]);
51123
+ const getMergedTimeline = useCallback((timeline2, reviewComments2) => {
51124
+ const merged = [
51125
+ ...timeline2.map((event) => ({ type: "event", data: event })),
51126
+ ...reviewComments2.map((comment2) => ({ type: "review_comment", data: comment2 }))
51127
+ ];
51128
+ merged.sort((a, b) => {
51129
+ const timeA = a.type === "event" ? getEventTimestamp(a.data) : a.data.created_at;
51130
+ const timeB = b.type === "event" ? getEventTimestamp(b.data) : b.data.created_at;
51131
+ return new Date(timeA).getTime() - new Date(timeB).getTime();
51132
+ });
51133
+ return merged;
51134
+ }, []);
50365
51135
  gt(
50366
51136
  "github-messages",
50367
51137
  events,
@@ -50509,30 +51279,150 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
50509
51279
  "div",
50510
51280
  {
50511
51281
  style: {
50512
- height: "40px",
50513
51282
  minHeight: "40px",
50514
- padding: "0 12px",
51283
+ padding: "8px 12px",
50515
51284
  borderBottom: `1px solid ${theme2.colors.border}`,
50516
51285
  backgroundColor: theme2.colors.backgroundSecondary,
50517
51286
  display: "flex",
50518
51287
  alignItems: "center",
50519
- gap: "12px",
50520
- boxSizing: "border-box"
51288
+ gap: "8px",
51289
+ boxSizing: "border-box",
51290
+ flexWrap: "wrap"
50521
51291
  },
50522
51292
  children: [
51293
+ target.labels && target.labels.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" }, children: [
51294
+ /* @__PURE__ */ jsx(
51295
+ "span",
51296
+ {
51297
+ style: {
51298
+ fontFamily: theme2.fonts.body,
51299
+ fontSize: theme2.fontSizes[0],
51300
+ color: theme2.colors.textMuted,
51301
+ fontWeight: 500
51302
+ },
51303
+ children: "Tagged as"
51304
+ }
51305
+ ),
51306
+ target.labels.map((label) => /* @__PURE__ */ jsx(
51307
+ "span",
51308
+ {
51309
+ style: {
51310
+ padding: "2px 8px",
51311
+ borderRadius: "12px",
51312
+ backgroundColor: `#${label.color}`,
51313
+ color: parseInt(label.color, 16) > 8388607 ? "#000" : "#fff",
51314
+ fontFamily: theme2.fonts.body,
51315
+ fontSize: theme2.fontSizes[0],
51316
+ fontWeight: 500
51317
+ },
51318
+ children: label.name
51319
+ },
51320
+ label.id
51321
+ ))
51322
+ ] }),
51323
+ target.assignees && target.assignees.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" }, children: [
51324
+ /* @__PURE__ */ jsx(
51325
+ "span",
51326
+ {
51327
+ style: {
51328
+ fontFamily: theme2.fonts.body,
51329
+ fontSize: theme2.fontSizes[0],
51330
+ color: theme2.colors.textMuted,
51331
+ fontWeight: 500
51332
+ },
51333
+ children: "Assigned to"
51334
+ }
51335
+ ),
51336
+ target.assignees.map((assignee) => /* @__PURE__ */ jsxs(
51337
+ "div",
51338
+ {
51339
+ style: {
51340
+ display: "flex",
51341
+ alignItems: "center",
51342
+ gap: "4px",
51343
+ padding: "2px 8px",
51344
+ borderRadius: "12px",
51345
+ backgroundColor: theme2.colors.backgroundSecondary,
51346
+ border: `1px solid ${theme2.colors.border}`
51347
+ },
51348
+ children: [
51349
+ /* @__PURE__ */ jsx(
51350
+ "img",
51351
+ {
51352
+ src: assignee.avatar_url,
51353
+ alt: assignee.login,
51354
+ style: {
51355
+ width: 20,
51356
+ height: 20,
51357
+ borderRadius: "50%"
51358
+ }
51359
+ }
51360
+ ),
51361
+ /* @__PURE__ */ jsx(
51362
+ "span",
51363
+ {
51364
+ style: {
51365
+ fontFamily: theme2.fonts.body,
51366
+ fontSize: theme2.fontSizes[0],
51367
+ color: theme2.colors.text,
51368
+ fontWeight: 500
51369
+ },
51370
+ children: assignee.login
51371
+ }
51372
+ )
51373
+ ]
51374
+ },
51375
+ assignee.login
51376
+ ))
51377
+ ] }),
51378
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
51379
+ hiddenMessages.size > 0 && /* @__PURE__ */ jsxs(
51380
+ "button",
51381
+ {
51382
+ type: "button",
51383
+ onClick: () => setShowHiddenMessages(!showHiddenMessages),
51384
+ title: showHiddenMessages ? "Hide reacted messages" : `Show ${hiddenMessages.size} hidden message${hiddenMessages.size > 1 ? "s" : ""}`,
51385
+ style: {
51386
+ display: "inline-flex",
51387
+ alignItems: "center",
51388
+ justifyContent: "center",
51389
+ gap: "4px",
51390
+ height: "28px",
51391
+ padding: "0 8px",
51392
+ border: `1px solid ${theme2.colors.border}`,
51393
+ borderRadius: "6px",
51394
+ backgroundColor: showHiddenMessages ? `${theme2.colors.primary}20` : theme2.colors.background,
51395
+ color: showHiddenMessages ? theme2.colors.primary : theme2.colors.textSecondary,
51396
+ cursor: "pointer",
51397
+ fontSize: theme2.fontSizes[0],
51398
+ fontFamily: theme2.fonts.body
51399
+ },
51400
+ children: [
51401
+ /* @__PURE__ */ jsx(EyeOff, { size: 14 }),
51402
+ /* @__PURE__ */ jsx("span", { children: hiddenMessages.size })
51403
+ ]
51404
+ }
51405
+ ),
50523
51406
  /* @__PURE__ */ jsx(
50524
- "span",
51407
+ "button",
50525
51408
  {
51409
+ type: "button",
51410
+ onClick: () => setShowDeleteConfirm(true),
51411
+ title: "Delete issue",
50526
51412
  style: {
50527
- flex: 1,
50528
- overflow: "hidden",
50529
- textOverflow: "ellipsis",
50530
- whiteSpace: "nowrap",
50531
- fontFamily: theme2.fonts.heading,
50532
- color: theme2.colors.text,
50533
- fontSize: theme2.fontSizes[1]
51413
+ display: "inline-flex",
51414
+ alignItems: "center",
51415
+ justifyContent: "center",
51416
+ width: "28px",
51417
+ height: "28px",
51418
+ padding: 0,
51419
+ border: `1px solid ${theme2.colors.border}`,
51420
+ borderRadius: "6px",
51421
+ backgroundColor: theme2.colors.background,
51422
+ color: theme2.colors.textSecondary,
51423
+ cursor: "pointer"
50534
51424
  },
50535
- children: target.title
51425
+ children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
50536
51426
  }
50537
51427
  ),
50538
51428
  /* @__PURE__ */ jsx(
@@ -50580,32 +51470,200 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
50580
51470
  },
50581
51471
  children: "No activity yet."
50582
51472
  }
50583
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
50584
- timeline.map((event, index2) => /* @__PURE__ */ jsx(TimelineEventRenderer, { event }, `${event.event}-${index2}`)),
50585
- reviewComments.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
50586
- /* @__PURE__ */ jsxs(
50587
- "div",
51473
+ ) : /* @__PURE__ */ jsx(Fragment, { children: getMergedTimeline(timeline, reviewComments).filter((item) => {
51474
+ if (item.type === "event") {
51475
+ const event = item.data;
51476
+ if (!showHiddenMessages && event.event === "commented") {
51477
+ const key = `comment-${event.id}`;
51478
+ if (hiddenMessages.has(key)) return false;
51479
+ }
51480
+ if (event.event === "labeled" || event.event === "unlabeled") {
51481
+ return false;
51482
+ }
51483
+ if (event.event === "assigned" || event.event === "unassigned") {
51484
+ return false;
51485
+ }
51486
+ return true;
51487
+ } else {
51488
+ const comment2 = item.data;
51489
+ if (!showHiddenMessages) {
51490
+ const key = `review_comment-${comment2.id}`;
51491
+ if (hiddenMessages.has(key)) return false;
51492
+ }
51493
+ return true;
51494
+ }
51495
+ }).map((item, index2) => {
51496
+ if (item.type === "event") {
51497
+ const event = item.data;
51498
+ return /* @__PURE__ */ jsx(
51499
+ TimelineEventRenderer,
50588
51500
  {
50589
- style: {
50590
- padding: "12px 16px",
50591
- backgroundColor: theme2.colors.backgroundSecondary,
50592
- borderBottom: `1px solid ${theme2.colors.border}`,
50593
- fontFamily: theme2.fonts.heading,
50594
- fontWeight: 600,
50595
- fontSize: theme2.fontSizes[0],
50596
- color: theme2.colors.textSecondary,
50597
- textTransform: "uppercase"
50598
- },
50599
- children: [
50600
- "Inline Review Comments (",
50601
- reviewComments.length,
50602
- ")"
50603
- ]
50604
- }
50605
- ),
50606
- reviewComments.map((comment2) => /* @__PURE__ */ jsx(InlineReviewComment, { comment: comment2 }, comment2.id))
50607
- ] })
50608
- ] })
51501
+ event,
51502
+ onToggleReaction: handleToggleReaction,
51503
+ getMergedReactions
51504
+ },
51505
+ `event-${event.event}-${index2}`
51506
+ );
51507
+ } else {
51508
+ const comment2 = item.data;
51509
+ return /* @__PURE__ */ jsx(
51510
+ InlineReviewComment,
51511
+ {
51512
+ comment: comment2,
51513
+ onToggleReaction: handleToggleReaction,
51514
+ getMergedReactions
51515
+ },
51516
+ `review-comment-${comment2.id}`
51517
+ );
51518
+ }
51519
+ }) })
51520
+ }
51521
+ ),
51522
+ showDeleteConfirm && /* @__PURE__ */ jsx(
51523
+ "div",
51524
+ {
51525
+ style: {
51526
+ position: "absolute",
51527
+ top: 0,
51528
+ left: 0,
51529
+ right: 0,
51530
+ bottom: 0,
51531
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
51532
+ display: "flex",
51533
+ alignItems: "center",
51534
+ justifyContent: "center",
51535
+ zIndex: 1e3
51536
+ },
51537
+ onClick: () => setShowDeleteConfirm(false),
51538
+ children: /* @__PURE__ */ jsxs(
51539
+ "div",
51540
+ {
51541
+ style: {
51542
+ backgroundColor: theme2.colors.background,
51543
+ border: `1px solid ${theme2.colors.border}`,
51544
+ borderRadius: "8px",
51545
+ padding: "24px",
51546
+ minWidth: "320px",
51547
+ maxWidth: "400px",
51548
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
51549
+ },
51550
+ onClick: (e) => e.stopPropagation(),
51551
+ children: [
51552
+ /* @__PURE__ */ jsxs(
51553
+ "div",
51554
+ {
51555
+ style: {
51556
+ display: "flex",
51557
+ alignItems: "center",
51558
+ gap: "12px",
51559
+ marginBottom: "16px"
51560
+ },
51561
+ children: [
51562
+ /* @__PURE__ */ jsx(
51563
+ "div",
51564
+ {
51565
+ style: {
51566
+ width: "40px",
51567
+ height: "40px",
51568
+ borderRadius: "50%",
51569
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
51570
+ display: "flex",
51571
+ alignItems: "center",
51572
+ justifyContent: "center",
51573
+ color: theme2.colors.error || "#ef4444"
51574
+ },
51575
+ children: /* @__PURE__ */ jsx(Trash2, { size: 20 })
51576
+ }
51577
+ ),
51578
+ /* @__PURE__ */ jsxs(
51579
+ "h3",
51580
+ {
51581
+ style: {
51582
+ margin: 0,
51583
+ fontFamily: theme2.fonts.heading,
51584
+ fontSize: theme2.fontSizes[2],
51585
+ fontWeight: 600,
51586
+ color: theme2.colors.text
51587
+ },
51588
+ children: [
51589
+ "Delete ",
51590
+ target.type === "pull_request" ? "Pull Request" : "Issue",
51591
+ "?"
51592
+ ]
51593
+ }
51594
+ )
51595
+ ]
51596
+ }
51597
+ ),
51598
+ /* @__PURE__ */ jsxs(
51599
+ "p",
51600
+ {
51601
+ style: {
51602
+ margin: "0 0 24px 0",
51603
+ fontFamily: theme2.fonts.body,
51604
+ fontSize: theme2.fontSizes[1],
51605
+ color: theme2.colors.textSecondary,
51606
+ lineHeight: 1.5
51607
+ },
51608
+ children: [
51609
+ 'Are you sure you want to delete "',
51610
+ target.title,
51611
+ '"? This action cannot be undone.'
51612
+ ]
51613
+ }
51614
+ ),
51615
+ /* @__PURE__ */ jsxs(
51616
+ "div",
51617
+ {
51618
+ style: {
51619
+ display: "flex",
51620
+ gap: "12px",
51621
+ justifyContent: "flex-end"
51622
+ },
51623
+ children: [
51624
+ /* @__PURE__ */ jsx(
51625
+ "button",
51626
+ {
51627
+ type: "button",
51628
+ onClick: () => setShowDeleteConfirm(false),
51629
+ style: {
51630
+ padding: "8px 16px",
51631
+ border: `1px solid ${theme2.colors.border}`,
51632
+ borderRadius: "6px",
51633
+ backgroundColor: theme2.colors.background,
51634
+ color: theme2.colors.text,
51635
+ fontFamily: theme2.fonts.body,
51636
+ fontSize: theme2.fontSizes[1],
51637
+ cursor: "pointer"
51638
+ },
51639
+ children: "Cancel"
51640
+ }
51641
+ ),
51642
+ /* @__PURE__ */ jsx(
51643
+ "button",
51644
+ {
51645
+ type: "button",
51646
+ onClick: handleDelete2,
51647
+ style: {
51648
+ padding: "8px 16px",
51649
+ border: "none",
51650
+ borderRadius: "6px",
51651
+ backgroundColor: theme2.colors.error || "#ef4444",
51652
+ color: "#ffffff",
51653
+ fontFamily: theme2.fonts.body,
51654
+ fontSize: theme2.fontSizes[1],
51655
+ fontWeight: 500,
51656
+ cursor: "pointer"
51657
+ },
51658
+ children: "Delete"
51659
+ }
51660
+ )
51661
+ ]
51662
+ }
51663
+ )
51664
+ ]
51665
+ }
51666
+ )
50609
51667
  }
50610
51668
  )
50611
51669
  ] });