Skip to content

[codex] Fix sidebar preview settings reset#2587

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/sidebar-preview-followup
May 8, 2026
Merged

[codex] Fix sidebar preview settings reset#2587
juliusmarminge merged 1 commit into
mainfrom
codex/sidebar-preview-followup

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 8, 2026

Summary

This follow-up addresses two useful review findings left on the already-merged sidebar thread preview setting PR (#1856).

The visible-thread setting was included in the restore-defaults confirmation copy, but it was not part of the payload sent to updateSettings. That meant a user could confirm a reset that explicitly listed "Visible threads" while the saved sidebar preview count stayed unchanged. The fix adds sidebarThreadPreviewCount to the restore-defaults patch alongside the other client settings.

The new setting was also present in ClientSettingsSchema but absent from ClientSettingsPatch. That left the patch contract inconsistent with the settings schema and would drop the field if the patch schema were used for decoding or validation. The fix adds the optional patch entry using the existing SidebarThreadPreviewCount schema.

I checked the Vite-related review thread too. Current main no longer has the startup-crash fallback change, and the remaining Vite comment is about an unrelated build-contract decision, so this PR stays scoped to the two still-actionable settings issues.

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test --filter=@t3tools/contracts --filter=@t3tools/web
  • npx -y react-doctor@latest . --verbose --diff

Note

Fix sidebar preview settings reset to exclude sidebarThreadPreviewCount

The useSettingsRestore hook was not resetting sidebarThreadPreviewCount (Visible threads) when restoring defaults. This fix adds the field to the reset payload and extends the ClientSettingsPatch schema in settings.ts to accept it as an optional field.

Macroscope summarized 8897a78.


Note

Low Risk
Low risk bugfix limited to client settings reset behavior and the settings patch contract; no auth/security or complex logic changes.

Overview
Fixes a mismatch where restoring default settings did not actually reset sidebarThreadPreviewCount ("Visible threads") despite being listed in the confirmation prompt.

Also updates the contracts layer so ClientSettingsPatch accepts sidebarThreadPreviewCount, keeping the patch schema consistent with ClientSettingsSchema and preventing the field from being dropped during validation/decoding.

Reviewed by Cursor Bugbot for commit 8897a78. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1bafcd92-19b5-4002-89ce-a16a59495507

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sidebar-preview-followup

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

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 8, 2026
@juliusmarminge juliusmarminge marked this pull request as ready for review May 8, 2026 00:24
@juliusmarminge juliusmarminge merged commit 31b52ac into main May 8, 2026
17 checks passed
@juliusmarminge juliusmarminge deleted the codex/sidebar-preview-followup branch May 8, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 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