feat(tabs): right-click context menu with bulk close + dirty guard#38
Merged
Conversation
Adds a VS Code-parity context menu on tab bar entries: - Close / Close Others / Close to the Right / Close Saved / Close All - Duplicate - Copy URL - Reveal in sidebar (file tabs only) Any action that would close a dirty tab now routes through a ConfirmDialog guard matching VS Code's "unsaved changes" prompt; dismissing the dialog cancels the whole batch. Bulk-close store actions push every removed tab onto closedTabStack so the existing reopen-closed-tab shortcut keeps working across mass closes. Reveal in sidebar reuses the existing tick-signal pattern: the Sidebar's tree auto-expands every ancestor of the target path and scrolls the file row into view.
- confirmGuard explicitly clears the guard state so a stale dirtyCount cannot flash when the dialog reopens mid-animation - closeOtherTabs snapshots the removed tabs only after verifying the kept tab exists; phantom entries no longer leak into closedTabStack - closeOtherTabs / closeTabsToRight / closeSavedTabs / closeAllTabs push snapshots in reverse order so ⌘⇧T pops most-recent-first (VS Code parity instead of oldest-first) - Sidebar revealSignal collapses to a useMemo — drop the mirror state and the companion useEffect - TreeNode reveal effect depends on the tick + node.kind + node.relPath instead of the whole node reference, so unrelated parent re-renders no longer retrigger the scroll
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.
Özet
Sekme barına VS Code paritesinde sağ-tık context menüsü eklendi ve kirli (dirty) sekmeler için koruma dialog'u devreye alındı.
Menü öğeleri
kind === 'file'sekmelerinde görünür; Files sidebar'ında dosyanın atalarını açıp satırı görünüre kaydırırDirty guard
Kirli sekme içeren her kapatma eylemi önce
ConfirmDialogüzerinden VS Code tarzı "unsaved changes" onayı ister:'{isim}' has unsaved changes/ Close / CancelYou have {N} unsaved tabs/ Close {N} / CancelCancel tüm batch'i iptal eder.
Store eklemeleri
closeOtherTabs,closeTabsToRight,closeSavedTabs,closeAllTabs- her biri kaldırılan sekmelericlosedTabStack'e iter (⌘⇧T reopen bozulmasın) ve tekset()ile commit ederrevealInSidebarTick/revealInSidebarPath/revealInSidebar()- mevcutfocusUrlTickpattern'ini takip ederscrollIntoViewile görünüre çekerDoğrulama
pnpm -r typecheck✓pnpm -r test✓ (195 passed + 7 skipped, değişmedi)pnpm --filter=@scrapeman/desktop build✓