@sentry/junior-dashboard 0.266.0 → 0.268.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/app.js +85 -12
  2. package/dist/client.js +94 -64
  3. package/dist/index.js +85 -12
  4. package/dist/tailwind.css +1 -1
  5. package/package.json +11 -5
  6. package/src/app.ts +0 -2
  7. package/src/auth.ts +4 -7
  8. package/src/client/App.tsx +55 -53
  9. package/src/client/components/DetailsPanel.tsx +12 -13
  10. package/src/client/components/Drawer.tsx +46 -23
  11. package/src/client/components/ImageAttachment.tsx +1 -1
  12. package/src/client/components/ParticipantAvatarStack.tsx +6 -2
  13. package/src/client/components/README.md +15 -2
  14. package/src/client/components/UserInputForm.tsx +283 -0
  15. package/src/client/components/layout/DashboardHeader.tsx +13 -0
  16. package/src/client/components/ui/alert.tsx +1 -1
  17. package/src/client/components/ui/button-group.tsx +59 -0
  18. package/src/client/components/ui/button.tsx +11 -1
  19. package/src/client/components/ui/dialog.tsx +29 -35
  20. package/src/client/components/ui/drawer.tsx +140 -0
  21. package/src/client/components/ui/empty.tsx +30 -1
  22. package/src/client/components/ui/separator.tsx +22 -0
  23. package/src/client/components/ui/useSheet.ts +5 -1
  24. package/src/client/conversations/ComposerImages.tsx +66 -14
  25. package/src/client/conversations/ConversationComposer.tsx +84 -12
  26. package/src/client/conversations/ConversationDetails.tsx +3 -27
  27. package/src/client/conversations/ConversationEventDetails.tsx +26 -10
  28. package/src/client/conversations/ConversationHomeList.tsx +6 -0
  29. package/src/client/conversations/ConversationListStatusIcon.tsx +15 -1
  30. package/src/client/conversations/ConversationPage.tsx +160 -2
  31. package/src/client/conversations/ConversationSidebar.tsx +6 -0
  32. package/src/client/conversations/ConversationTranscript.tsx +48 -16
  33. package/src/client/conversations/ConversationWorkspace.tsx +4 -0
  34. package/src/client/conversations/DetailsList.tsx +33 -0
  35. package/src/client/conversations/EventDetails.tsx +46 -19
  36. package/src/client/conversations/ForkConversationButton.tsx +79 -73
  37. package/src/client/conversations/PendingMailboxStack.tsx +310 -112
  38. package/src/client/conversations/README.md +30 -13
  39. package/src/client/conversations/SubagentTranscriptDrawer.tsx +19 -22
  40. package/src/client/conversations/TranscriptActivityGroup.tsx +27 -19
  41. package/src/client/conversations/TranscriptAttachment.tsx +39 -4
  42. package/src/client/conversations/TranscriptAutomationTriggerView.tsx +14 -19
  43. package/src/client/conversations/TranscriptFailureView.tsx +10 -13
  44. package/src/client/conversations/TranscriptMarkdown.tsx +232 -436
  45. package/src/client/conversations/TranscriptMessageContextView.tsx +12 -1
  46. package/src/client/conversations/TranscriptMessageView.tsx +10 -1
  47. package/src/client/conversations/TranscriptSummary.tsx +5 -31
  48. package/src/client/conversations/TranscriptToolView.tsx +13 -1
  49. package/src/client/conversations/TranscriptTurnContextView.tsx +174 -161
  50. package/src/client/conversations/TranscriptView.tsx +7 -3
  51. package/src/client/conversations/UserInputRequestCard.tsx +39 -0
  52. package/src/client/conversations/conversationOutbox.ts +46 -0
  53. package/src/client/conversations/eventTime.ts +13 -1
  54. package/src/client/conversations/eventTranscript.ts +12 -5
  55. package/src/client/conversations/queries.ts +127 -26
  56. package/src/client/conversations/transcriptMarkdownLinks.ts +5 -367
  57. package/src/client/conversations/turnContext.ts +15 -0
  58. package/src/client/conversations/userInputRequest.ts +56 -0
  59. package/src/client/format.ts +31 -8
  60. package/src/client/pages/SettingsPage.tsx +103 -3
  61. package/src/client/pages/automations/{AutomationLifecycle.tsx → AutomationActions.tsx} +60 -69
  62. package/src/client/pages/automations/AutomationDraftChanges.tsx +171 -0
  63. package/src/client/pages/automations/AutomationEditor.tsx +182 -156
  64. package/src/client/pages/automations/AutomationEventFields.tsx +119 -45
  65. package/src/client/pages/automations/AutomationExecutionStatusChart.tsx +1 -1
  66. package/src/client/pages/automations/AutomationFormSection.tsx +20 -2
  67. package/src/client/pages/automations/AutomationOutcomeFields.tsx +1 -1
  68. package/src/client/pages/automations/AutomationOverview.tsx +238 -0
  69. package/src/client/pages/automations/AutomationPage.tsx +343 -0
  70. package/src/client/pages/automations/AutomationRecentRuns.tsx +3 -2
  71. package/src/client/pages/automations/AutomationRow.tsx +11 -13
  72. package/src/client/pages/automations/AutomationRunDetails.tsx +4 -2
  73. package/src/client/pages/automations/{AutomationExecutionsPage.tsx → AutomationRunsTab.tsx} +94 -103
  74. package/src/client/pages/automations/AutomationStatus.tsx +164 -108
  75. package/src/client/pages/automations/AutomationVersionsTab.tsx +518 -0
  76. package/src/client/pages/automations/AutomationsPage.tsx +10 -98
  77. package/src/client/pages/automations/AutomationsPageLayout.tsx +5 -23
  78. package/src/client/pages/automations/README.md +56 -46
  79. package/src/client/pages/code/RepositorySections.tsx +1 -0
  80. package/src/client/pages/code/RepositoryTabs.tsx +3 -0
  81. package/src/client/primaryNav.ts +15 -2
  82. package/src/client/review-desk/ConversationReviewBar.tsx +62 -0
  83. package/src/client/review-desk/ReviewDeskPage.tsx +277 -0
  84. package/src/client/review-desk/ReviewItemActions.tsx +165 -0
  85. package/src/client/review-desk/ReviewItemCard.tsx +47 -0
  86. package/src/client/review-desk/ReviewItemDetail.tsx +115 -0
  87. package/src/client/review-desk/queries.ts +164 -0
  88. package/src/client/review-desk/reviewItemFormat.ts +61 -0
  89. package/src/client/types.ts +3 -0
  90. package/src/mock-reporting/fixtures.ts +54 -2
  91. package/src/mock-reporting/routes.ts +20 -0
  92. package/src/shell.ts +3 -0
  93. package/src/client/conversations/transcriptStyles.ts +0 -10
  94. package/src/client/pages/automations/AutomationDetails.tsx +0 -193
  95. package/src/client/pages/automations/AutomationEditPage.tsx +0 -176
  96. package/src/client/pages/automations/AutomationVersionsPage.tsx +0 -390
@@ -1,16 +1,22 @@
1
1
  import { GitFork } from "lucide-react";
2
- import { useId, useState } from "react";
3
- import { createPortal } from "react-dom";
2
+ import { useId, useRef, useState } from "react";
4
3
  import { useNavigate } from "react-router";
5
4
  import { Button } from "../components/ui/button";
6
5
  import { Textarea } from "../components/ui/textarea";
7
- import { Field, FieldLabel } from "../components/ui/field";
6
+ import { Field, FieldError, FieldLabel } from "../components/ui/field";
7
+ import {
8
+ Dialog,
9
+ DialogClose,
10
+ DialogContent,
11
+ DialogFooter,
12
+ DialogTitle,
13
+ } from "../components/ui/dialog";
14
+ import { useSheet } from "../components/ui/useSheet";
8
15
  import {
9
16
  Tooltip,
10
17
  TooltipContent,
11
18
  TooltipTrigger,
12
19
  } from "../components/ui/tooltip";
13
- import { Drawer } from "../components/Drawer";
14
20
  import { DashboardApiError } from "../http";
15
21
  import { conversationPath } from "./conversationRoutes";
16
22
  import { useForkConversation } from "./queries";
@@ -36,26 +42,22 @@ export function ForkConversationButton(props: ForkTarget) {
36
42
  />
37
43
  <TooltipContent size="compact">Fork after this message</TooltipContent>
38
44
  </Tooltip>
39
- {open
40
- ? createPortal(
41
- <ForkConversationDialog
42
- {...props}
43
- onClose={() => setOpen(false)}
44
- />,
45
- document.body,
46
- )
47
- : null}
45
+ {open ? (
46
+ <ForkConversationDialog {...props} onClose={() => setOpen(false)} />
47
+ ) : null}
48
48
  </>
49
49
  );
50
50
  }
51
51
 
52
52
  function ForkConversationDialog(props: ForkTarget & { onClose(): void }) {
53
- const titleId = useId();
54
53
  const inputId = useId();
54
+ const errorId = `${inputId}-error`;
55
+ const inputRef = useRef<HTMLTextAreaElement>(null);
55
56
  const [idempotencyKey] = useState(() => crypto.randomUUID());
56
57
  const [message, setMessage] = useState("");
57
58
  const navigate = useNavigate();
58
59
  const fork = useForkConversation(props.conversationId);
60
+ const sheet = useSheet(props.onClose, inputRef);
59
61
  const submit = () => {
60
62
  if (!message.trim() || fork.isPending) return;
61
63
  fork.mutate(
@@ -68,68 +70,72 @@ function ForkConversationDialog(props: ForkTarget & { onClose(): void }) {
68
70
  },
69
71
  );
70
72
  };
73
+ const error = fork.error
74
+ ? (fork.error instanceof DashboardApiError && fork.error.apiError) ||
75
+ "Could not fork the conversation. Try again."
76
+ : undefined;
71
77
  return (
72
- <Drawer
73
- closeLabel="Close fork dialog"
74
- header={
75
- <h2 id={titleId} className="m-0 text-lg font-semibold">
76
- Fork Conversation
77
- </h2>
78
- }
79
- titleId={titleId}
80
- openKey={idempotencyKey}
81
- onClose={() => {
82
- if (!fork.isPending) props.onClose();
78
+ <Dialog
79
+ {...sheet.rootProps}
80
+ onOpenChange={(nextOpen, details) => {
81
+ // A pending fork must finish so its navigation is not lost.
82
+ if (!nextOpen && fork.isPending) {
83
+ details.cancel();
84
+ return;
85
+ }
86
+ sheet.rootProps.onOpenChange(nextOpen, details);
83
87
  }}
84
- width="narrow"
85
88
  >
86
- <form
87
- className="grid gap-4 text-sm"
88
- onSubmit={(event) => {
89
- event.preventDefault();
90
- submit();
91
- }}
92
- >
93
- <p className="m-0">
94
- Creates a fork of the conversation from this point.
95
- </p>
96
- <Field>
97
- <FieldLabel htmlFor={inputId}>Message</FieldLabel>
98
- <Textarea
99
- id={inputId}
100
- autoFocus
101
- className="min-h-28 leading-relaxed"
102
- placeholder="Message Junior…"
103
- value={message}
104
- disabled={fork.isPending}
105
- onChange={(event) => setMessage(event.target.value)}
106
- onKeyDown={(event) => {
107
- // Same keys as the composer: Enter sends, Shift+Enter adds a line.
108
- if (
109
- event.key === "Enter" &&
110
- !event.shiftKey &&
111
- !event.nativeEvent.isComposing
112
- ) {
113
- event.preventDefault();
114
- submit();
115
- }
116
- }}
117
- />
118
- </Field>
119
- {fork.error ? (
120
- <p role="alert" className="m-0 text-red-300">
121
- {(fork.error instanceof DashboardApiError && fork.error.apiError) ||
122
- "Could not fork the conversation. Try again."}
123
- </p>
124
- ) : null}
125
- <Button
126
- variant="primary"
127
- type="submit"
128
- disabled={!message.trim() || fork.isPending}
89
+ <DialogContent {...sheet.contentProps}>
90
+ <form
91
+ className="grid gap-4"
92
+ onSubmit={(event) => {
93
+ event.preventDefault();
94
+ submit();
95
+ }}
129
96
  >
130
- {fork.isPending ? "Forking…" : "Fork and send"}
131
- </Button>
132
- </form>
133
- </Drawer>
97
+ <DialogTitle>Fork Conversation</DialogTitle>
98
+ <Field>
99
+ <FieldLabel htmlFor={inputId}>Message</FieldLabel>
100
+ <Textarea
101
+ ref={inputRef}
102
+ id={inputId}
103
+ aria-describedby={error ? errorId : undefined}
104
+ aria-invalid={error ? true : undefined}
105
+ className="min-h-24 leading-relaxed"
106
+ placeholder="Message Junior…"
107
+ value={message}
108
+ disabled={fork.isPending}
109
+ onChange={(event) => setMessage(event.target.value)}
110
+ onKeyDown={(event) => {
111
+ // Same keys as the composer: Enter sends, Shift+Enter adds a line.
112
+ if (
113
+ event.key === "Enter" &&
114
+ !event.shiftKey &&
115
+ !event.nativeEvent.isComposing
116
+ ) {
117
+ event.preventDefault();
118
+ submit();
119
+ }
120
+ }}
121
+ />
122
+ <FieldError id={errorId}>{error}</FieldError>
123
+ </Field>
124
+ <DialogFooter>
125
+ <DialogClose
126
+ disabled={fork.isPending}
127
+ render={<Button>Cancel</Button>}
128
+ />
129
+ <Button
130
+ variant="primary"
131
+ type="submit"
132
+ disabled={!message.trim() || fork.isPending}
133
+ >
134
+ {fork.isPending ? "Forking…" : "Fork and send"}
135
+ </Button>
136
+ </DialogFooter>
137
+ </form>
138
+ </DialogContent>
139
+ </Dialog>
134
140
  );
135
141
  }