Skip to content

fix(mobile): persist thread shelf collapse state - #5152

Open
PixPMusic wants to merge 2 commits into
pingdotgg:mainfrom
PixPMusic:pixpmusic/persist-mobile-shelf-state
Open

fix(mobile): persist thread shelf collapse state#5152
PixPMusic wants to merge 2 commits into
pingdotgg:mainfrom
PixPMusic:pixpmusic/persist-mobile-shelf-state

Conversation

@PixPMusic

@PixPMusic PixPMusic commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • persist the mobile Thread List v2 Settled and Snoozed shelf expansion states across app restarts
  • use the existing device preference store so the Home list and iPad sidebar stay synchronized
  • keep rapid toggles ordered and disable shelf interaction until preferences finish loading
  • keep the first-run defaults: Settled expanded and Snoozed collapsed
  • ignore invalid persisted shelf preference values

Why

#5056 made the mobile Settled shelf collapsible, but both mobile shelves still reset whenever the app restarts. This brings mobile in line with the persistence fix in #5136 without adding another storage mechanism.

UI Changes

No visual changes. The existing shelf layout and interactions are unchanged; only the chosen expansion state now survives a restart.

Verification

  • vp test run apps/mobile/src/lib/storage.test.ts apps/mobile/src/features/threads/threadListV2.test.ts (47 tests)
  • vp run --filter @t3tools/mobile typecheck
  • targeted lint and formatting checks on the six changed mobile files
  • git diff --check

Checklist

  • This PR is small and focused
  • Defaults remain Settled expanded and Snoozed collapsed
  • No screenshots or video needed because the rendered UI is unchanged

Model: GPT-5.6 Sol | Harness: Codex in T3 Code


Note

Low Risk
Device-local UI preference persistence with boolean defaults and sanitization; no auth, sync, or thread lifecycle changes.

Overview
Thread List v2 Settled and Snoozed shelf expand/collapse now survives app restarts on mobile. Home and the iPad sidebar no longer keep separate in-memory shelf state; both use a shared hook that reads and writes the existing device mobile preferences store.

New preference keys threadListV2SettledShelfExpanded and threadListV2SnoozedShelfExpanded keep first-run behavior: Settled expanded unless explicitly false, Snoozed collapsed unless explicitly true. Shelf header toggles stay disabled until preferences load, and invalid stored types are dropped during parse (covered by storage tests).

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

Note

Persist thread shelf collapse state across sessions in mobile

  • Adds a new useThreadListV2ShelfPreferences hook in use-thread-list-v2-shelf-preferences.ts that reads and writes snoozed/settled shelf expansion state to mobilePreferencesAtom, replacing local component state in HomeScreen and ThreadNavigationSidebarPane.
  • Snoozed shelf defaults to collapsed (false) and settled shelf defaults to expanded (true) when no persisted value exists.
  • Adds threadListV2SettledShelfExpanded and threadListV2SnoozedShelfExpanded fields to the Preferences interface with sanitization that drops non-boolean values.
  • Shelf header buttons accept a new disabled prop and are disabled until preferences finish loading to prevent toggling before state is known.

Macroscope summarized ccd4313.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

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 Plus

Run ID: 77e60d27-37a4-42bb-9ef4-98c08813ba00

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 31, 2026
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved ccd4313

Simple UI state persistence change that moves shelf collapse state from in-memory to persisted storage. Uses existing preferences infrastructure, includes proper sanitization and tests, and is self-contained with no broader runtime impact.

You can customize Macroscope's approvability policy. Learn more.

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:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant