Skip to content

feat: persist desktop sidebar state in app preferences#260

Merged
rmolinamir merged 2 commits intomainfrom
feature/app-layout-cookies
Mar 29, 2026
Merged

feat: persist desktop sidebar state in app preferences#260
rmolinamir merged 2 commits intomainfrom
feature/app-layout-cookies

Conversation

@rmolinamir
Copy link
Copy Markdown
Contributor

Summary

  • Problem: Sidebar open state and resized widths were not consistently restored across reloads, and persistence relied on ad-hoc sidebar cookie behavior.
  • Solution: Persist desktop sidebar open/width values through app preferences cookies, initialize sidebar providers from those values, and save updates on open/resize interactions.

Implementation

Added desktop sidebar preference fields (appSidebarOpen, appSidebarWidthRem, chatSidebarOpen, chatSidebarWidthRem) with normalization and clamping in app preferences. Reworked app layout to use dedicated app/chat sidebar provider wrappers that initialize from preferences and update preferences on state changes. Updated sidebar primitives to accept declarative initialWidthRem and onResizeEnd APIs and removed legacy direct sidebar cookie writes. Added server-action error fallback handling in the preferences provider so aborted/network failures return current state instead of crashing optimistic state.

Verification

Verified by type-checking the web app and manually validating that desktop sidebar open/width changes persist after reload.

  • Checks: Passed pnpm --filter @acme/web typecheck
  • Tests: No automated test suite changes in this PR

Notes

  • Risk Level: Medium
  • Refactoring: Yes (sidebar provider API renamed to initialWidthRem/onResizeEnd)
  • Assumptions: Sidebar preference persistence is desktop-only and mobile open state should remain transient

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
journl Ready Ready Preview, Comment Mar 29, 2026 11:50pm

@rmolinamir rmolinamir self-assigned this Mar 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24801d8d23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rmolinamir rmolinamir merged commit f4d2c0e into main Mar 29, 2026
5 checks passed
@rmolinamir rmolinamir deleted the feature/app-layout-cookies branch March 29, 2026 23:55
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