@sentry/junior-dashboard 0.266.0 → 0.267.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 (73) hide show
  1. package/dist/app.js +49 -12
  2. package/dist/client.js +94 -63
  3. package/dist/index.js +49 -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 +35 -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 +4 -1
  13. package/src/client/components/README.md +11 -2
  14. package/src/client/components/ui/alert.tsx +1 -1
  15. package/src/client/components/ui/button-group.tsx +59 -0
  16. package/src/client/components/ui/dialog.tsx +29 -35
  17. package/src/client/components/ui/drawer.tsx +140 -0
  18. package/src/client/components/ui/empty.tsx +30 -1
  19. package/src/client/components/ui/separator.tsx +22 -0
  20. package/src/client/components/ui/useSheet.ts +5 -1
  21. package/src/client/conversations/ComposerImages.tsx +66 -14
  22. package/src/client/conversations/ConversationComposer.tsx +84 -12
  23. package/src/client/conversations/ConversationDetails.tsx +3 -27
  24. package/src/client/conversations/ConversationEventDetails.tsx +26 -10
  25. package/src/client/conversations/ConversationPage.tsx +156 -2
  26. package/src/client/conversations/ConversationTranscript.tsx +48 -16
  27. package/src/client/conversations/DetailsList.tsx +33 -0
  28. package/src/client/conversations/EventDetails.tsx +46 -19
  29. package/src/client/conversations/ForkConversationButton.tsx +79 -73
  30. package/src/client/conversations/PendingMailboxStack.tsx +310 -112
  31. package/src/client/conversations/README.md +30 -13
  32. package/src/client/conversations/SubagentTranscriptDrawer.tsx +19 -22
  33. package/src/client/conversations/TranscriptActivityGroup.tsx +22 -19
  34. package/src/client/conversations/TranscriptAttachment.tsx +39 -4
  35. package/src/client/conversations/TranscriptAutomationTriggerView.tsx +14 -19
  36. package/src/client/conversations/TranscriptFailureView.tsx +10 -13
  37. package/src/client/conversations/TranscriptMarkdown.tsx +232 -436
  38. package/src/client/conversations/TranscriptMessageView.tsx +7 -1
  39. package/src/client/conversations/TranscriptSummary.tsx +5 -31
  40. package/src/client/conversations/TranscriptTurnContextView.tsx +33 -18
  41. package/src/client/conversations/TranscriptView.tsx +7 -3
  42. package/src/client/conversations/UserInputRequestCard.tsx +244 -0
  43. package/src/client/conversations/conversationOutbox.ts +46 -0
  44. package/src/client/conversations/eventTime.ts +13 -1
  45. package/src/client/conversations/eventTranscript.ts +12 -5
  46. package/src/client/conversations/queries.ts +127 -26
  47. package/src/client/conversations/transcriptMarkdownLinks.ts +5 -367
  48. package/src/client/conversations/userInputRequest.ts +56 -0
  49. package/src/client/format.ts +10 -3
  50. package/src/client/pages/automations/{AutomationLifecycle.tsx → AutomationActions.tsx} +60 -69
  51. package/src/client/pages/automations/AutomationDraftChanges.tsx +171 -0
  52. package/src/client/pages/automations/AutomationEditor.tsx +182 -156
  53. package/src/client/pages/automations/AutomationEventFields.tsx +119 -45
  54. package/src/client/pages/automations/AutomationExecutionStatusChart.tsx +1 -1
  55. package/src/client/pages/automations/AutomationFormSection.tsx +20 -2
  56. package/src/client/pages/automations/AutomationOutcomeFields.tsx +1 -1
  57. package/src/client/pages/automations/AutomationOverview.tsx +238 -0
  58. package/src/client/pages/automations/AutomationPage.tsx +343 -0
  59. package/src/client/pages/automations/AutomationRecentRuns.tsx +3 -2
  60. package/src/client/pages/automations/AutomationRow.tsx +11 -13
  61. package/src/client/pages/automations/AutomationRunDetails.tsx +4 -2
  62. package/src/client/pages/automations/{AutomationExecutionsPage.tsx → AutomationRunsTab.tsx} +94 -103
  63. package/src/client/pages/automations/AutomationStatus.tsx +164 -108
  64. package/src/client/pages/automations/AutomationVersionsTab.tsx +518 -0
  65. package/src/client/pages/automations/AutomationsPage.tsx +10 -98
  66. package/src/client/pages/automations/AutomationsPageLayout.tsx +5 -23
  67. package/src/client/pages/automations/README.md +56 -46
  68. package/src/client/types.ts +3 -0
  69. package/src/mock-reporting/fixtures.ts +44 -2
  70. package/src/client/conversations/transcriptStyles.ts +0 -10
  71. package/src/client/pages/automations/AutomationDetails.tsx +0 -193
  72. package/src/client/pages/automations/AutomationEditPage.tsx +0 -176
  73. 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
  }