Skip to content

feat(desktop): loosen right-rail preview width caps (38rem → 72rem) - #40511

Open
liuhao1024 wants to merge 2 commits into
NousResearch:mainfrom
liuhao1024:feat/desktop-preview-width-loosen
Open

feat(desktop): loosen right-rail preview width caps (38rem → 72rem)#40511
liuhao1024 wants to merge 2 commits into
NousResearch:mainfrom
liuhao1024:feat/desktop-preview-width-loosen

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

Summary

Loosen the right-rail preview pane's width caps so wide content (code listings, tables, Mermaid diagrams, CSV/log previews) can use the full available horizontal space on large monitors.

Changes (2 files, 3 lines):

File Change
preview.tsx PREVIEW_RAIL_MAX_WIDTH: 38rem72rem
preview.tsx INTRINSIC clamp upper bound: 32rem64rem
preview-file.tsx MarkdownPreview wrapper: max-w-3xl (48rem) → max-w-none

Motivation

The preview pane currently caps at ~38rem even on wide monitors (27"+ / 16:10). Content wraps or scrolls horizontally despite abundant screen real estate. This is especially noticeable with:

  • Mermaid diagrams (gantt, sequenceDiagram) that are often wider than 38rem
  • Wide code listings (120+ column terminal output)
  • Tables and CSV previews that wrap awkwardly
  • Side-by-side workflow: agent generates .md artifact, user reviews it in the rail alongside chat

The default opening width is unchanged — users still drag the divider to expand. The cap just no longer kicks in early.

Before / After

Scenario Before After
Max rail width 38rem 72rem
Intrinsic default (wide screen) 32rem 64rem
Markdown content cap 48rem (max-w-3xl) None (max-w-none)
120-col code on 27" monitor Horizontal scroll Fits without scroll

Testing

  • Verified on macOS / Apple Silicon with Hermes Desktop built from main @ 56236b16e
  • Rail comfortably shows ~120-column code listings and full gantt charts
  • Default opening width unchanged (still requires dragging divider to expand)
  • Chat surface is not squeezed — PREVIEW_RAIL_PANE_WIDTH already subtracts --chat-min-width

Fixes #40494

Increase the preview pane's intrinsic width cap from 32rem to 64rem and
the hard max from 38rem to 72rem. Also remove the max-w-3xl (48rem)
constraint on the MarkdownPreview wrapper so rendered content can use the
full available width.

Wide content — code listings, tables, Mermaid gantt/sequenceDiagrams,
and CSV/log previews — currently wraps or scrolls horizontally even on
large monitors because the rail caps out at 38rem. The default opening
width is unchanged; users still drag the divider to expand.

Fixes NousResearch#40494

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tracing all three active width constraints. Current main confirms that apps/desktop/src/app/desktop-controller.tsx:1161-1170 passes the preview constants into the resizable Pane, and rendered Markdown still uses the independent max-w-3xl wrapper at apps/desktop/src/app/chat/right-rail/preview-file.tsx:332.

Problems

  • The linked report was revised after this patch: #40494's June 7 follow-ups say the proposed 72rem/64rem ceilings were still cramped and explicitly replace them with 96rem/80rem. This diff keeps the superseded 72rem/64rem values in apps/desktop/src/app/chat/right-rail/preview.tsx.

Suggested changes

  • When salvaging, align both constants with the revised issue target, or record a maintainer decision for the lower ceilings. The max-w-none Markdown change should remain because it removes a separate live 48rem content cap.

Automated hermes-sweeper review.


export const PREVIEW_RAIL_MIN_WIDTH = '18rem'
export const PREVIEW_RAIL_MAX_WIDTH = '38rem'
export const PREVIEW_RAIL_MAX_WIDTH = '72rem'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The linked issue was updated after this proposal: its reporter says 72rem/64rem remained cramped and explicitly requests 96rem/80rem. Please align both caps with that revised target, or document why the lower limits remain appropriate.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Loosen right-rail preview width caps (38rem → 72rem)

3 participants