Skip to content

fix(app): group edit and write diffs with patches - #47711

Open
opencode-agent[bot] wants to merge 2 commits into
v2from
edit-write-grouping
Open

fix(app): group edit and write diffs with patches#47711
opencode-agent[bot] wants to merge 2 commits into
v2from
edit-write-grouping

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Group adjacent edit, write, and patch calls into a single ordered file group, both directly in the timeline and inside “Used…” groups.
  • Preserve file disclosure state as groups grow or split; failed tools and intervening content remain boundaries.
  • Retain actual post-format write diffs in completed tool metadata, including overwrites, without changing machine output or model-facing confirmation text.
  • Keep input-based rendering for older results without diff metadata, pending edits, and empty/unchanged edit or write results.

This brings the grouping work from #44977 onto current v2 without its header-removal changes.

Validation

  • Core edit/write/patch tests: 66 passing.
  • Session UI unit tests: 179 passing.
  • Typechecks in packages/core, packages/session-ui, and packages/app.
  • 47 focused Storybook browser regressions passed (patch-group.spec.ts, session-timeline.spec.ts, and file-tool.spec.ts), covering homogeneous/mixed tools, append/split disclosure state, failure/content boundaries, missing/zero-change metadata, pointer/keyboard disclosure, and narrow layouts.
  • Real production app with identical seeded edit/write/patch results: grouped and separate placement, repeated paths, accordion click/keyboard toggling, and 420px layout. A separate narrow stress check covered 48 edit/write calls across 24 long paths, long diff values, wrapping, expansion, and scrolling without page overflow.
  • Production file-group benchmark: five scenarios, three repetitions each, both before and after. All 30 runs passed; these are small shared-host samples, not a performance claim.

Existing failures outside this change

An additional Storybook sweep found five failures that also reproduce on the untouched base f16acb1c95ad4e289b466d3148f490b7070ba09a: four stale group-label expectations in session-tool-projection.spec.ts / tool-disclosure.spec.ts, and the existing textVisible(...).get(...) is not a function fixture error in the collapsed-stack story. These tests and their unrelated behavior are left out of scope; the 47 focused checks above pass.

Requested by: @Brendonovich (Brendan via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant