Skip to content

Conversation

@manzt
Copy link
Contributor

@manzt manzt commented Jul 24, 2025

Fixes #4968

Adds a button to toggle text wrapping in console outputs, making it easier to read and analyze text without horizontal scrolling.

The toggle appears on hover in the top-right corner of console outputs. Its state is currently persisted in localStorage, making it consistent across cells (and sessions). Alternatively, we could:

  • Add a marimo-wide configuration option, or
  • Not persist anything and have each output control it's wrapping state
Screen.Recording.2025-07-23.at.11.46.31.PM.mov

@manzt manzt requested a review from Light2Dark as a code owner July 24, 2025 03:41
@vercel
Copy link

vercel bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 6:47pm

Copy link
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is exactly how I was thinking to store the state: global and in local storage. I think that is a good default

Fixes #4968

Adds a button to toggle text wrapping in console outputs, making it much
easier to read and analyze text without horizontal scrolling.

The toggle appears on hover in the top-right corner of console outputs.
When enabled, text wraps using `whitespace-pre-wrap` and `break-words`
CSS classes, preserving formatting while fitting content within the
output area. Currently the wrap state is per-cell and not persisted
(each console output starts with wrapping disabled by default to
maintain backwards compatibility).

Persist wrapping preference and use react-aria `ToggleButton`
@manzt manzt force-pushed the manzt/toggle-text-wrap branch from a2814cb to bd7e98c Compare July 24, 2025 18:46
@manzt manzt merged commit b7eb0ab into main Jul 24, 2025
24 of 25 checks passed
@manzt manzt deleted the manzt/toggle-text-wrap branch July 24, 2025 19:02
@mscolnick mscolnick added the enhancement New feature or request label Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to wrap text in the output

4 participants