Skip to content

perf(app): collapse large diffs in review panel to prevent UI freeze#13299

Closed
cooooooooooode wants to merge 2 commits into
anomalyco:devfrom
cooooooooooode:perf/large-diff-collapse
Closed

perf(app): collapse large diffs in review panel to prevent UI freeze#13299
cooooooooooode wants to merge 2 commits into
anomalyco:devfrom
cooooooooooode:perf/large-diff-collapse

Conversation

@cooooooooooode

@cooooooooooode cooooooooooode commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #13297

What

Review panel freezes when files with large diffs (500+ lines) are auto-expanded.

Why

The existing logic only checks total file count to decide expand/collapse, ignoring individual diff size. A single 2000-line diff can lock up the UI.

How

  • Files with additions + deletions > 500 are collapsed by default
  • "Expand All" skips large files
  • Click-to-confirm: first click shows line count warning, second click within 3s expands
  • Auto-collapse large files when review panel unmounts (persisted state cleanup)
  • Added i18n keys (largeDiff.label, largeDiff.clickToExpand) across all 16 locales

Verification

  1. Open a session with a large file change (500+ lines)
  2. Open review panel → large file should be collapsed, showing line count
  3. Click the file header → warning appears ("1234 lines — click again to expand")
  4. Click again within 3s → file expands
  5. Wait 3s without clicking → warning disappears, resets to initial state
  6. Click "Expand All" → only small files expand
  7. Close review panel, reopen → large files are collapsed again

Files with >500 changed lines are now:
- Collapsed by default when opening the review panel
- Skipped by 'Expand All'
- Guarded by click-to-confirm before expanding (3s timeout)
- Auto-collapsed when the review panel is closed

Adds i18n keys for large diff warnings across all 16 locales.

Fixes anomalyco#13297
@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title perf(ui): collapse large diffs in review panel to prevent UI freeze doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@cooooooooooode cooooooooooode changed the title perf(ui): collapse large diffs in review panel to prevent UI freeze perf(app): collapse large diffs in review panel to prevent UI freeze Feb 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 14, 2026
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.

[BUG] Review panel freezes when expanding large file diffs in app

1 participant