aglinxinyuan opened a new issue, #7403:
URL: https://github.com/apache/texera/issues/7403

   ### 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
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to