Skip to content

feat: rename the stack diff layout to unified - #945

Open
saadjs wants to merge 6 commits into
modem-dev:mainfrom
saadjs:issue-915-unified-layout
Open

feat: rename the stack diff layout to unified#945
saadjs wants to merge 6 commits into
modem-dev:mainfrom
saadjs:issue-915-unified-layout

Conversation

@saadjs

@saadjs saadjs commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Renames Hunk's single-column diff layout from stack to unified across the CLI, config, extension and OpenTUI APIs, renderer internals, tests, documentation, website copy, examples, benchmarks, and maintained media. Closes #915.

Existing public integrations remain compatible through narrow deprecated aliases and event fields:

  • --mode stack and mode = "stack" normalize to unified
  • hunk.view.layoutStack aliases hunk.view.layoutUnified
  • public OpenTUI components continue accepting layout="stack"
  • pre-v22 extension layout types retain their exhaustive "stack" shape, while additive canonical types expose "unified"
  • pre-v22 extension layout event fields continue reporting stack, with canonical v22 values available as canonicalMode and canonicalLayout
  • renamed command events retain hunk.view.layoutStack as their stable commandId, with hunk.view.layoutUnified available as canonicalCommandId

This is a terminology change only. Rendering, navigation, responsive behavior, wrapping, copying, notes, and scrolling are unchanged.

Rebase Notes

  • Rebased onto main at 5ecc4dda
  • Removed the three merge-from-main commits from the PR history
  • Preserved current row-planning, static-output, extension-session, and package-workspace architecture
  • Preserved extension API v22 from current main and advanced the session daemon protocol to v15
  • Audited remaining stack occurrences as deprecated compatibility coverage, historical records/metrics, or unrelated call-stack, STML, CSS, and prose uses
  • Independently reviewed the 150-file diff across public compatibility, renderer semantics, and documentation/media boundaries

Validation

Passed on Linux with Bun 1.4.2:

  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run deps:check
  • bun run test (4,085 passed, 12 skipped)
  • bun run test:integration (156 passed, 1 macOS-only test skipped)
  • bun run test:tty-smoke (10 passed)
  • bun test ./test/review-conformance (111 passed)
  • bun run test:session-broker-node (4 passed)
  • bun run test:theme-contrast (7 passed)
  • bun run check:docs
  • bun run check:changelog
  • bun run build:npm
  • bun run check:pack
  • bun run website:check
  • bun run website:build
  • bun run website:links
  • bun run website:test:browser (101 passed, 1 desktop-only test skipped on mobile)
  • bun run bench:render-layout
  • bun run install:bin
  • source diff --help, show, patch, and pager invocations

Installed-artifact acceptance additionally covered full-screen stack/unified parity at 88, 140, and 220 columns; legacy CLI, config, keybinding, OpenTUI, and extension inputs; exhaustive legacy and canonical packed declarations; pre-v22 extension event behavior; hunk navigation; explicit layout switching; auto-layout resizing; and current menu wording. The split and unified screenshots were refreshed from the current TUI.

Platform Notes

Tested locally on Linux. CI provides the remaining platform coverage.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@saadjs is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@benvinegar

Copy link
Copy Markdown
Member

@saadjs Hey, question, what got you to open this PR?

@saadjs

saadjs commented Aug 31, 2026

Copy link
Copy Markdown
Author

@saadjs Hey, question, what got you to open this PR?

Help needed + good first issue labels 🙂

@Aarya2004

Copy link
Copy Markdown

Hello, just tried to test out this PR, and it seems like its working! Here's a recording of when I got this working locally!
(Ran on wsl2, Ubuntu 26.04)

pr945-unified-layout.mp4

@benvinegar
benvinegar force-pushed the issue-915-unified-layout branch from fcc1358 to 73388dc Compare September 7, 2026 16:06
@benvinegar

Copy link
Copy Markdown
Member

Rebased onto the current main and force-pushed with the three merge-from-main commits removed. The conflict fix preserves the newer workspace, row-planning, static-output, and extension-session changes; it also updates the extension API and daemon revisions and covers main-era terminology added after the original PR. Full local validation results are now in the PR description.

@benvinegar
benvinegar force-pushed the issue-915-unified-layout branch from 73388dc to 7cbee61 Compare September 7, 2026 17:19
@benvinegar

benvinegar commented Sep 7, 2026

Copy link
Copy Markdown
Member

Final audit found and fixed three extension compatibility gaps before merge: pre-v21 layout_changed fields still emit stack while v21 adds canonical fields, renamed command events retain the old stable ID beside canonicalCommandId, and the published declaration checks now compile both old exhaustive layout types and new canonical types. I also corrected API/config docs, refreshed the stale split screenshot, reran the full unit/PTY/TTY/package/website suites, and tested both the packed npm artifact and compiled installed binary with legacy config, keybindings, and an old-style extension. Head is now 7cbee610 on main 6d4440a5.

@benvinegar

Copy link
Copy Markdown
Member

Follow-up compatibility adjustment in 6851d02f: public ExtensionLayoutMode and ExtensionResolvedLayout now support both "stack" and "unified". Only the ExtensionLegacyLayout = "stack" member is deprecated. Existing event fields continue emitting stack, canonical v21 fields emit unified, and docs commit to retaining the legacy vocabulary until a separately announced major extension API revision. Packed NodeNext and bundler consumers verify both literals.

@benvinegar

Copy link
Copy Markdown
Member

Correction in 7f346af1: widening the existing ExtensionLayoutMode union could break source that exhaustively maps the old union. The final contract therefore leaves ExtensionLayoutMode/ExtensionResolvedLayout exactly exhaustive over the pre-v21 vocabulary, adds ExtensionCanonicalLayoutMode/ExtensionCanonicalResolvedLayout for unified, and carries both runtime representations in separate event fields. Packed checks now compile exhaustive records for both generations.

@benvinegar
benvinegar force-pushed the issue-915-unified-layout branch from 7f346af to c5a0944 Compare September 7, 2026 18:27
@benvinegar
benvinegar force-pushed the issue-915-unified-layout branch from c5a0944 to c332fc1 Compare September 7, 2026 18:30
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.

Rename the “stack” diff layout to “unified” across Hunk

3 participants