Commit 5773ead
authored
fix popout columns logic for long strings (#7201)
## 📝 Summary
<!--
Provide a concise summary of what this pull request is addressing.
If this PR fixes any issues, list them here by number (e.g., Fixes
#123).
-->
Issue where long strings didn't show up as popout columns, because they
had markup. Also increases the width of popout columns and ensures they
are truncated when inline for a clean table look.
before:
https://github.com/user-attachments/assets/f9a07653-9626-4ba4-99a9-2a242be5e549
after:
https://github.com/user-attachments/assets/0a4e1a83-ed17-4572-8dc4-c01953aa87f9
## 🔍 Description of Changes
<!--
Detail the specific changes made in this pull request. Explain the
problem addressed and how it was resolved. If applicable, provide before
and after comparisons, screenshots, or any relevant details to help
reviewers understand the changes easily.
-->
## 📋 Checklist
- [x] I have read the [contributor
guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md).
- [ ] For large changes, or changes that affect the public API: this
change was discussed or approved through an issue, on
[Discord](https://marimo.io/discord?ref=pr), or the community
[discussions](https://github.com/marimo-team/marimo/discussions) (Please
provide a link if applicable).
- [ ] I have added tests for the changes made.
- [x] I have run the code and verified that it works as expected.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Improves table cell rendering by detecting markdown and using a
markdown renderer in popouts, refines long-string popout logic, adds
copy-to-clipboard and layout tweaks, and updates tests and smoke demos.
>
> - **Frontend · Data Table**
> - **Popout behavior**: Treat strings as inline unless content is
entirely markup or short; respect wrapping; increase popout width
(`w-96`); use `max-w-fit` trigger; apply wrapping styles; add
copy-to-clipboard control in popout header.
> - **Markdown support**: Add `isMarkdown` (via `marked`) and
`MarkdownUrlDetector` to render markdown with `MarkdownRenderer` in
popouts; keep `UrlDetector` for non-markdown.
> - **Rendering logic**: Use `allMarkup` check; pass wrapped state
consistently; minor class adjustments.
> - **Tests**: Add `isMarkdown` test suite; extend `url-detector` tests.
> - **Config**: Inline `streamdown` deps in Vitest server config.
> - **Smoke tests**:
> - Add `tables/markdown_example.py` and update
`tables/rich_elements.py` (new long text with URLs, formatting).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
de7ea45. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 900c043 commit 5773ead
File tree
2 files changed
+23
-10
lines changed- frontend/src/components/data-table
- marimo/_smoke_tests/tables
2 files changed
+23
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
| |||
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
511 | | - | |
512 | | - | |
| 513 | + | |
| 514 | + | |
513 | 515 | | |
514 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
515 | 520 | | |
516 | 521 | | |
517 | 522 | | |
| |||
522 | 527 | | |
523 | 528 | | |
524 | 529 | | |
525 | | - | |
| 530 | + | |
526 | 531 | | |
527 | | - | |
| 532 | + | |
528 | 533 | | |
529 | 534 | | |
530 | 535 | | |
| |||
575 | 580 | | |
576 | 581 | | |
577 | 582 | | |
578 | | - | |
| 583 | + | |
579 | 584 | | |
580 | 585 | | |
581 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| |||
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
0 commit comments