feat(markdown-renderer): add CSV download button for tables#1813
feat(markdown-renderer): add CSV download button for tables#1813Killusions wants to merge 3 commits intomainfrom
Conversation
Add max-inline-size constraint to message bubble and wrapper to prevent overflow. Fix attachment preview backdrop click behavior. Use index-based tracking for message list and add scroll-to-bottom on message send. Update example action labels for clarity.
…line and caching Rewrite the markdown renderer to use a recursive processing pipeline with placeholder-based architecture. Add SSR support via optional doc/isBrowser parameters. Introduce LRU caching for code blocks and tables. Improve table rendering with proper thead/th support. Add code-wrapper structure with language labels. Update SCSS for new structural layout including code-wrapper, table-wrapper, and table-scroll-container.
There was a problem hiding this comment.
Code Review
This pull request refactors the markdown renderer to support server-side rendering and introduces LRU caching for code blocks and tables. It adds CSV export functionality for tables and updates the SiMarkdownRendererComponent to utilize Angular signals and computed properties. Styles for chat messages were improved for responsiveness, and action labels were updated for better clarity. Feedback was provided to use currentTarget in the table download logic to ensure the button element is correctly targeted when its internal icon is clicked.
| if (isInBrowser) { | ||
| div.querySelectorAll('.download-table-btn').forEach(btn => { | ||
| btn.addEventListener('click', e => { | ||
| const button = e.target as HTMLButtonElement; |
There was a problem hiding this comment.
Using e.target can be problematic if the user clicks on the icon inside the button, as e.target would then refer to the element. Use e.currentTarget instead, which always refers to the element the event listener was attached to (the button).
| const button = e.target as HTMLButtonElement; | |
| const button = e.currentTarget as HTMLButtonElement; |
Merge after #1810 and #1811
Adds a button to download tables as CSV to the rendered markdown (with a translatable label)
Documentation.
Examples.
Dashboards Demo.
Playwright report.
Coverage Reports: