feat: consolidate store keys to TinyBase#3554
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
feat: consolidate store keys to TinyBase#3554devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
- Add pinned_tabs, recently_opened_sessions, dismissed_toasts to TinyBase schema - Replace pinnedPersistenceMiddleware with usePinnedTabsSync hook - Replace recentlyOpenedMiddleware with useRecentlyOpenedSync hook - Replace React Query in useDismissedToasts with TinyBase useValue - Remove unused Rust StoreKey variants (DismissedToasts, PinnedTabs, RecentlyOpenedSessions) - Remove corresponding Rust commands and ext traits - Add guidance comment for frontend-only values Closes #3553 Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
✅ Deploy Preview for hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Fix race condition: sync hooks now reactively wait for TinyBase values to be loaded before initializing state from persistence - Fix prevRef update: update refs outside the main window check to avoid stale comparisons in non-main windows - Remove restore functions from _layout.tsx since sync hooks now handle initialization internally - Simplify initialization logic in _layout.tsx Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Wait for TinyBase pinned_tabs value to load before checking if empty tab needed - Remove unused restorePinnedTabsToStore and restoreRecentlyOpenedToStore functions - Add documentation comment explaining the race condition fix Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: consolidate store keys to TinyBase
Summary
Consolidates three frontend-only store keys (
PinnedTabs,RecentlyOpenedSessions,DismissedToasts) from separate Rust-side persistence into TinyBase values. This eliminates redundant boilerplate code and simplifies the architecture by keeping frontend-only state entirely in the frontend.Changes:
pinned_tabs,recently_opened_sessions,dismissed_toaststo TinyBase schemapinnedPersistenceMiddleware,recentlyOpenedMiddleware) with React hooks (usePinnedTabsSync,useRecentlyOpenedSync)useDismissedToastswith TinyBaseuseValueStoreKeyvariants and 6 Tauri commandsstore.rsfor future frontend-only valuesCloses #3553
Updates since last revision
pinned_tabsvalue to load before checking if an empty tab needs to be opened. Without this fix, users with pinned tabs would see a flash of an empty tab on startup before their pinned tabs were restored.restorePinnedTabsToStoreandrestoreRecentlyOpenedToStorefunctions frompinned-persistence.tsandrecently-opened.ts_layout.tsxReview & Testing Checklist for Human
Recommended test plan:
Notes