Skip to content

Commit 30633f2

Browse files
committed
feat(terminal): replace hover flyout with static inline tab bar
Replace the animated hover-expand flyout with a static tab sidebar integrated into the panel layout. Below 750px width shows collapsed icon-only tabs; at 750px+ shows expanded tabs with labels. Close button appears on hover without layout shift. No animation.
1 parent 3bd95ec commit 30633f2

2 files changed

Lines changed: 63 additions & 54 deletions

File tree

src/extensionsIntegrated/Terminal/main.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,14 @@ define(function (require, exports, module) {
145145
// Dropdown chevron button toggles shell selector
146146
$panel.find(".terminal-flyout-dropdown-btn").on("click", _onDropdownButtonClick);
147147

148-
// Refresh process info when user hovers over the flyout
149-
$panel.find(".terminal-tab-flyout").on("mouseenter", _refreshAllProcesses);
150-
151148
// Listen for panel resize
152149
WorkspaceManager.on("workspaceUpdateLayout", _handleResize);
153150

154151
// Focus terminal when the panel becomes visible
155152
const PanelView = require("view/PanelView");
156153
PanelView.on(PanelView.EVENT_PANEL_SHOWN, function (_event, panelId) {
157154
if (panelId === PANEL_ID) {
155+
_updateTabBarMode();
158156
const active = _getActiveTerminal();
159157
if (active) {
160158
active.handleResize();
@@ -586,14 +584,23 @@ define(function (require, exports, module) {
586584
}
587585
}
588586

587+
/**
588+
* Update the expanded/collapsed tab bar class based on panel width
589+
*/
590+
function _updateTabBarMode() {
591+
$panel.toggleClass("terminal-tabs-expanded", $panel.width() >= 750);
592+
}
593+
589594
/**
590595
* Handle workspace resize
591596
*/
592597
function _handleResize() {
598+
_updateTabBarMode();
593599
const active = _getActiveTerminal();
594600
if (active) {
595601
active.handleResize();
596602
}
603+
_refreshAllProcesses();
597604
}
598605

599606
/**

src/styles/Extn-Terminal.less

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -96,35 +96,44 @@
9696
position: relative;
9797
}
9898

99-
/* Tab bar: 30px flex spacer, flyout sits inside absolutely */
99+
/* Tab bar: static sidebar, width switches via .terminal-tabs-expanded on container */
100100
.terminal-tab-bar {
101101
position: relative;
102-
width: 30px;
103-
min-width: 30px;
104-
overflow: visible;
102+
width: 60px;
103+
min-width: 60px;
104+
}
105+
106+
.terminal-tabs-expanded .terminal-tab-bar {
107+
width: 170px;
108+
min-width: 170px;
105109
}
106110

107-
/* ─── Unified flyout: collapses to 30px, expands on hover ─── */
111+
/* ─── Tab sidebar: static, no flyout/hover ─── */
108112
.terminal-tab-flyout {
109113
display: flex;
110-
position: absolute;
111-
top: 0;
112-
right: 0;
113-
bottom: 0;
114-
width: 30px;
114+
position: relative;
115+
width: 100%;
116+
height: 100%;
115117
background: var(--terminal-tab-bg);
116118
border-left: 1px solid var(--terminal-border);
117-
z-index: 20;
118119
flex-direction: column;
119-
transition: width 0.08s ease;
120+
overflow: hidden;
120121
}
121122

122-
.terminal-tab-flyout:hover {
123-
width: 170px;
124-
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
123+
/* Fade gradient at bottom of tab list to hint overflow */
124+
.terminal-tab-flyout::after {
125+
content: '';
126+
position: absolute;
127+
bottom: 29px; /* sits above the actions row */
128+
left: 0;
129+
right: 0;
130+
height: 20px;
131+
background: linear-gradient(to bottom, transparent, var(--terminal-tab-bg));
132+
pointer-events: none;
133+
z-index: 1;
125134
}
126135

127-
/* Flyout list: scrollable, scrollbar hidden in collapsed mode */
136+
/* Tab list: scrollable, scrollbar hidden, scroll via wheel/trackpad */
128137
.terminal-tab-flyout .terminal-flyout-list {
129138
flex: 1;
130139
min-height: 0;
@@ -136,13 +145,6 @@
136145
}
137146
}
138147

139-
.terminal-tab-flyout:hover .terminal-flyout-list {
140-
scrollbar-width: auto;
141-
&::-webkit-scrollbar {
142-
display: block;
143-
}
144-
}
145-
146148
/* Flyout item */
147149
.terminal-flyout-item {
148150
position: relative;
@@ -167,8 +169,7 @@
167169
box-shadow: inset 2px 0 0 #007acc;
168170
}
169171

170-
/* Icon column: fixed 30px slot, always visible in collapsed mode.
171-
In expanded mode, CSS order moves it to the right end. */
172+
/* Icon column: fixed 30px slot */
172173
.terminal-flyout-icon {
173174
width: 30px;
174175
min-width: 30px;
@@ -179,15 +180,15 @@
179180
flex-shrink: 0;
180181
}
181182

182-
/* Title: fills remaining space */
183+
/* Title & CWD: hidden in collapsed, shown in expanded */
183184
.terminal-flyout-title {
184185
flex: 1;
185186
min-width: 0;
186187
overflow: hidden;
187188
text-overflow: ellipsis;
189+
display: none;
188190
}
189191

190-
/* CWD basename shown on the right */
191192
.terminal-flyout-cwd {
192193
font-size: 11px;
193194
color: var(--terminal-tab-text);
@@ -199,26 +200,16 @@
199200
opacity: 0.6;
200201
overflow: hidden;
201202
text-overflow: ellipsis;
203+
display: none;
202204
}
203205

204-
/* Expanded mode: reorder so icon is at the right end,
205-
add left padding for close button area */
206-
.terminal-tab-flyout:hover .terminal-flyout-item {
207-
padding-left: 30px;
208-
}
209-
210-
.terminal-tab-flyout:hover .terminal-flyout-icon {
211-
order: 99;
212-
}
213-
214-
/* Close button: overlays left padding area, visible only when
215-
flyout is expanded AND the specific item is hovered */
206+
/* Close button: absolutely positioned on the right, visible on item hover only */
216207
.terminal-flyout-close {
217208
position: absolute;
218-
left: 0;
209+
right: 0;
219210
top: 0;
220211
bottom: 0;
221-
width: 30px;
212+
width: 20px;
222213
display: none;
223214
align-items: center;
224215
justify-content: center;
@@ -228,7 +219,7 @@
228219
z-index: 1;
229220
}
230221

231-
.terminal-tab-flyout:hover .terminal-flyout-item:hover .terminal-flyout-close {
222+
.terminal-flyout-item:hover .terminal-flyout-close {
232223
display: flex;
233224
}
234225

@@ -237,6 +228,21 @@
237228
background: rgba(255, 255, 255, 0.1);
238229
}
239230

231+
/* ─── Expanded mode ─── */
232+
.terminal-tabs-expanded .terminal-flyout-title {
233+
display: block;
234+
}
235+
236+
.terminal-tabs-expanded .terminal-flyout-cwd {
237+
display: block;
238+
}
239+
240+
/* Reserve space so cwd text doesn't sit under the close button */
241+
.terminal-tabs-expanded .terminal-flyout-cwd {
242+
margin-right: 20px;
243+
}
244+
245+
240246
/* ─── Flyout bottom actions ─── */
241247
.terminal-flyout-actions {
242248
border-top: 1px solid var(--terminal-border);
@@ -272,9 +278,9 @@
272278
color: var(--terminal-tab-active-text);
273279
}
274280

275-
/* Dropdown chevron: hidden in collapsed mode, shown inline when expanded */
281+
/* Dropdown chevron: visible in both modes */
276282
.terminal-flyout-dropdown-btn {
277-
display: none;
283+
display: flex;
278284
align-items: center;
279285
justify-content: center;
280286
width: 30px;
@@ -289,10 +295,6 @@
289295
flex-shrink: 0;
290296
}
291297

292-
.terminal-tab-flyout:hover .terminal-flyout-dropdown-btn {
293-
display: flex;
294-
}
295-
296298
.terminal-flyout-dropdown-btn:hover {
297299
background: rgba(255, 255, 255, 0.05);
298300
color: var(--terminal-tab-active-text);
@@ -304,12 +306,12 @@
304306
flex-shrink: 0;
305307
}
306308

307-
/* Hide button labels in collapsed mode; show when expanded */
308-
.terminal-tab-flyout .terminal-btn-label {
309+
/* Button labels: hidden in collapsed, shown in expanded */
310+
.terminal-btn-label {
309311
display: none;
310312
}
311313

312-
.terminal-tab-flyout:hover .terminal-btn-label {
314+
.terminal-tabs-expanded .terminal-btn-label {
313315
display: inline;
314316
}
315317

0 commit comments

Comments
 (0)