File tree Expand file tree Collapse file tree 7 files changed +53
-6
lines changed
components/message-markdown Expand file tree Collapse file tree 7 files changed +53
-6
lines changed Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ export function Page() {
514
514
pageId,
515
515
titlePrompt : title ,
516
516
docQuery : {
517
- sourceIds : compact ( [ page ?. codeSourceId ] ) ,
517
+ sourceIds : compact ( [ page ?. codeSourceId , 'page' ] ) ,
518
518
content : title ,
519
519
searchPublic : true
520
520
} ,
@@ -619,7 +619,7 @@ export function Page() {
619
619
}
620
620
: null ,
621
621
docQuery : {
622
- sourceIds : compact ( [ codeSourceId ] ) ,
622
+ sourceIds : compact ( [ codeSourceId , 'page' ] ) ,
623
623
content : titlePrompt ,
624
624
searchPublic : true
625
625
} ,
Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ export const createThreadToPageRunSubscription = graphql(/* GraphQL */ `
121
121
}
122
122
authorAt
123
123
}
124
+ ... on AttachmentPageDoc {
125
+ link
126
+ title
127
+ content
128
+ }
124
129
}
125
130
score
126
131
}
@@ -274,6 +279,11 @@ export const createPageRunSubscription = graphql(/* GraphQL */ `
274
279
}
275
280
authorAt
276
281
}
282
+ ... on AttachmentPageDoc {
283
+ link
284
+ title
285
+ content
286
+ }
277
287
}
278
288
score
279
289
}
@@ -383,6 +393,11 @@ export const createPageSectionRunSubscription = graphql(/* GraphQL */ `
383
393
}
384
394
authorAt
385
395
}
396
+ ... on AttachmentPageDoc {
397
+ link
398
+ title
399
+ content
400
+ }
386
401
}
387
402
score
388
403
}
Original file line number Diff line number Diff line change @@ -1037,7 +1037,9 @@ function getSourceInputs(
1037
1037
if ( ctx ) {
1038
1038
sourceIdsForDocQuery = uniq (
1039
1039
// Compatible with existing user messages
1040
- compact ( [ repositorySourceId , ctx ?. codeSourceId ] . concat ( ctx . docSourceIds ) )
1040
+ compact (
1041
+ [ repositorySourceId , ctx ?. codeSourceId , 'page' ] . concat ( ctx . docSourceIds )
1042
+ )
1041
1043
)
1042
1044
searchPublic = ctx . searchPublic ?? false
1043
1045
sourceIdForCodeQuery = repositorySourceId || ctx . codeSourceId || undefined
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
getAttachmentDocContent ,
11
11
isAttachmentCommitDoc ,
12
12
isAttachmentIssueDoc ,
13
+ isAttachmentPageDoc ,
13
14
isAttachmentPullDoc ,
14
15
isAttachmentWebDoc
15
16
} from '@/lib/utils'
@@ -51,9 +52,11 @@ export function DocDetailView({
51
52
relevantDocument . title
52
53
)
53
54
const sourceUrl = link ? new URL ( link ) : null
54
- const author = isAttachmentWebDoc ( relevantDocument )
55
- ? undefined
56
- : relevantDocument . author
55
+ const author =
56
+ isAttachmentWebDoc ( relevantDocument ) ||
57
+ isAttachmentPageDoc ( relevantDocument )
58
+ ? undefined
59
+ : relevantDocument . author
57
60
const score = relevantDocument ?. extra ?. score
58
61
59
62
return (
Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ const CreateThreadAndRunSubscription = graphql(/* GraphQL */ `
104
104
}
105
105
authorAt
106
106
}
107
+ ... on MessageAttachmentPageDoc {
108
+ link
109
+ title
110
+ content
111
+ }
107
112
}
108
113
score
109
114
}
@@ -205,6 +210,11 @@ const CreateThreadRunSubscription = graphql(/* GraphQL */ `
205
210
}
206
211
authorAt
207
212
}
213
+ ... on MessageAttachmentPageDoc {
214
+ link
215
+ title
216
+ content
217
+ }
208
218
}
209
219
score
210
220
}
Original file line number Diff line number Diff line change @@ -465,6 +465,11 @@ export const listThreadMessages = graphql(/* GraphQL */ `
465
465
}
466
466
authorAt
467
467
}
468
+ ... on MessageAttachmentPageDoc {
469
+ title
470
+ link
471
+ content
472
+ }
468
473
}
469
474
codeFileList {
470
475
fileList
@@ -663,6 +668,11 @@ export const listPageSections = graphql(/* GraphQL */ `
663
668
}
664
669
authorAt
665
670
}
671
+ ... on AttachmentPageDoc {
672
+ link
673
+ title
674
+ content
675
+ }
666
676
}
667
677
}
668
678
}
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ export function isAttachmentIssueDoc(attachment: AttachmentDocItem) {
28
28
)
29
29
}
30
30
31
+ export function isAttachmentPageDoc ( attachment : AttachmentDocItem ) {
32
+ return (
33
+ attachment . __typename === 'AttachmentPageDoc' ||
34
+ attachment . __typename === 'MessageAttachmentPageDoc'
35
+ )
36
+ }
37
+
31
38
export function getAttachmentDocContent ( attachment : AttachmentDocItem ) {
32
39
switch ( attachment . __typename ) {
33
40
case 'MessageAttachmentWebDoc' :
You can’t perform that action at this time.
0 commit comments