Skip to content

Persist thread sidebar visibility#3390

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
senamakel:persist-thread-button-visibility
Jun 4, 2026
Merged

Persist thread sidebar visibility#3390
senamakel merged 1 commit into
tinyhumansai:mainfrom
senamakel:persist-thread-button-visibility

Conversation

@senamakel
Copy link
Copy Markdown
Member

Summary

  • Persist the chat thread sidebar visibility in the existing thread Redux slice.
  • Add threadSidebarVisible to the redux-persist whitelist alongside selectedThreadId.
  • Replace the local showSidebar component state in Conversations with the persisted Redux value.
  • Add focused render coverage that restores the visible state and verifies toggling hides it again.

Problem

  • The thread sidebar toggle always reset to hidden after remount or reload because it lived only in component state.
  • Users who intentionally showed or hid the thread button/sidebar had to repeat that choice each session.

Solution

  • Store the visibility bit as thread.threadSidebarVisible, defaulting to false to preserve current first-run behavior.
  • Persist only that UI preference and the existing last selected thread id, while continuing to refetch thread lists and messages from core.
  • Dispatch setThreadSidebarVisible from the existing header toggle.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via diff-cover) meet the gate enforced by .github/workflows/pr-ci.yml. Run pnpm test:coverage and pnpm test:rust locally; PRs below 80% on changed lines will not merge. Focused changed-line Vitest coverage added; CI coverage gate will enforce final merged diff coverage.
  • Coverage matrix updated — N/A: behavior-only chat UI preference persistence, no feature rows added/removed/renamed.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related — N/A: no coverage-matrix feature ID applies.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces (docs/RELEASE-MANUAL-SMOKE.md) — N/A: narrow persisted UI preference, no release smoke checklist change.
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: no GitHub or Linear issue was provided for this request.

Impact

  • Desktop app UI only.
  • No backend, Rust core, network, or migration impact.
  • Existing users without the persisted field keep the previous default hidden sidebar state.

Related

  • Closes: N/A, no issue provided.
  • Follow-up PR(s)/TODOs: N/A.

AI Authored PR Metadata (required for Codex/Linear PRs)

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A, no Linear issue was provided.
  • URL: N/A, no Linear issue was provided.

Commit & Branch

  • Branch: persist-thread-button-visibility
  • Commit SHA: 5abdea63c48167540ff78b3a846f511ef5c557e8

Validation Run

  • pnpm --filter openhuman-app format:check — passed via pre-push hook.
  • pnpm typecheck — passed; warning only for local Node v22.22.3 while app wants >=24.
  • Focused tests: pnpm debug unit src/pages/__tests__/Conversations.render.test.tsx --verbose — passed, 49 tests.
  • Rust fmt/check (if changed): N/A, no Rust files changed; root cargo fmt check still passed via pre-push hook.
  • Tauri fmt/check (if changed): N/A, no Tauri files changed; Tauri cargo fmt/check still passed via pre-push hook with existing warnings.

Validation Blocked

  • command: N/A.
  • error: N/A.
  • impact: N/A.

Behavior Changes

  • Intended behavior change: The thread sidebar visibility choice now survives remount/reload.
  • User-visible effect: If the user hides it, it stays hidden; if the user shows it, it stays shown.

Parity Contract

  • Legacy behavior preserved: First-run/default sidebar state remains hidden.
  • Guard/fallback/dispatch parity checks: Thread list/message caches remain non-persisted and continue to refetch from core.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): None found for senamakel:persist-thread-button-visibility.
  • Canonical PR: This PR.
  • Resolution (closed/superseded/updated): N/A.

@senamakel senamakel requested a review from a team June 4, 2026 22:24
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Warning

Review limit reached

@senamakel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 19 minutes and 22 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ed6512e7-ede5-4065-909a-74e43e6cf45b

📥 Commits

Reviewing files that changed from the base of the PR and between 25cd13d and 5abdea6.

📒 Files selected for processing (4)
  • app/src/pages/Conversations.tsx
  • app/src/pages/__tests__/Conversations.render.test.tsx
  • app/src/store/index.ts
  • app/src/store/threadSlice.ts

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

@senamakel senamakel merged commit e1d25d8 into tinyhumansai:main Jun 4, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant