Skip to content

Commit 729a20f

Browse files
authored
fix: show code samples tab per dataset. hide cursor in monaco code attachment (#134)
1 parent 041d49c commit 729a20f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

libs/conversation-view/src/components/Attachments/CustomAttachments/CodeAttachment.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ export const CodeAttachment = ({
1212
const { data, language } = attachment;
1313

1414
return (
15-
<div className={mergeClasses(['h-full w-full', className])}>
15+
<div
16+
className={mergeClasses([
17+
'h-full w-full [&_.cursors-layer]:hidden',
18+
className,
19+
])}
20+
>
1621
<Editor
1722
value={data}
1823
language={language}

libs/conversation-view/src/context/AttachmentsData.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ export function useAttachmentsData(
245245

246246
useEffect(() => {
247247
if (rawAttachments?.length) {
248+
const urn = dataQuery?.urn;
249+
248250
const mdParsedAttachments = rawAttachments
249251
.filter((a) => a.type === AttachmentType.MARKDOWN)
252+
.filter((a) => !urn || a.title?.includes(urn))
250253
.map((a) => {
251254
const parsed = unwrapMarkdownCode(a.data ?? '');
252255
return {
@@ -262,7 +265,7 @@ export function useAttachmentsData(
262265

263266
setCodeAttachments(mdParsedAttachments);
264267
}
265-
}, [rawAttachments, titles]);
268+
}, [rawAttachments, titles, dataQuery]);
266269

267270
const attachments = useMemo(
268271
() => [customGridAttachment, customChartAttachment, ...codeAttachments],

0 commit comments

Comments
 (0)