Skip to content

feat(web): choose the default diff file state - #11484

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
maria-rcks:t3code/diff-collapse-default-setting
Sep 13, 2026
Merged

feat(web): choose the default diff file state#11484
maria-rcks merged 1 commit into
pingdotgg:mainfrom
maria-rcks:t3code/diff-collapse-default-setting

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Diff files always opened expanded. Settings → General now lets you choose Expanded or Collapsed as the default for the diff view and pull requests' Code tab on web and desktop. Expanded remains the default for existing settings; individual file toggles, expand/collapse all, and file-tree reveal keep working.

Verified against real working-tree changes and GitHub PR #11480 through the web client and server, including reopening, persistence across reloads, both choices, individual toggles, and file-tree reveal. Inspected settings in light/dark themes at 1280px and 800px. Blacksmith passed contracts/web/desktop typechecks, scoped lint, and existing settings, persistence, diff folding, file-tree, and viewer tests. Native desktop launch and mobile are unverified; mobile's separate diff viewer is outside this change.

default diff file state setting

before: working-tree files with the expanded default

after: the same working-tree files opening collapsed

before: PR Code tab with the expanded default

after: the same PR Code tab opening collapsed

The recordings below use animated GIFs for inline GitHub playback.

changing the setting and reopening PR Code, then expanding and collapsing all files

working-tree individual toggles, expand/collapse all, and file-tree reveal

Model: gpt-6-astra. Harness: Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 13, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a persisted user-facing setting that controls whether production diff and pull-request Code views open with files expanded or collapsed, wiring the choice through settings, contracts, and renderers. Because it changes product defaults, the change warrants human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0d1d91c2-9568-4d92-9958-39e7a96b549c

📥 Commits

Reviewing files that changed from the base of the PR and between 8ddd9f7 and d953233.

📒 Files selected for processing (9)
  • apps/desktop/src/settings/DesktopClientSettings.test.ts
  • apps/web/src/clientPersistenceStorage.test.ts
  • apps/web/src/components/DiffPanel.tsx
  • apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
  • apps/web/src/components/pullRequest/pullRequestDiff.logic.ts
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/settings/settingsSearch.ts
  • packages/contracts/src/settings.test.ts
  • packages/contracts/src/settings.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a persisted diffFilesCollapsed client setting. The settings UI exposes and searches this preference. Diff panels and pull request code views use it as the default when no file-specific override exists. Tests cover schema handling and persistence.

Changes

Default diff file state

Layer / File(s) Summary
Settings contract and persistence
packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts, apps/web/src/clientPersistenceStorage.test.ts, apps/desktop/src/settings/DesktopClientSettings.test.ts
The client settings schema, patch schema, persistence tests, and desktop fixture support diffFilesCollapsed, which defaults to false.
Settings UI and reset behavior
apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/settingsSearch.ts
General settings exposes Expanded and Collapsed options, reset behavior, changed-setting tracking, and search terms for the new preference.
Diff collapse state application
apps/web/src/components/DiffPanel.tsx, apps/web/src/components/pullRequest/PullRequestCodeTab.tsx, apps/web/src/components/pullRequest/pullRequestDiff.logic.ts
Diff views use the saved preference when no fold override exists. Callback and memo dependencies include the preference, and the state documentation describes the caller-supplied default.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SettingsPanels
  participant ClientSettings
  participant PullRequestCodeTab
  participant DiffPanel

  SettingsPanels->>ClientSettings: update diffFilesCollapsed
  ClientSettings-->>PullRequestCodeTab: provide saved setting
  ClientSettings-->>DiffPanel: provide saved setting
  PullRequestCodeTab->>PullRequestCodeTab: apply setting when no fold override exists
  DiffPanel->>DiffPanel: seed collapsed file state from setting
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to d9532

The new default diff-file state is persisted and applied consistently to working-tree and pull-request diffs, with existing interaction behavior retained.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains the change, verification scope, UI impact, screenshots, recordings, and unverified areas. It does not use the template headings or include the checklist, but the requi…
Title check ✅ Passed The title clearly and concisely describes the main change: adding a selectable default diff file state.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@maria-rcks
maria-rcks merged commit 36caf20 into pingdotgg:main Sep 13, 2026
21 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 13, 2026
## What's Changed
* fix(mobile): render photo library picks to a bounded JPEG off the JS thread by @Nelglor in pingdotgg/t3code#11440
* fix(desktop): keep the native preview User-Agent so Turnstile passes by @akriaueno in pingdotgg/t3code#7110
* fix(chat): keep user input outside collapsed work by @maria-rcks in pingdotgg/t3code#11363
* fix(web): preserve preview focus on window return by @Lucenx9 in pingdotgg/t3code#11444
* fix(web): complete thread status icons and keep input threads prominent by @maria-rcks in pingdotgg/t3code#11461
* feat(web): tint image chips with their average color by @maria-rcks in pingdotgg/t3code#11468
* fix(web): move viewer controls outside media and restore arrow navigation by @maria-rcks in pingdotgg/t3code#11470
* fix(web): tighten sidebar search and footer spacing by @maria-rcks in pingdotgg/t3code#11466
* feat(web): subagent spawns render as an expandable work row by @maria-rcks in pingdotgg/t3code#11433
* fix(web): keep subagent rows visible under folded turns by @maria-rcks in pingdotgg/t3code#11474
* fix(usage): make unavailable account limits more visible by @dominic-r in pingdotgg/t3code#10601
* fix(desktop): bound backend shutdown wait during quit by @ishaanko in pingdotgg/t3code#7599
* feat(web): choose the default diff file state by @maria-rcks in pingdotgg/t3code#11484
* feat(composer): fold large pastes into text attachments by @chrisdeeming in pingdotgg/t3code#11442
* feat(web): expose each chat message as a heading for screen readers by @Leos-Khai in pingdotgg/t3code#11199
* fix(usage): respect provider account homes by @maria-rcks in pingdotgg/t3code#11485

## New Contributors
* @Nelglor made their first contribution in pingdotgg/t3code#11440
* @akriaueno made their first contribution in pingdotgg/t3code#7110
* @Leos-Khai made their first contribution in pingdotgg/t3code#11199

**Full Changelog**: pingdotgg/t3code@v0.0.41-nightly.20260912.1612...v0.0.41-nightly.20260913.1625

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.41-nightly.20260913.1625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant