From 6e4e513f4fb46dcb357b59113c0f40522a4fa53b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 12:59:48 +0000 Subject: [PATCH] feat(tabs): cmd+w unpins pinned tabs instead of closing - Modified cmd+w handler to check if current tab is pinned - If pinned, unpin the tab instead of closing it - Made pin icon clickable to unpin tabs Co-Authored-By: john@hyprnote.com --- apps/desktop/src/components/main/body/index.tsx | 11 ++++++++--- apps/desktop/src/components/main/body/shared.tsx | 14 +++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/components/main/body/index.tsx b/apps/desktop/src/components/main/body/index.tsx index b86c0fdbe5..a6c4ef7cd8 100644 --- a/apps/desktop/src/components/main/body/index.tsx +++ b/apps/desktop/src/components/main/body/index.tsx @@ -658,12 +658,13 @@ function useScrollActiveTabIntoView(tabs: Tab[]) { } function useTabsShortcuts() { - const { tabs, currentTab, close, select } = useTabs( + const { tabs, currentTab, close, select, unpin } = useTabs( useShallow((state) => ({ tabs: state.tabs, currentTab: state.currentTab, close: state.close, select: state.select, + unpin: state.unpin, })), ); const newNote = useNewNote({ behavior: "new" }); @@ -702,7 +703,11 @@ function useTabsShortcuts() { "mod+w", async () => { if (currentTab) { - close(currentTab); + if (currentTab.pinned) { + unpin(currentTab); + } else { + close(currentTab); + } } }, { @@ -710,7 +715,7 @@ function useTabsShortcuts() { enableOnFormTags: true, enableOnContentEditable: true, }, - [currentTab, close], + [currentTab, close, unpin], ); useHotkeys( diff --git a/apps/desktop/src/components/main/body/shared.tsx b/apps/desktop/src/components/main/body/shared.tsx index cc8793625d..c23a6ba417 100644 --- a/apps/desktop/src/components/main/body/shared.tsx +++ b/apps/desktop/src/components/main/body/shared.tsx @@ -131,7 +131,19 @@ export function TabItemBase({
) : pinned ? ( - + ) : ( icon )}