Skip to content

feat(tabs): cmd+w unpins pinned tabs instead of closing#2445

Merged
yujonglee merged 1 commit intofeat/add-pinned-tabs-functionalityfrom
devin/1766235497-cmdw-unpin-pinned-tabs
Dec 21, 2025
Merged

feat(tabs): cmd+w unpins pinned tabs instead of closing#2445
yujonglee merged 1 commit intofeat/add-pinned-tabs-functionalityfrom
devin/1766235497-cmdw-unpin-pinned-tabs

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 20, 2025

feat(tabs): cmd+w unpins pinned tabs instead of closing

Summary

This PR adds two ways to unpin pinned tabs:

  1. Keyboard shortcut: Pressing cmd+w on a pinned tab now unpins it instead of closing it
  2. Click interaction: The pin icon on pinned tabs is now clickable and unpins the tab when clicked

This stacks on top of #2361 which adds the base pinned tabs functionality.

Review & Testing Checklist for Human

  • Verify the unpin action from the tabs store works correctly (this PR assumes it exists from Add pinning functionality for tabs #2361)
  • Test cmd+w on a pinned tab - should unpin, not close
  • Test cmd+w on a regular unpinned tab - should close as before
  • Test clicking the pin icon on a pinned tab - should unpin
  • Verify hover states on the pin icon button look correct

Recommended test plan:

  1. Open the desktop app
  2. Create multiple tabs
  3. Pin a tab via right-click context menu
  4. Press cmd+w on the pinned tab → verify it unpins (not closes)
  5. Pin it again, then click the pin icon → verify it unpins
  6. On an unpinned tab, press cmd+w → verify it closes normally

Notes

Important: This PR was not tested in the running desktop app due to build time constraints. TypeScript compilation passes but manual UI verification is required.

Requested by: john@hyprnote.com (@ComputelessComputer)
Link to Devin run: https://app.devin.ai/sessions/a6a46f67021e4fac92525aa788fe3b26

This is part 3 of 3 in a stack :

- 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 <john@hyprnote.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@yujonglee yujonglee merged commit f2ba69f into feat/add-pinned-tabs-functionality Dec 21, 2025
2 of 3 checks passed
@yujonglee yujonglee deleted the devin/1766235497-cmdw-unpin-pinned-tabs branch December 21, 2025 02:13
ComputelessComputer added a commit that referenced this pull request Dec 29, 2025
feat(sessions): add spinner forancing and finalizing states
feat(tabs): add pinned property to tab schema
feat(tabs): add pin and unpin functionality for tabs
feat): add pinned property to tab types
(tabs): add pin functionality to tabs
feat(tabs): add pinning functionality to tabs
feat(tabs): cmd+w unpins pinned tabs instead of closing (#2445)

- 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: john@hyprnote.com <john@hyprnote.com>
fix(ui): resolve merge conflicts and duplicate imports
refactor: simplify tab components and context menu
ComputelessComputer added a commit that referenced this pull request Dec 29, 2025
feat(sessions): add spinner forancing and finalizing states
feat(tabs): add pinned property to tab schema
feat(tabs): add pin and unpin functionality for tabs
feat): add pinned property to tab types
(tabs): add pin functionality to tabs
feat(tabs): add pinning functionality to tabs
feat(tabs): cmd+w unpins pinned tabs instead of closing (#2445)

- 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: john@hyprnote.com <john@hyprnote.com>
fix(ui): resolve merge conflicts and duplicate imports
refactor: simplify tab components and context menu
ComputelessComputer added a commit that referenced this pull request Dec 29, 2025
* feat(ui): add finalizing state to tab close button
feat(sessions): add spinner forancing and finalizing states
feat(tabs): add pinned property to tab schema
feat(tabs): add pin and unpin functionality for tabs
feat): add pinned property to tab types
(tabs): add pin functionality to tabs
feat(tabs): add pinning functionality to tabs
feat(tabs): cmd+w unpins pinned tabs instead of closing (#2445)

- 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: john@hyprnote.com <john@hyprnote.com>
fix(ui): resolve merge conflicts and duplicate imports
refactor: simplify tab components and context menu

* Update apps/desktop/src/store/zustand/tabs/basic.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Simplify contextMenu assignment and maintain type consistency

Remove unnecessary ternary root and trailing undefined assignment for contextMenu in shared.tsx. This makes the code clearer by assigning the menu array directly when selected and not empty, and otherwise assigning an empty array, avoiding an explicit undefined branch. The change prevents mixing array/undefined types and simplifies readability and control flow for context menu construction.

* Make tab context menu behave consistently for active and other tabs

Ensure the tab context menu shows "Close" and pin/unpin options when a tab is active or selected, and shows the full set (Close, Close others, Close all, pin/unpin) for non-active tabs. This fixes inconsistent behavior where the active tab would not present pin/unpin alongside Close, aligning the active tab menu with the intended UX and restoring pin/unpin availability where appropriate.

* Add separators to native context menus

Add a separator entry between pin/unpin and other menu items in desktop context menus to improve visual grouping. The change extends the MenuItemDef type to accept a separator variant and uses PredefinedMenuItem.Separator when mapping items to native menu entries. This ensures separators are correctly created for both single-tab and multi-tab context menus.

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
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