@industry-theme/github-panels 0.1.55 → 0.1.56

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.
@@ -49184,6 +49184,7 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49184
49184
  const [modalStep, setModalStep] = useState("type");
49185
49185
  const [selectedTaskType, setSelectedTaskType] = useState(null);
49186
49186
  const [additionalInstructions, setAdditionalInstructions] = useState("");
49187
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
49187
49188
  const panelRef = useRef(null);
49188
49189
  gt(
49189
49190
  "github-issue-detail",
@@ -49284,6 +49285,21 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49284
49285
  });
49285
49286
  }
49286
49287
  };
49288
+ const handleDelete2 = () => {
49289
+ if (selectedIssue && events) {
49290
+ events.emit({
49291
+ type: "github-issue:delete",
49292
+ source: "github-issue-detail-panel",
49293
+ timestamp: Date.now(),
49294
+ payload: {
49295
+ owner,
49296
+ repo,
49297
+ number: selectedIssue.number
49298
+ }
49299
+ });
49300
+ }
49301
+ setShowDeleteConfirm(false);
49302
+ };
49287
49303
  const containerStyle = {
49288
49304
  display: "flex",
49289
49305
  flexDirection: "column",
@@ -49415,6 +49431,28 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49415
49431
  }
49416
49432
  ),
49417
49433
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
49434
+ /* @__PURE__ */ jsx(
49435
+ "button",
49436
+ {
49437
+ type: "button",
49438
+ onClick: () => setShowDeleteConfirm(true),
49439
+ title: "Delete issue",
49440
+ style: {
49441
+ display: "inline-flex",
49442
+ alignItems: "center",
49443
+ justifyContent: "center",
49444
+ width: "28px",
49445
+ height: "28px",
49446
+ padding: 0,
49447
+ border: `1px solid ${theme2.colors.border}`,
49448
+ borderRadius: "6px",
49449
+ backgroundColor: theme2.colors.background,
49450
+ color: theme2.colors.textSecondary,
49451
+ cursor: "pointer"
49452
+ },
49453
+ children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
49454
+ }
49455
+ ),
49418
49456
  /* @__PURE__ */ jsx(
49419
49457
  "a",
49420
49458
  {
@@ -50097,6 +50135,149 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
50097
50135
  }
50098
50136
  )
50099
50137
  }
50138
+ ),
50139
+ showDeleteConfirm && selectedIssue && /* @__PURE__ */ jsx(
50140
+ "div",
50141
+ {
50142
+ style: {
50143
+ position: "absolute",
50144
+ top: 0,
50145
+ left: 0,
50146
+ right: 0,
50147
+ bottom: 0,
50148
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
50149
+ display: "flex",
50150
+ alignItems: "center",
50151
+ justifyContent: "center",
50152
+ zIndex: 1e3
50153
+ },
50154
+ onClick: () => setShowDeleteConfirm(false),
50155
+ children: /* @__PURE__ */ jsxs(
50156
+ "div",
50157
+ {
50158
+ style: {
50159
+ backgroundColor: theme2.colors.background,
50160
+ border: `1px solid ${theme2.colors.border}`,
50161
+ borderRadius: "8px",
50162
+ padding: "24px",
50163
+ minWidth: "320px",
50164
+ maxWidth: "400px",
50165
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
50166
+ },
50167
+ onClick: (e) => e.stopPropagation(),
50168
+ children: [
50169
+ /* @__PURE__ */ jsxs(
50170
+ "div",
50171
+ {
50172
+ style: {
50173
+ display: "flex",
50174
+ alignItems: "center",
50175
+ gap: "12px",
50176
+ marginBottom: "16px"
50177
+ },
50178
+ children: [
50179
+ /* @__PURE__ */ jsx(
50180
+ "div",
50181
+ {
50182
+ style: {
50183
+ width: "40px",
50184
+ height: "40px",
50185
+ borderRadius: "50%",
50186
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
50187
+ display: "flex",
50188
+ alignItems: "center",
50189
+ justifyContent: "center",
50190
+ color: theme2.colors.error || "#ef4444"
50191
+ },
50192
+ children: /* @__PURE__ */ jsx(Trash2, { size: 20 })
50193
+ }
50194
+ ),
50195
+ /* @__PURE__ */ jsx(
50196
+ "h3",
50197
+ {
50198
+ style: {
50199
+ margin: 0,
50200
+ fontFamily: theme2.fonts.heading,
50201
+ fontSize: theme2.fontSizes[2],
50202
+ fontWeight: 600,
50203
+ color: theme2.colors.text
50204
+ },
50205
+ children: "Delete Issue?"
50206
+ }
50207
+ )
50208
+ ]
50209
+ }
50210
+ ),
50211
+ /* @__PURE__ */ jsxs(
50212
+ "p",
50213
+ {
50214
+ style: {
50215
+ margin: "0 0 24px 0",
50216
+ fontFamily: theme2.fonts.body,
50217
+ fontSize: theme2.fontSizes[1],
50218
+ color: theme2.colors.textSecondary,
50219
+ lineHeight: 1.5
50220
+ },
50221
+ children: [
50222
+ 'Are you sure you want to delete "',
50223
+ selectedIssue.title,
50224
+ '"? This action cannot be undone.'
50225
+ ]
50226
+ }
50227
+ ),
50228
+ /* @__PURE__ */ jsxs(
50229
+ "div",
50230
+ {
50231
+ style: {
50232
+ display: "flex",
50233
+ gap: "12px",
50234
+ justifyContent: "flex-end"
50235
+ },
50236
+ children: [
50237
+ /* @__PURE__ */ jsx(
50238
+ "button",
50239
+ {
50240
+ type: "button",
50241
+ onClick: () => setShowDeleteConfirm(false),
50242
+ style: {
50243
+ padding: "8px 16px",
50244
+ border: `1px solid ${theme2.colors.border}`,
50245
+ borderRadius: "6px",
50246
+ backgroundColor: theme2.colors.background,
50247
+ color: theme2.colors.text,
50248
+ fontFamily: theme2.fonts.body,
50249
+ fontSize: theme2.fontSizes[1],
50250
+ cursor: "pointer"
50251
+ },
50252
+ children: "Cancel"
50253
+ }
50254
+ ),
50255
+ /* @__PURE__ */ jsx(
50256
+ "button",
50257
+ {
50258
+ type: "button",
50259
+ onClick: handleDelete2,
50260
+ style: {
50261
+ padding: "8px 16px",
50262
+ border: "none",
50263
+ borderRadius: "6px",
50264
+ backgroundColor: theme2.colors.error || "#ef4444",
50265
+ color: "#ffffff",
50266
+ fontFamily: theme2.fonts.body,
50267
+ fontSize: theme2.fontSizes[1],
50268
+ fontWeight: 500,
50269
+ cursor: "pointer"
50270
+ },
50271
+ children: "Delete"
50272
+ }
50273
+ )
50274
+ ]
50275
+ }
50276
+ )
50277
+ ]
50278
+ }
50279
+ )
50280
+ }
50100
50281
  )
50101
50282
  ] });
50102
50283
  };
@@ -50319,108 +50500,153 @@ const ReactionBar = ({ reactions, onToggleReaction, disabled }) => {
50319
50500
  const CommentEvent = ({ event, onToggleReaction, getMergedReactions }) => {
50320
50501
  const { theme: theme2 } = useTheme();
50321
50502
  const user = event.user || event.actor;
50503
+ const containerRef = useRef(null);
50504
+ const [isLargeView, setIsLargeView] = useState(true);
50505
+ useEffect(() => {
50506
+ const checkWidth = () => {
50507
+ if (containerRef.current) {
50508
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
50509
+ }
50510
+ };
50511
+ checkWidth();
50512
+ window.addEventListener("resize", checkWidth);
50513
+ return () => window.removeEventListener("resize", checkWidth);
50514
+ }, []);
50322
50515
  const mergedReactions = getMergedReactions ? getMergedReactions(event.id, "comment", event.reactions) : event.reactions;
50323
50516
  return /* @__PURE__ */ jsxs(
50324
50517
  "div",
50325
50518
  {
50519
+ ref: containerRef,
50326
50520
  style: {
50327
- display: "flex",
50328
- gap: "12px",
50329
50521
  padding: "16px",
50330
50522
  borderBottom: `1px solid ${theme2.colors.border}`
50331
50523
  },
50332
50524
  children: [
50333
- /* @__PURE__ */ jsx(Avatar, { user }),
50334
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50335
- /* @__PURE__ */ jsxs(
50336
- "div",
50337
- {
50338
- style: {
50339
- display: "flex",
50340
- alignItems: "center",
50341
- gap: "8px",
50342
- marginBottom: "8px"
50343
- },
50344
- children: [
50345
- /* @__PURE__ */ jsx(
50346
- "span",
50347
- {
50348
- style: {
50349
- fontWeight: 600,
50350
- color: theme2.colors.text,
50351
- fontFamily: theme2.fonts.body,
50352
- fontSize: theme2.fontSizes[1]
50353
- },
50354
- children: user.login
50355
- }
50356
- ),
50357
- /* @__PURE__ */ jsxs(
50358
- "span",
50359
- {
50360
- style: {
50361
- fontFamily: theme2.fonts.body,
50362
- color: theme2.colors.textMuted,
50363
- fontSize: theme2.fontSizes[0]
50364
- },
50365
- children: [
50366
- "commented ",
50367
- formatDate(event.created_at)
50368
- ]
50369
- }
50370
- ),
50371
- event.author_association && event.author_association !== "NONE" && /* @__PURE__ */ jsx(
50372
- "span",
50373
- {
50374
- style: {
50375
- padding: "2px 6px",
50376
- borderRadius: "4px",
50377
- backgroundColor: theme2.colors.backgroundSecondary,
50378
- border: `1px solid ${theme2.colors.border}`,
50379
- fontFamily: theme2.fonts.body,
50380
- fontSize: theme2.fontSizes[0],
50381
- color: theme2.colors.textSecondary,
50382
- textTransform: "uppercase"
50383
- },
50384
- children: event.author_association.toLowerCase()
50385
- }
50386
- )
50387
- ]
50388
- }
50389
- ),
50390
- /* @__PURE__ */ jsx(
50391
- "div",
50392
- {
50393
- style: {
50394
- backgroundColor: theme2.colors.backgroundSecondary,
50395
- border: `1px solid ${theme2.colors.border}`,
50396
- borderRadius: "8px",
50397
- overflow: "hidden"
50398
- },
50399
- children: /* @__PURE__ */ jsx(
50400
- DocumentView,
50525
+ /* @__PURE__ */ jsxs(
50526
+ "div",
50527
+ {
50528
+ style: {
50529
+ display: "flex",
50530
+ gap: "12px",
50531
+ alignItems: "center",
50532
+ marginBottom: "8px"
50533
+ },
50534
+ children: [
50535
+ /* @__PURE__ */ jsx(Avatar, { user }),
50536
+ /* @__PURE__ */ jsxs(
50537
+ "div",
50401
50538
  {
50402
- content: event.body,
50403
- theme: theme2,
50404
- maxWidth: "100%",
50405
- transparentBackground: true
50406
- }
50407
- )
50408
- }
50409
- ),
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
- )
50417
- ] })
50418
- ]
50539
+ style: {
50540
+ display: "flex",
50541
+ alignItems: "center",
50542
+ gap: "8px",
50543
+ flex: 1,
50544
+ minWidth: 0
50545
+ },
50546
+ children: [
50547
+ /* @__PURE__ */ jsx(
50548
+ "span",
50549
+ {
50550
+ style: {
50551
+ fontWeight: 600,
50552
+ color: theme2.colors.text,
50553
+ fontFamily: theme2.fonts.body,
50554
+ fontSize: theme2.fontSizes[1]
50555
+ },
50556
+ children: user.login
50557
+ }
50558
+ ),
50559
+ /* @__PURE__ */ jsxs(
50560
+ "span",
50561
+ {
50562
+ style: {
50563
+ fontFamily: theme2.fonts.body,
50564
+ color: theme2.colors.textMuted,
50565
+ fontSize: theme2.fontSizes[0]
50566
+ },
50567
+ children: [
50568
+ "commented ",
50569
+ formatDate(event.created_at)
50570
+ ]
50571
+ }
50572
+ ),
50573
+ event.author_association && event.author_association !== "NONE" && /* @__PURE__ */ jsx(
50574
+ "span",
50575
+ {
50576
+ style: {
50577
+ padding: "2px 6px",
50578
+ borderRadius: "4px",
50579
+ backgroundColor: theme2.colors.backgroundSecondary,
50580
+ border: `1px solid ${theme2.colors.border}`,
50581
+ fontFamily: theme2.fonts.body,
50582
+ fontSize: theme2.fontSizes[0],
50583
+ color: theme2.colors.textSecondary,
50584
+ textTransform: "uppercase"
50585
+ },
50586
+ children: event.author_association.toLowerCase()
50587
+ }
50588
+ )
50589
+ ]
50590
+ }
50591
+ )
50592
+ ]
50593
+ }
50594
+ ),
50595
+ /* @__PURE__ */ jsxs(
50596
+ "div",
50597
+ {
50598
+ style: {
50599
+ marginLeft: isLargeView ? "44px" : "0"
50600
+ },
50601
+ children: [
50602
+ /* @__PURE__ */ jsx(
50603
+ "div",
50604
+ {
50605
+ style: {
50606
+ backgroundColor: theme2.colors.backgroundSecondary,
50607
+ border: `1px solid ${theme2.colors.border}`,
50608
+ borderRadius: "8px",
50609
+ overflow: "hidden"
50610
+ },
50611
+ children: /* @__PURE__ */ jsx(
50612
+ DocumentView,
50613
+ {
50614
+ content: event.body,
50615
+ theme: theme2,
50616
+ maxWidth: "100%",
50617
+ transparentBackground: true
50618
+ }
50619
+ )
50620
+ }
50621
+ ),
50622
+ mergedReactions && /* @__PURE__ */ jsx(
50623
+ ReactionBar,
50624
+ {
50625
+ reactions: mergedReactions,
50626
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(event.id, "comment", type, reactionId) : void 0
50627
+ }
50628
+ )
50629
+ ]
50630
+ }
50631
+ )
50632
+ ]
50419
50633
  }
50420
50634
  );
50421
50635
  };
50422
50636
  const ReviewEvent = ({ event }) => {
50423
50637
  const { theme: theme2 } = useTheme();
50638
+ const containerRef = useRef(null);
50639
+ const [isLargeView, setIsLargeView] = useState(true);
50640
+ useEffect(() => {
50641
+ const checkWidth = () => {
50642
+ if (containerRef.current) {
50643
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
50644
+ }
50645
+ };
50646
+ checkWidth();
50647
+ window.addEventListener("resize", checkWidth);
50648
+ return () => window.removeEventListener("resize", checkWidth);
50649
+ }, []);
50424
50650
  const stateConfig = {
50425
50651
  approved: {
50426
50652
  icon: /* @__PURE__ */ jsx(Check, { size: 16 }),
@@ -50447,85 +50673,104 @@ const ReviewEvent = ({ event }) => {
50447
50673
  return /* @__PURE__ */ jsxs(
50448
50674
  "div",
50449
50675
  {
50676
+ ref: containerRef,
50450
50677
  style: {
50451
- display: "flex",
50452
- gap: "12px",
50453
50678
  padding: "16px",
50454
50679
  borderBottom: `1px solid ${theme2.colors.border}`
50455
50680
  },
50456
50681
  children: [
50457
- /* @__PURE__ */ jsx(Avatar, { user: event.user }),
50458
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50459
- /* @__PURE__ */ jsxs(
50460
- "div",
50461
- {
50462
- style: {
50463
- display: "flex",
50464
- alignItems: "center",
50465
- gap: "8px",
50466
- marginBottom: event.body ? "8px" : 0
50467
- },
50468
- children: [
50469
- /* @__PURE__ */ jsx("span", { style: { color: config.color }, children: config.icon }),
50470
- /* @__PURE__ */ jsx(
50471
- "span",
50472
- {
50473
- style: {
50474
- fontWeight: 600,
50475
- color: theme2.colors.text,
50476
- fontFamily: theme2.fonts.body,
50477
- fontSize: theme2.fontSizes[1]
50478
- },
50479
- children: event.user.login
50480
- }
50481
- ),
50482
- /* @__PURE__ */ jsx(
50483
- "span",
50484
- {
50485
- style: {
50486
- fontFamily: theme2.fonts.body,
50487
- color: config.color,
50488
- fontWeight: 500,
50489
- fontSize: theme2.fontSizes[1]
50490
- },
50491
- children: config.label
50492
- }
50493
- ),
50494
- /* @__PURE__ */ jsx(
50495
- "span",
50496
- {
50497
- style: {
50498
- fontFamily: theme2.fonts.body,
50499
- color: theme2.colors.textMuted,
50500
- fontSize: theme2.fontSizes[0]
50501
- },
50502
- children: formatDate(event.submitted_at)
50503
- }
50504
- )
50505
- ]
50506
- }
50507
- ),
50508
- event.body && /* @__PURE__ */ jsx(
50509
- "div",
50510
- {
50511
- style: {
50512
- backgroundColor: theme2.colors.backgroundSecondary,
50513
- border: `1px solid ${theme2.colors.border}`,
50514
- borderRadius: "8px",
50515
- overflow: "hidden"
50516
- },
50517
- children: /* @__PURE__ */ jsx(
50518
- DocumentView,
50682
+ /* @__PURE__ */ jsxs(
50683
+ "div",
50684
+ {
50685
+ style: {
50686
+ display: "flex",
50687
+ gap: "12px",
50688
+ alignItems: "center",
50689
+ marginBottom: event.body ? "8px" : 0
50690
+ },
50691
+ children: [
50692
+ /* @__PURE__ */ jsx(Avatar, { user: event.user }),
50693
+ /* @__PURE__ */ jsxs(
50694
+ "div",
50519
50695
  {
50520
- content: event.body,
50521
- theme: theme2,
50522
- maxWidth: "100%",
50523
- transparentBackground: true
50696
+ style: {
50697
+ display: "flex",
50698
+ alignItems: "center",
50699
+ gap: "8px",
50700
+ flex: 1,
50701
+ minWidth: 0
50702
+ },
50703
+ children: [
50704
+ /* @__PURE__ */ jsx("span", { style: { color: config.color }, children: config.icon }),
50705
+ /* @__PURE__ */ jsx(
50706
+ "span",
50707
+ {
50708
+ style: {
50709
+ fontWeight: 600,
50710
+ color: theme2.colors.text,
50711
+ fontFamily: theme2.fonts.body,
50712
+ fontSize: theme2.fontSizes[1]
50713
+ },
50714
+ children: event.user.login
50715
+ }
50716
+ ),
50717
+ /* @__PURE__ */ jsx(
50718
+ "span",
50719
+ {
50720
+ style: {
50721
+ fontFamily: theme2.fonts.body,
50722
+ color: config.color,
50723
+ fontWeight: 500,
50724
+ fontSize: theme2.fontSizes[1]
50725
+ },
50726
+ children: config.label
50727
+ }
50728
+ ),
50729
+ /* @__PURE__ */ jsx(
50730
+ "span",
50731
+ {
50732
+ style: {
50733
+ fontFamily: theme2.fonts.body,
50734
+ color: theme2.colors.textMuted,
50735
+ fontSize: theme2.fontSizes[0]
50736
+ },
50737
+ children: formatDate(event.submitted_at)
50738
+ }
50739
+ )
50740
+ ]
50524
50741
  }
50525
50742
  )
50526
- }
50527
- )
50528
- ] })
50743
+ ]
50744
+ }
50745
+ ),
50746
+ event.body && /* @__PURE__ */ jsx(
50747
+ "div",
50748
+ {
50749
+ style: {
50750
+ marginLeft: isLargeView ? "44px" : "0"
50751
+ },
50752
+ children: /* @__PURE__ */ jsx(
50753
+ "div",
50754
+ {
50755
+ style: {
50756
+ backgroundColor: theme2.colors.backgroundSecondary,
50757
+ border: `1px solid ${theme2.colors.border}`,
50758
+ borderRadius: "8px",
50759
+ overflow: "hidden"
50760
+ },
50761
+ children: /* @__PURE__ */ jsx(
50762
+ DocumentView,
50763
+ {
50764
+ content: event.body,
50765
+ theme: theme2,
50766
+ maxWidth: "100%",
50767
+ transparentBackground: true
50768
+ }
50769
+ )
50770
+ }
50771
+ )
50772
+ }
50773
+ )
50529
50774
  ]
50530
50775
  }
50531
50776
  );
@@ -50833,121 +51078,154 @@ const RefEvent = ({ event }) => {
50833
51078
  };
50834
51079
  const InlineReviewComment = ({ comment: comment2, onToggleReaction, getMergedReactions }) => {
50835
51080
  const { theme: theme2 } = useTheme();
51081
+ const containerRef = useRef(null);
51082
+ const [isLargeView, setIsLargeView] = useState(true);
51083
+ useEffect(() => {
51084
+ const checkWidth = () => {
51085
+ if (containerRef.current) {
51086
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
51087
+ }
51088
+ };
51089
+ checkWidth();
51090
+ window.addEventListener("resize", checkWidth);
51091
+ return () => window.removeEventListener("resize", checkWidth);
51092
+ }, []);
50836
51093
  const mergedReactions = getMergedReactions ? getMergedReactions(comment2.id, "review_comment", comment2.reactions) : comment2.reactions;
50837
51094
  return /* @__PURE__ */ jsxs(
50838
51095
  "div",
50839
51096
  {
51097
+ ref: containerRef,
50840
51098
  style: {
50841
- display: "flex",
50842
- gap: "12px",
50843
51099
  padding: "12px 16px",
50844
51100
  borderBottom: `1px solid ${theme2.colors.border}`,
50845
51101
  backgroundColor: theme2.colors.backgroundSecondary
50846
51102
  },
50847
51103
  children: [
50848
- /* @__PURE__ */ jsx(Avatar, { user: comment2.user, size: 28 }),
50849
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50850
- /* @__PURE__ */ jsxs(
50851
- "div",
50852
- {
50853
- style: {
50854
- display: "flex",
50855
- alignItems: "center",
50856
- gap: "8px",
50857
- marginBottom: "8px"
50858
- },
50859
- children: [
50860
- /* @__PURE__ */ jsx(
50861
- "span",
50862
- {
50863
- style: {
50864
- fontFamily: theme2.fonts.body,
50865
- fontWeight: 600,
50866
- color: theme2.colors.text,
50867
- fontSize: theme2.fontSizes[0]
50868
- },
50869
- children: comment2.user.login
50870
- }
50871
- ),
50872
- /* @__PURE__ */ jsx(
50873
- "span",
50874
- {
50875
- style: {
50876
- fontFamily: theme2.fonts.body,
50877
- color: theme2.colors.textMuted,
50878
- fontSize: theme2.fontSizes[0]
50879
- },
50880
- children: "on"
50881
- }
50882
- ),
50883
- /* @__PURE__ */ jsx(
50884
- "code",
50885
- {
50886
- style: {
50887
- padding: "2px 6px",
50888
- borderRadius: "4px",
50889
- backgroundColor: theme2.colors.background,
50890
- fontFamily: theme2.fonts.monospace,
50891
- fontSize: "11px",
50892
- color: theme2.colors.primary
50893
- },
50894
- children: comment2.path
50895
- }
50896
- ),
50897
- comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
50898
- "line ",
50899
- comment2.line
50900
- ] })
50901
- ]
50902
- }
50903
- ),
50904
- /* @__PURE__ */ jsx(
50905
- "div",
50906
- {
50907
- style: {
50908
- backgroundColor: theme2.colors.background,
50909
- border: `1px solid ${theme2.colors.border}`,
50910
- borderRadius: "6px",
50911
- overflow: "hidden",
50912
- marginBottom: comment2.diff_hunk ? "8px" : 0
50913
- },
50914
- children: /* @__PURE__ */ jsx(
50915
- DocumentView,
51104
+ /* @__PURE__ */ jsxs(
51105
+ "div",
51106
+ {
51107
+ style: {
51108
+ display: "flex",
51109
+ gap: "12px",
51110
+ alignItems: "center",
51111
+ marginBottom: "8px"
51112
+ },
51113
+ children: [
51114
+ /* @__PURE__ */ jsx(Avatar, { user: comment2.user, size: 28 }),
51115
+ /* @__PURE__ */ jsxs(
51116
+ "div",
50916
51117
  {
50917
- content: comment2.body,
50918
- theme: theme2,
50919
- maxWidth: "100%",
50920
- transparentBackground: true
51118
+ style: {
51119
+ display: "flex",
51120
+ alignItems: "center",
51121
+ gap: "8px",
51122
+ flex: 1,
51123
+ minWidth: 0
51124
+ },
51125
+ children: [
51126
+ /* @__PURE__ */ jsx(
51127
+ "span",
51128
+ {
51129
+ style: {
51130
+ fontFamily: theme2.fonts.body,
51131
+ fontWeight: 600,
51132
+ color: theme2.colors.text,
51133
+ fontSize: theme2.fontSizes[0]
51134
+ },
51135
+ children: comment2.user.login
51136
+ }
51137
+ ),
51138
+ /* @__PURE__ */ jsx(
51139
+ "span",
51140
+ {
51141
+ style: {
51142
+ fontFamily: theme2.fonts.body,
51143
+ color: theme2.colors.textMuted,
51144
+ fontSize: theme2.fontSizes[0]
51145
+ },
51146
+ children: "on"
51147
+ }
51148
+ ),
51149
+ /* @__PURE__ */ jsx(
51150
+ "code",
51151
+ {
51152
+ style: {
51153
+ padding: "2px 6px",
51154
+ borderRadius: "4px",
51155
+ backgroundColor: theme2.colors.background,
51156
+ fontFamily: theme2.fonts.monospace,
51157
+ fontSize: "11px",
51158
+ color: theme2.colors.primary
51159
+ },
51160
+ children: comment2.path
51161
+ }
51162
+ ),
51163
+ comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
51164
+ "line ",
51165
+ comment2.line
51166
+ ] })
51167
+ ]
50921
51168
  }
50922
51169
  )
50923
- }
50924
- ),
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
- )
50950
- ] })
51170
+ ]
51171
+ }
51172
+ ),
51173
+ /* @__PURE__ */ jsxs(
51174
+ "div",
51175
+ {
51176
+ style: {
51177
+ marginLeft: isLargeView ? "40px" : "0"
51178
+ },
51179
+ children: [
51180
+ /* @__PURE__ */ jsx(
51181
+ "div",
51182
+ {
51183
+ style: {
51184
+ backgroundColor: theme2.colors.background,
51185
+ border: `1px solid ${theme2.colors.border}`,
51186
+ borderRadius: "6px",
51187
+ overflow: "hidden",
51188
+ marginBottom: comment2.diff_hunk ? "8px" : 0
51189
+ },
51190
+ children: /* @__PURE__ */ jsx(
51191
+ DocumentView,
51192
+ {
51193
+ content: comment2.body,
51194
+ theme: theme2,
51195
+ maxWidth: "100%",
51196
+ transparentBackground: true
51197
+ }
51198
+ )
51199
+ }
51200
+ ),
51201
+ comment2.diff_hunk && /* @__PURE__ */ jsx(
51202
+ "pre",
51203
+ {
51204
+ style: {
51205
+ margin: 0,
51206
+ padding: "8px",
51207
+ backgroundColor: theme2.colors.background,
51208
+ border: `1px solid ${theme2.colors.border}`,
51209
+ borderRadius: "6px",
51210
+ fontFamily: theme2.fonts.monospace,
51211
+ fontSize: "11px",
51212
+ color: theme2.colors.textSecondary,
51213
+ overflow: "auto",
51214
+ maxHeight: "100px"
51215
+ },
51216
+ children: comment2.diff_hunk
51217
+ }
51218
+ ),
51219
+ mergedReactions && /* @__PURE__ */ jsx(
51220
+ ReactionBar,
51221
+ {
51222
+ reactions: mergedReactions,
51223
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(comment2.id, "review_comment", type, reactionId) : void 0
51224
+ }
51225
+ )
51226
+ ]
51227
+ }
51228
+ )
50951
51229
  ]
50952
51230
  }
50953
51231
  );
@@ -50990,6 +51268,7 @@ const TimelineEventRenderer = ({ event, onToggleReaction, getMergedReactions })
50990
51268
  }
50991
51269
  };
50992
51270
  const GitHubMessagesPanelContent = ({ context, events }) => {
51271
+ var _a;
50993
51272
  const { theme: theme2 } = useTheme();
50994
51273
  const panelRef = useRef(null);
50995
51274
  const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
@@ -51002,6 +51281,10 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51002
51281
  return /* @__PURE__ */ new Set();
51003
51282
  });
51004
51283
  const [showHiddenMessages, setShowHiddenMessages] = useState(false);
51284
+ const [commentText, setCommentText] = useState("");
51285
+ const [isSending, setIsSending] = useState(false);
51286
+ const [sendError, setSendError] = useState(null);
51287
+ const textareaRef = useRef(null);
51005
51288
  const handleDelete2 = () => {
51006
51289
  const messagesSlice2 = context.getSlice("github-messages");
51007
51290
  const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
@@ -51094,6 +51377,27 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51094
51377
  });
51095
51378
  }
51096
51379
  }, [context, events]);
51380
+ const handleSendComment = useCallback(() => {
51381
+ const messagesSlice2 = context.getSlice("github-messages");
51382
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51383
+ if (!events || !(messagesData2 == null ? void 0 : messagesData2.target) || !commentText.trim() || isSending) return;
51384
+ const { owner, repo, target: target2 } = messagesData2;
51385
+ setIsSending(true);
51386
+ setSendError(null);
51387
+ events.emit({
51388
+ type: "github-messages:comment:create",
51389
+ source: "github-messages-panel",
51390
+ timestamp: Date.now(),
51391
+ payload: {
51392
+ owner,
51393
+ repo,
51394
+ targetType: target2.type,
51395
+ targetNumber: target2.number,
51396
+ body: commentText.trim()
51397
+ }
51398
+ });
51399
+ setCommentText("");
51400
+ }, [context, events, commentText, isSending]);
51097
51401
  const getMergedReactions = useCallback((itemId, itemType, apiReactions) => {
51098
51402
  const key = `${itemType}-${itemId}`;
51099
51403
  const local = localReactions[key];
@@ -51136,8 +51440,8 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51136
51440
  "github-messages",
51137
51441
  events,
51138
51442
  () => {
51139
- var _a;
51140
- return (_a = panelRef.current) == null ? void 0 : _a.focus();
51443
+ var _a2;
51444
+ return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
51141
51445
  }
51142
51446
  );
51143
51447
  const messagesSlice = context.getSlice("github-messages");
@@ -51179,6 +51483,46 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51179
51483
  if (typeof unsubPR === "function") unsubPR();
51180
51484
  };
51181
51485
  }, [events]);
51486
+ useEffect(() => {
51487
+ if (textareaRef.current) {
51488
+ const minHeight = 36;
51489
+ const maxHeight = 200;
51490
+ if (!commentText) {
51491
+ textareaRef.current.style.height = `${minHeight}px`;
51492
+ return;
51493
+ }
51494
+ textareaRef.current.style.height = `${minHeight}px`;
51495
+ const scrollHeight = textareaRef.current.scrollHeight;
51496
+ const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight);
51497
+ textareaRef.current.style.height = `${newHeight}px`;
51498
+ }
51499
+ }, [commentText]);
51500
+ useEffect(() => {
51501
+ if (!events) return;
51502
+ const messagesSlice2 = context.getSlice("github-messages");
51503
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51504
+ const unsubscribers = [
51505
+ events.on("github-messages:comment:created", (event) => {
51506
+ const payload = event.payload;
51507
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && payload.targetNumber === messagesData2.target.number) {
51508
+ setIsSending(false);
51509
+ setSendError(null);
51510
+ }
51511
+ }),
51512
+ events.on("github-messages:comment:error", (event) => {
51513
+ const payload = event.payload;
51514
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && payload.targetNumber === messagesData2.target.number) {
51515
+ setIsSending(false);
51516
+ setSendError(payload.error);
51517
+ }
51518
+ })
51519
+ ];
51520
+ return () => {
51521
+ unsubscribers.forEach((unsub) => {
51522
+ if (typeof unsub === "function") unsub();
51523
+ });
51524
+ };
51525
+ }, [events, context]);
51182
51526
  const containerStyle = {
51183
51527
  display: "flex",
51184
51528
  flexDirection: "column",
@@ -51403,28 +51747,6 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51403
51747
  ]
51404
51748
  }
51405
51749
  ),
51406
- /* @__PURE__ */ jsx(
51407
- "button",
51408
- {
51409
- type: "button",
51410
- onClick: () => setShowDeleteConfirm(true),
51411
- title: "Delete issue",
51412
- style: {
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"
51424
- },
51425
- children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
51426
- }
51427
- ),
51428
51750
  /* @__PURE__ */ jsx(
51429
51751
  "a",
51430
51752
  {
@@ -51519,6 +51841,141 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51519
51841
  }) })
51520
51842
  }
51521
51843
  ),
51844
+ /* @__PURE__ */ jsxs(
51845
+ "div",
51846
+ {
51847
+ style: {
51848
+ borderTop: `1px solid ${theme2.colors.border}`,
51849
+ backgroundColor: theme2.colors.background,
51850
+ padding: "12px",
51851
+ display: "flex",
51852
+ flexDirection: "column",
51853
+ gap: "8px"
51854
+ },
51855
+ children: [
51856
+ sendError && /* @__PURE__ */ jsxs(
51857
+ "div",
51858
+ {
51859
+ style: {
51860
+ padding: "8px 12px",
51861
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
51862
+ border: `1px solid ${theme2.colors.error || "#ef4444"}`,
51863
+ borderRadius: "6px",
51864
+ color: theme2.colors.error || "#ef4444",
51865
+ fontSize: theme2.fontSizes[0],
51866
+ fontFamily: theme2.fonts.body,
51867
+ display: "flex",
51868
+ alignItems: "center",
51869
+ gap: "8px"
51870
+ },
51871
+ children: [
51872
+ /* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
51873
+ /* @__PURE__ */ jsx("span", { children: sendError }),
51874
+ /* @__PURE__ */ jsx(
51875
+ "button",
51876
+ {
51877
+ type: "button",
51878
+ onClick: () => setSendError(null),
51879
+ style: {
51880
+ marginLeft: "auto",
51881
+ background: "none",
51882
+ border: "none",
51883
+ cursor: "pointer",
51884
+ color: "inherit",
51885
+ padding: "2px"
51886
+ },
51887
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
51888
+ }
51889
+ )
51890
+ ]
51891
+ }
51892
+ ),
51893
+ /* @__PURE__ */ jsxs(
51894
+ "div",
51895
+ {
51896
+ style: {
51897
+ display: "flex",
51898
+ gap: "8px",
51899
+ alignItems: "flex-end"
51900
+ },
51901
+ children: [
51902
+ /* @__PURE__ */ jsx(
51903
+ "textarea",
51904
+ {
51905
+ ref: textareaRef,
51906
+ value: commentText,
51907
+ onChange: (e) => setCommentText(e.target.value),
51908
+ onKeyDown: (e) => {
51909
+ if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
51910
+ e.preventDefault();
51911
+ handleSendComment();
51912
+ }
51913
+ },
51914
+ placeholder: "Write a comment",
51915
+ disabled: isSending,
51916
+ "aria-label": "Write a comment",
51917
+ style: {
51918
+ flex: 1,
51919
+ height: "36px",
51920
+ maxHeight: "200px",
51921
+ padding: "8px 12px",
51922
+ border: `1px solid ${theme2.colors.border}`,
51923
+ borderRadius: "6px",
51924
+ backgroundColor: isSending ? theme2.colors.backgroundSecondary : theme2.colors.background,
51925
+ color: theme2.colors.text,
51926
+ fontFamily: theme2.fonts.body,
51927
+ fontSize: theme2.fontSizes[1],
51928
+ lineHeight: 1.5,
51929
+ resize: "none",
51930
+ outline: "none",
51931
+ transition: "border-color 0.2s",
51932
+ overflow: "hidden",
51933
+ boxSizing: "border-box"
51934
+ },
51935
+ onFocus: (e) => {
51936
+ e.currentTarget.style.borderColor = theme2.colors.primary;
51937
+ },
51938
+ onBlur: (e) => {
51939
+ e.currentTarget.style.borderColor = theme2.colors.border;
51940
+ }
51941
+ }
51942
+ ),
51943
+ /* @__PURE__ */ jsx(
51944
+ "button",
51945
+ {
51946
+ type: "button",
51947
+ onClick: handleSendComment,
51948
+ disabled: !commentText.trim() || isSending,
51949
+ "aria-label": "Send comment",
51950
+ title: isSending ? "Sending..." : "Send comment (Cmd/Ctrl+Enter)",
51951
+ style: {
51952
+ padding: "12px 20px",
51953
+ border: "none",
51954
+ borderRadius: "6px",
51955
+ backgroundColor: !commentText.trim() || isSending ? theme2.colors.backgroundSecondary : theme2.colors.primary,
51956
+ color: !commentText.trim() || isSending ? theme2.colors.textMuted : theme2.colors.textOnPrimary || "#ffffff",
51957
+ cursor: !commentText.trim() || isSending ? "not-allowed" : "pointer",
51958
+ fontFamily: theme2.fonts.body,
51959
+ fontSize: theme2.fontSizes[1],
51960
+ fontWeight: ((_a = theme2.fontWeights) == null ? void 0 : _a.medium) || 500,
51961
+ display: "flex",
51962
+ alignItems: "center",
51963
+ gap: "8px",
51964
+ transition: "background-color 0.2s",
51965
+ opacity: !commentText.trim() || isSending ? 0.5 : 1
51966
+ },
51967
+ children: isSending ? /* @__PURE__ */ jsxs(Fragment, { children: [
51968
+ /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
51969
+ "Sending..."
51970
+ ] }) : "Send"
51971
+ }
51972
+ )
51973
+ ]
51974
+ }
51975
+ )
51976
+ ]
51977
+ }
51978
+ ),
51522
51979
  showDeleteConfirm && /* @__PURE__ */ jsx(
51523
51980
  "div",
51524
51981
  {