Task Summary
UserDatasetFileRendererComponent's class is well covered, but its template is not: locally it sits at 25% of statements while the class is at 91%.
The template is a viewer switch — each displayX flag selects exactly one preview — and only the CSV path had ever been rendered:
| Flag |
Should render |
isLoading / isFileLoadingError / isFileSizeUnloadable / isFileTypePreviewUnsupported |
the matching alert, and only that one |
displayCSV or displayXlsx |
the shared nz-table |
displayImage |
an image, clickable into a full-size modal |
displayMP4 / displayMP3 |
a <video> / <audio> |
displayMarkdown / displayJson / displayPlainText |
the matching text viewer |
The media branches are guarded by && safeFileURL, which is load-bearing: the flag is set as soon as the MIME type is known, while the object URL is built asynchronously, so rendering on the flag alone emits a source-less <img>/<video>/<audio>.
Notes for whoever picks this up:
- The first
detectChanges() runs ngOnInit, which inspects the empty filePath and settles on "preview unsupported". Flags set before that cycle are silently overwritten — clear the state with the component's own turnOffAllDisplay() afterwards.
- Binding
[src] makes Angular call DomSanitizer.sanitize; the existing stub only provides bypassSecurityTrustUrl and cannot render media.
<markdown> needs MarkdownModule.forRoot(), as in agent-chat.component.spec.ts.
Task Type
Task Summary
UserDatasetFileRendererComponent's class is well covered, but its template is not: locally it sits at 25% of statements while the class is at 91%.The template is a viewer switch — each
displayXflag selects exactly one preview — and only the CSV path had ever been rendered:isLoading/isFileLoadingError/isFileSizeUnloadable/isFileTypePreviewUnsupporteddisplayCSVordisplayXlsxnz-tabledisplayImagedisplayMP4/displayMP3<video>/<audio>displayMarkdown/displayJson/displayPlainTextThe media branches are guarded by
&& safeFileURL, which is load-bearing: the flag is set as soon as the MIME type is known, while the object URL is built asynchronously, so rendering on the flag alone emits a source-less<img>/<video>/<audio>.Notes for whoever picks this up:
detectChanges()runsngOnInit, which inspects the emptyfilePathand settles on "preview unsupported". Flags set before that cycle are silently overwritten — clear the state with the component's ownturnOffAllDisplay()afterwards.[src]makes Angular callDomSanitizer.sanitize; the existing stub only providesbypassSecurityTrustUrland cannot render media.<markdown>needsMarkdownModule.forRoot(), as inagent-chat.component.spec.ts.Task Type