feat(tui): add content_padding option to control horizontal content margins#25171
Open
alohaninja wants to merge 2 commits intoanomalyco:devfrom
Open
feat(tui): add content_padding option to control horizontal content margins#25171alohaninja wants to merge 2 commits intoanomalyco:devfrom
alohaninja wants to merge 2 commits intoanomalyco:devfrom
Conversation
…argins
Add a new content_padding option to tui.json that lets users configure the
horizontal padding of the main content area. This replaces the hardcoded
paddingLeft/paddingRight=2 on the session container and the corresponding
contentWidth calculation.
Users can set this in tui.json:
{ "content_padding": 0 }
The value is an integer from 0-20 (default: 2, preserving current behavior).
Closes anomalyco#25142
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #25142
Type of change
What does this PR do?
After a recent upgrade the hardcoded horizontal padding (
paddingLeft={2},paddingRight={2}) on the session content area leaves a lot of unused space on wide terminals. There is currently no way for users to adjust this.This PR adds a
content_paddingoption totui.jsonso users can control the horizontal padding of the main content area. The option is an integer from 0–20, defaulting to 2 (preserving current behavior). Setting it to 0 gives full-width content.Changes:
tui-schema.ts— Addedcontent_paddingto theTuiOptionsZod schema with validation (integer, min 0, max 20, optional).session/index.tsx— Replaced the hardcodedpaddingLeft={2}/paddingRight={2}on the outer session<box>and the- 4in thecontentWidthmemo with the configurable value read fromtuiConfig.content_padding.The default value of 2 means zero behavior change for existing users. The
contentWidthcalculation stays consistent:dimensions().width - sidebar - (contentPadding * 2).Usage:
How did you verify your code works?
Reviewed the existing content width calculation and padding props to confirm the new variable is wired through both the layout padding and the width memo consistently. Default of 2 preserves
paddingLeft={2}+paddingRight={2}=- 4, matching the previous hardcoded behavior exactly.Checklist