Conversation
|
PR author is not in the allowed authors list. |
|
@teepark is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
I generally agree the auto ranges are not good right now. |
ef2121b to
36d5196
Compare
|
Rebased onto current main and preserved the README simplification/state-directory documentation. The setting is now The first CI run passed Linux validation, PTY integration, website, Nix, and compiled portability. Windows only failed on an This comment was generated by Pi using GPT-6.1-sol |
Replace the hard-coded 120-column cutoff where auto mode switches from unified to split with a configurable auto_width_threshold setting. The default stays at 120, so behavior is unchanged unless configured.
A 120-column cutoff leaves only about 60 columns per side in split view, which truncates most real code. Default to 200 so each side gets roughly 100 columns; auto_width_threshold = 120 restores the previous behavior.
ddc73c0 to
1878110
Compare
feat(config): add
auto_width_thresholdand raise its default to 200Problem
autolayout switches from unified to split at a hard-coded 120 terminal columns. That leaves each side of a split diff only about 60 columns, which is narrower than most code is written for. On common terminal widths, lines get truncated or need horizontal scrolling. There's no way to change the cutoff.Approach
This PR has two commits that can be reviewed (and accepted) separately:
feat(config): add auto_width_threshold for auto layout: adds a top-levelauto_width_thresholdsetting (a positive integer, in terminal columns) that replaces the hard-coded cutoff. It defaults to 120, so this commit doesn't change any behavior. The setting goes through the existing config catalog, so validation, user/repo layering, and the generated config reference all workthe same way as other settings.
feat(config): raise default auto_width_threshold to 200: raises the default to 200 columns, so a split diff gives each side about 100 columns. Anyone who prefers the old behavior can setauto_width_threshold = 120.If you'd like the setting but not the new default, the first commit stands on its own and has been validated independently. Just drop the second.
Sidebar visibility is unchanged. It still depends only on the existing 160/220-column viewport buckets.
Non-goals
tab_width,file_gap,hunk_gap,wheel_scroll_lines) are config-only too. A View-menu item that sets the threshold to the current width would be a possible follow-up.Why core
autolayout is resolved in core (resolveResponsiveLayout), and this makes one of its constants configurable. It doesn't add any new behavior that could live in an extension instead.Tests
responsive.test.ts: the exact switch point at the default, plus lower and higher configured thresholds, and a check that explicitsplit/unifiedmodes ignore the threshold.AppHost.responsive.test.tsx: a configured threshold moves the split cutoff in the rendered app. For frames that show the sidebar, the split check now looks for old and new lines on the same row, because the sidebar's selection marker also draws▌.config.test.ts: the default value, a configured value, and rejection of0,-1,150.5, and a string.test/pty/layout.test.ts(second commit): the live-resize test now expects unified view below 200 columns.Validation
I ran all of these on each commit separately and on
main(macOS, Bun 1.4.3):bun run format:check,lint,typecheck,deps:check,check:docsbun run testbun run test:integrationOn the second commit, one full
test:integrationrun hit a flake in "explicit split mode stays split after a live resize". That test forces split mode, so the threshold can't affect it. It passed 5/5 runs on its own, and a full rerun passed 222/222.bun run test:tty-smokedoesn't run here because it needs util-linuxscript, which macOS doesn't have. Instead I ranhunk show <first commit> --mode autofrom source in a real TTY (tmux) with a clean config directory:Platforms: tested on macOS only; not tested on Linux or Windows.
Visual evidence
Sizing decision made by the current

hunkwithmode = "auto":