feat(tabs): add pin/unpin support for editor and non-editor tabs#1984
feat(tabs): add pin/unpin support for editor and non-editor tabs#1984bajrangCoder merged 3 commits intoAcode-Foundation:mainfrom
Conversation
Greptile SummaryThis PR implements pin/unpin support for both editor and terminal tabs (fixes #1330). A Confidence Score: 4/5Safe to merge for basic pin/unpin UX, but tab ordering is broken after menu-pin, which can cause unintentional pinning during subsequent drag operations. One confirmed P1 defect:
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User action: Pin/Unpin tab] --> B{Via which path?}
B --> C[Menu / Tab icon click]
B --> D[Drag-drop tab]
C --> E["togglePinned() → setPinnedState(!pinned, reorder:false)"]
E --> F["#pinned updated, tab UI updated, events emitted"]
F --> G["moveFileByPinnedState NOT called (reorder:false)"]
G --> H["⚠️ Tab STAYS in current position\n(files array order unchanged)"]
H --> I["pinnedCount in drag handler\nmay no longer reflect contiguous block"]
I --> J["❌ Future drag boundary detection\ncan pin/unpin tabs incorrectly"]
D --> K["updateFileList() called\npinnedCount computed from pre-drag list"]
K --> L["DOM order → newFileList"]
L --> M{Pin boundary\ncrossed?}
M -- Yes --> N["setPinnedState(nextState, reorder:false)"]
N --> O["normalizePinnedTabOrder() called\n(sort: pinned first, then unpinned)"]
O --> P["✅ Correct order restored"]
M -- No --> Q["No normalization\nOrder remains as dragged"]
Reviews (2): Last reviewed commit: "address the reviews" | Re-trigger Greptile |
|
Check Greptile review comments. After that it's merge-able, With API Changes to be noted. 👍 |
Fixes: #1330