Skip to content

Conversation

@patrick91
Copy link
Owner

Summary

  • Fixes wrapping issue where inline menu options (like "Yes" and "No" in confirm dialogs) were being displayed on separate lines
  • Replaces tab character separator with two spaces for inline menus

Problem

When using inline menus (e.g., app.confirm()), the options were being rendered with tab characters as separators. Tab characters expand to the next tab stop (typically 8 characters), which caused the menu to be too wide for the fixed-width table column layout used by TaggedStyle. This resulted in the "No" option wrapping to a new line.

Solution

Changed the separator for inline menus from "\t" to " " (two spaces) in src/rich_toolkit/styles/base.py:302. This provides consistent, predictable spacing that fits within the column layout without wrapping.

Testing

Tested with examples/demos/basic_usage.py - the "Yes" and "No" options now appear on the same line as intended.

Replace tab character separator with two spaces in inline menus to prevent
unpredictable wrapping when rendered in fixed-width table columns. Tab
characters expand to the next tab stop (typically 8 characters), which
can cause menu options to wrap to new lines in narrow layouts.
@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Thanks for adding the RELEASE.md file!

Below is the changelog that will be used for the release.


Fix inline menu option wrapping by using spaces instead of tabs.

When using inline menus (e.g., app.confirm()), options like "Yes" and "No" were wrapping to separate lines due to tab character separators expanding unpredictably in fixed-width table columns. This release replaces tab separators with two spaces for consistent, predictable spacing.

Before:

● Yes
○ No

After:

● Yes  ○ No

This release was contributed by @patrick91 in #44

@patrick91 patrick91 merged commit 21b9d72 into main Dec 17, 2025
13 checks passed
@github-actions
Copy link

This PR was published as 0.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants