@sentry/junior-dashboard 0.230.0 → 0.231.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.
- package/dist/app.js +1 -1
- package/dist/client.js +29 -29
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/client/conversations/SlackMark.tsx +6 -2
- package/src/client/conversations/conversationOutbox.ts +5 -0
- package/src/client/conversations/queries.ts +19 -0
- package/src/client/conversations/transcriptBottomPinning.ts +2 -11
- package/src/client/pages/dev/ConversationFixture.tsx +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.231.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"react-router": "^7.18.2",
|
|
35
35
|
"shiki": "4.1.0",
|
|
36
36
|
"zod": "^4.5.4",
|
|
37
|
-
"@sentry/junior": "0.
|
|
38
|
-
"@sentry/junior-plugin-api": "0.
|
|
37
|
+
"@sentry/junior": "0.231.0",
|
|
38
|
+
"@sentry/junior-plugin-api": "0.231.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@oxlint/plugins": "1.79.0",
|
|
@@ -6,9 +6,13 @@ export function SlackMark(props: { className?: string }) {
|
|
|
6
6
|
className={props.className}
|
|
7
7
|
fill="currentColor"
|
|
8
8
|
role="img"
|
|
9
|
-
viewBox="0 0
|
|
9
|
+
viewBox="0 0 127 127"
|
|
10
10
|
>
|
|
11
|
-
|
|
11
|
+
{/* Keep the geometry from packages/docs/public/integrations/slack.svg. */}
|
|
12
|
+
<path d="M27.2 80c0 7.3-5.9 13.2-13.2 13.2C6.7 93.2.8 87.3.8 80c0-7.3 5.9-13.2 13.2-13.2h13.2V80zm6.6 0c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2v33c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V80z" />
|
|
13
|
+
<path d="M47 27c-7.3 0-13.2-5.9-13.2-13.2C33.8 6.5 39.7.6 47 .6c7.3 0 13.2 5.9 13.2 13.2V27H47zm0 6.7c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H13.9C6.6 60.1.7 54.2.7 46.9c0-7.3 5.9-13.2 13.2-13.2H47z" />
|
|
14
|
+
<path d="M99.9 46.9c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H99.9V46.9zm-6.6 0c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V13.8C66.9 6.5 72.8.6 80.1.6c7.3 0 13.2 5.9 13.2 13.2v33.1z" />
|
|
15
|
+
<path d="M80.1 99.8c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33.1c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H80.1z" />
|
|
12
16
|
</svg>
|
|
13
17
|
);
|
|
14
18
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
ActorIdentity,
|
|
2
3
|
ConversationPendingMessage,
|
|
3
4
|
InputImage,
|
|
4
5
|
} from "@sentry/junior/api/schema";
|
|
5
6
|
|
|
6
7
|
/** Client-owned mailbox row waiting on accept, server visibility, or retry. */
|
|
7
8
|
export type ConversationOutboxMessage = {
|
|
9
|
+
actorIdentity?: ActorIdentity;
|
|
8
10
|
createdAt: string;
|
|
9
11
|
idempotencyKey: string;
|
|
10
12
|
message: string;
|
|
@@ -27,6 +29,7 @@ export function conversationOutboxQueryKey(conversationId: string | undefined) {
|
|
|
27
29
|
|
|
28
30
|
/** Build one optimistic outbox row for a composer submit. */
|
|
29
31
|
export function conversationOutboxMessageForSubmit(input: {
|
|
32
|
+
actorIdentity?: ActorIdentity;
|
|
30
33
|
idempotencyKey: string;
|
|
31
34
|
message: string;
|
|
32
35
|
images?: InputImage[];
|
|
@@ -35,6 +38,7 @@ export function conversationOutboxMessageForSubmit(input: {
|
|
|
35
38
|
}): ConversationOutboxMessage {
|
|
36
39
|
const createdAt = input.now ?? new Date().toISOString();
|
|
37
40
|
return {
|
|
41
|
+
actorIdentity: input.actorIdentity,
|
|
38
42
|
createdAt,
|
|
39
43
|
idempotencyKey: input.idempotencyKey,
|
|
40
44
|
message: input.message,
|
|
@@ -49,6 +53,7 @@ export function mailboxMessageFromOutbox(
|
|
|
49
53
|
message: ConversationOutboxMessage,
|
|
50
54
|
): ConversationMailboxMessage {
|
|
51
55
|
return {
|
|
56
|
+
actorIdentity: message.actorIdentity,
|
|
52
57
|
clientStatus: message.status,
|
|
53
58
|
createdAt: message.createdAt,
|
|
54
59
|
delivery: "defer",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useDeferredValue, useEffect, useMemo, useRef } from "react";
|
|
2
2
|
import {
|
|
3
3
|
queryOptions,
|
|
4
|
+
type QueryClient,
|
|
4
5
|
useInfiniteQuery,
|
|
5
6
|
useMutation,
|
|
6
7
|
useMutationState,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
useQueryClient,
|
|
9
10
|
} from "@tanstack/react-query";
|
|
10
11
|
import type {
|
|
12
|
+
ActorIdentity,
|
|
11
13
|
ConversationDetailReport,
|
|
12
14
|
ConversationEventPage,
|
|
13
15
|
ConversationFeed,
|
|
@@ -25,6 +27,7 @@ import {
|
|
|
25
27
|
conversationPendingMessagesReportSchema,
|
|
26
28
|
} from "@sentry/junior/api/schema";
|
|
27
29
|
|
|
30
|
+
import type { DashboardCoreData } from "../types";
|
|
28
31
|
import {
|
|
29
32
|
DashboardApiError,
|
|
30
33
|
del,
|
|
@@ -176,6 +179,20 @@ export function conversationDetailQueryOptions(
|
|
|
176
179
|
});
|
|
177
180
|
}
|
|
178
181
|
|
|
182
|
+
function outboxActorIdentity(
|
|
183
|
+
queryClient: QueryClient,
|
|
184
|
+
): ActorIdentity | undefined {
|
|
185
|
+
const user = queryClient.getQueryData<DashboardCoreData>([
|
|
186
|
+
"dashboard",
|
|
187
|
+
"core",
|
|
188
|
+
])?.me.user;
|
|
189
|
+
if (!user?.email) return undefined;
|
|
190
|
+
return {
|
|
191
|
+
email: user.email,
|
|
192
|
+
fullName: user.name || undefined,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
179
196
|
/** Create one dashboard conversation and refresh the personal feed. */
|
|
180
197
|
export function useCreateConversation() {
|
|
181
198
|
const queryClient = useQueryClient();
|
|
@@ -193,6 +210,7 @@ export function useCreateConversation() {
|
|
|
193
210
|
upsertConversationOutboxMessage(current, {
|
|
194
211
|
...conversationOutboxMessageForSubmit({
|
|
195
212
|
...args,
|
|
213
|
+
actorIdentity: outboxActorIdentity(queryClient),
|
|
196
214
|
messageId: accepted.messageId,
|
|
197
215
|
}),
|
|
198
216
|
status: "accepted",
|
|
@@ -233,6 +251,7 @@ export function useAppendConversationMessage(conversationId: string) {
|
|
|
233
251
|
});
|
|
234
252
|
const optimistic = conversationOutboxMessageForSubmit({
|
|
235
253
|
...args,
|
|
254
|
+
actorIdentity: outboxActorIdentity(queryClient),
|
|
236
255
|
messageId,
|
|
237
256
|
});
|
|
238
257
|
queryClient.setQueryData<ConversationOutboxMessage[]>(
|
|
@@ -15,7 +15,6 @@ import type { ConversationTranscript } from "../types";
|
|
|
15
15
|
import type { TranscriptViewMode } from "./transcriptRenderModel";
|
|
16
16
|
|
|
17
17
|
const BOTTOM_PROXIMITY_PX = 96;
|
|
18
|
-
const MOBILE_MEDIA_QUERY = "(max-width: 767px)";
|
|
19
18
|
const USER_SCROLL_DELTA_PX = 2;
|
|
20
19
|
|
|
21
20
|
type ScrollRoot = HTMLElement | Window;
|
|
@@ -528,16 +527,8 @@ export function usePinnedTranscriptBottom(input: {
|
|
|
528
527
|
}
|
|
529
528
|
}
|
|
530
529
|
|
|
531
|
-
//
|
|
532
|
-
|
|
533
|
-
tailChanged &&
|
|
534
|
-
input.enabled &&
|
|
535
|
-
typeof window !== "undefined" &&
|
|
536
|
-
window.matchMedia(MOBILE_MEDIA_QUERY).matches
|
|
537
|
-
) {
|
|
538
|
-
setFollowingIntent(true);
|
|
539
|
-
}
|
|
540
|
-
|
|
530
|
+
// New activity must preserve scroll-away intent on mobile and desktop.
|
|
531
|
+
// The reader can resume following with the jump control or by scrolling down.
|
|
541
532
|
if (
|
|
542
533
|
shouldAutoPinTranscriptBottom({
|
|
543
534
|
enabled: input.enabled,
|
|
@@ -13,6 +13,7 @@ const EVENTS: ConversationReportEventData[] = [
|
|
|
13
13
|
type: "message",
|
|
14
14
|
messageId: "gallery-user",
|
|
15
15
|
role: "user",
|
|
16
|
+
source: "slack",
|
|
16
17
|
actorIdentity: { fullName: "Alex Rivera" },
|
|
17
18
|
text: "Show me the visual QA.",
|
|
18
19
|
},
|
|
@@ -39,6 +40,7 @@ const EVENTS: ConversationReportEventData[] = [
|
|
|
39
40
|
type: "message",
|
|
40
41
|
messageId: "gallery-reply",
|
|
41
42
|
role: "assistant",
|
|
43
|
+
source: "slack",
|
|
42
44
|
text: "The change is ready for review.\n\nI tightened the conversation layout and kept the event details available below.",
|
|
43
45
|
cards: [
|
|
44
46
|
{
|
|
@@ -117,7 +119,7 @@ const CONVERSATION: ConversationDetailReport = {
|
|
|
117
119
|
lastSeenAt: TIMESTAMP,
|
|
118
120
|
lastProgressAt: TIMESTAMP,
|
|
119
121
|
generatedAt: TIMESTAMP,
|
|
120
|
-
surface: "
|
|
122
|
+
surface: "slack",
|
|
121
123
|
eventHistory: { status: "available" },
|
|
122
124
|
annotations: [
|
|
123
125
|
{
|