Skip to content

Commit 468e404

Browse files
authored
Feat: Display the ID of the code image in the dialog. infiniflow#10427 (infiniflow#11746)
### What problem does this PR solve? Feat: Display the ID of the code image in the dialog. infiniflow#10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
1 parent af13440 commit 468e404

2 files changed

Lines changed: 34 additions & 28 deletions

File tree

web/src/components/markdown-content/index.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,23 @@ const MarkdownContent = ({
217217
const docType = chunkItem?.doc_type;
218218

219219
return showImage(docType) ? (
220-
<Image
221-
id={imageId}
222-
className={styles.referenceInnerChunkImage}
223-
onClick={
224-
documentId
225-
? handleDocumentButtonClick(
226-
documentId,
227-
chunkItem,
228-
fileExtension === 'pdf',
229-
documentUrl,
230-
)
231-
: () => {}
232-
}
233-
></Image>
220+
<section>
221+
<Image
222+
id={imageId}
223+
className={styles.referenceInnerChunkImage}
224+
onClick={
225+
documentId
226+
? handleDocumentButtonClick(
227+
documentId,
228+
chunkItem,
229+
fileExtension === 'pdf',
230+
documentUrl,
231+
)
232+
: () => {}
233+
}
234+
></Image>
235+
<span className="text-accent-primary"> {imageId}</span>
236+
</section>
234237
) : (
235238
<HoverCard key={i}>
236239
<HoverCardTrigger>

web/src/components/next-markdown-content/index.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,23 @@ function MarkdownContent({
220220
const docType = chunkItem?.doc_type;
221221

222222
return showImage(docType) ? (
223-
<Image
224-
id={imageId}
225-
className={styles.referenceInnerChunkImage}
226-
onClick={
227-
documentId
228-
? handleDocumentButtonClick(
229-
documentId,
230-
chunkItem,
231-
fileExtension === 'pdf',
232-
documentUrl,
233-
)
234-
: () => {}
235-
}
236-
></Image>
223+
<section>
224+
<Image
225+
id={imageId}
226+
className={styles.referenceInnerChunkImage}
227+
onClick={
228+
documentId
229+
? handleDocumentButtonClick(
230+
documentId,
231+
chunkItem,
232+
fileExtension === 'pdf',
233+
documentUrl,
234+
)
235+
: () => {}
236+
}
237+
></Image>
238+
<span className="text-accent-primary">{imageId}</span>
239+
</section>
237240
) : (
238241
<HoverCard key={i}>
239242
<HoverCardTrigger>

0 commit comments

Comments
 (0)