Skip to content

feat(tui): add content_padding option to control horizontal content margins#25171

Open
alohaninja wants to merge 2 commits intoanomalyco:devfrom
alohaninja:feat/tui-content-padding
Open

feat(tui): add content_padding option to control horizontal content margins#25171
alohaninja wants to merge 2 commits intoanomalyco:devfrom
alohaninja:feat/tui-content-padding

Conversation

@alohaninja
Copy link
Copy Markdown

Issue for this PR

Closes #25142

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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_padding option to tui.json so 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 — Added content_padding to the TuiOptions Zod schema with validation (integer, min 0, max 20, optional).
  • session/index.tsx — Replaced the hardcoded paddingLeft={2} / paddingRight={2} on the outer session <box> and the - 4 in the contentWidth memo with the configurable value read from tuiConfig.content_padding.

The default value of 2 means zero behavior change for existing users. The contentWidth calculation stays consistent: dimensions().width - sidebar - (contentPadding * 2).

Usage:

// tui.json
{
  "content_padding": 0
}

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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…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
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.

[FEATURE]: Add tui.json option to control content area max-width / horizontal padding

1 participant