Skip to content

Commit 9447858

Browse files
committed
fix: tab bar not found in DOM when no files in pane
1 parent 7d82ae6 commit 9447858

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

src/extensionsIntegrated/TabBar/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ define(function (require, exports, module) {
140140
getAllFilesFromWorkingSet();
141141

142142
// if no files are present in a pane, we want to hide the tab bar for that pane
143-
if(firstPaneWorkingSet.length === 0) {
143+
if (firstPaneWorkingSet.length === 0 && ($('#phoenix-tab-bar'))) {
144144
Helper._hideTabBar($('#phoenix-tab-bar'));
145145
}
146146

147-
if(secondPaneWorkingSet.length === 0) {
147+
if (secondPaneWorkingSet.length === 0 && ($('#phoenix-tab-bar-2'))) {
148148
Helper._hideTabBar($('#phoenix-tab-bar-2'));
149149
}
150150

@@ -320,8 +320,7 @@ define(function (require, exports, module) {
320320
// when working set changes, recreate the tab bar
321321
MainViewManager.on("workingSetAdd", workingSetChanged);
322322
MainViewManager.on("workingSetRemove", workingSetChanged);
323-
MainViewManager.on("workingSetListChange", workingSetChanged);
324-
323+
MainViewManager.on("workingSetSort", workingSetChanged);
325324
}
326325

327326

src/styles/Extn-TabBar.less

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
overflow-y: hidden;
1313
white-space: nowrap;
1414
transition: height 0.3s ease;
15+
scroll-behavior: smooth;
1516
}
1617

1718
.phoenix-tab-bar::-webkit-scrollbar {
@@ -34,6 +35,12 @@
3435
position: relative;
3536
flex: 0 0 auto;
3637
min-width: fit-content;
38+
user-select: none;
39+
transition: transform 60ms ease, opacity 60ms ease;
40+
}
41+
42+
.tab, .tab-close, .tab-icon, .tab-name {
43+
transition: all 120ms ease-out;
3744
}
3845

3946
.tab-icon {
@@ -62,6 +69,7 @@
6269

6370
.tab:hover {
6471
background-color: #4d4949;
72+
cursor: pointer;
6573
}
6674

6775
.tab.active::after {
@@ -111,5 +119,42 @@
111119
}
112120

113121
.tab-close:hover {
122+
cursor: pointer;
114123
background-color: rgba(255, 255, 255, 0.1);
124+
}
125+
126+
.tab.dragging {
127+
opacity: 0.7;
128+
transform: scale(0.95);
129+
cursor: grabbing !important;
130+
z-index: 10000;
131+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
132+
}
133+
134+
.tab.drag-target {
135+
background-color: #383838;
136+
}
137+
138+
.tab-drag-indicator {
139+
position: fixed;
140+
width: 2px;
141+
background-color: #75BEFF;
142+
pointer-events: none;
143+
z-index: 10001;
144+
box-shadow: 0 0 3px rgba(117, 190, 255, 0.5);
145+
display: none;
146+
animation: pulse 1.5s infinite;
147+
}
148+
149+
150+
@keyframes pulse {
151+
0% {
152+
opacity: 0.7;
153+
}
154+
50% {
155+
opacity: 1;
156+
}
157+
100% {
158+
opacity: 0.7;
159+
}
115160
}

0 commit comments

Comments
 (0)