fix: stale dirty state across tabs editing same saved query, toolbar#202
Conversation
…save Fixes #138 - Added savedQueryName to QueryTab to track which saved query a tab belongs to - FilesExplorer now passes savedQueryName when opening saved queries - Ctrl+S handler syncs originalQuery across all tabs sharing the same savedQueryName - Toolbar Save Query button now checks for existing queries, syncs dirty state
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 7 minutes and 25 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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Title: Fixes #138 — Stale dirty state across tabs editing the same saved query
Summary
Fixes the unsaved-query exit warning showing stale dirty state when the same saved query is open in multiple tabs. Also fixes the toolbar Save Query button to properly handle existing queries and sync dirty state like Ctrl+S.
Related issue
Fixes #138
(#187 is already fixed on main. #176/#131 require significant DnD implementation — separate PRs.)
Changes
Added
savedQueryNamefield toQueryTab— tracks which saved query a tab was opened from. Set whenFilesExploreropens a saved query.Cross-tab dirty state sync — when a tab saves to a saved query (Ctrl+S), all other tabs sharing the same
savedQueryNameimmediately refresh theiroriginalQuerysnapshot to the new persisted text. This prevents other tabs from appearing dirty (or clean) based on a stale snapshot.Toolbar Save Query button fixed — previously just called
addSavedQuery()unconditionally (creating duplicates and never updatingoriginalQuery). Now mirrors Ctrl+S: checks for existing queries viafindByName(), callsupdateQueryText()if it exists, syncsoriginalQueryacross tabs, and writes to local history.Tests — added
editorDirty.test.tsregression test verifying that cross-taboriginalQuerysync correctly distinguishes clean vs stale tabs.Testing notes
npx tsc --noEmitpasses.npm test— 165 tests pass (1 new).Checklist
npx tsc --noEmit).npm test).CHANGELOG.mdunder## [Unreleased].