@@ -100,6 +100,12 @@ define(function (require, exports, module) {
100100 /** @type {function } recomputeLayout callback from WorkspaceManager */
101101 let _recomputeLayout = null ;
102102
103+ /** @type {string|null } The default/quick-access panel ID */
104+ let _defaultPanelId = null ;
105+
106+ /** @type {jQueryObject } The "+" button inside the tab overflow area */
107+ let _$addBtn = null ;
108+
103109 // --- Tab helper functions ---
104110
105111 /**
@@ -149,6 +155,12 @@ define(function (require, exports, module) {
149155 $tab . append ( $ ( '<span class="bottom-panel-tab-close-btn">×</span>' ) . attr ( 'title' , Strings . CLOSE ) ) ;
150156 _$tabsOverflow . append ( $tab ) ;
151157 } ) ;
158+
159+ // Re-append the "+" button at the end (after all tabs)
160+ if ( _$addBtn ) {
161+ _$tabsOverflow . append ( _$addBtn ) ;
162+ _updateAddButtonVisibility ( ) ;
163+ }
152164 }
153165
154166 /**
@@ -190,7 +202,14 @@ define(function (require, exports, module) {
190202 . attr ( 'data-panel-id' , panelId ) ;
191203 $tab . append ( $ ( '<span class="bottom-panel-tab-title"></span>' ) . text ( title ) ) ;
192204 $tab . append ( $ ( '<span class="bottom-panel-tab-close-btn">×</span>' ) . attr ( 'title' , Strings . CLOSE ) ) ;
193- _$tabsOverflow . append ( $tab ) ;
205+
206+ // Insert before the "+" button so it stays at the end
207+ if ( _$addBtn && _$addBtn . parent ( ) . length ) {
208+ _$addBtn . before ( $tab ) ;
209+ } else {
210+ _$tabsOverflow . append ( $tab ) ;
211+ }
212+ _updateAddButtonVisibility ( ) ;
194213 }
195214
196215 /**
@@ -204,6 +223,24 @@ define(function (require, exports, module) {
204223 return ;
205224 }
206225 _$tabsOverflow . find ( '.bottom-panel-tab[data-panel-id="' + panelId + '"]' ) . remove ( ) ;
226+ _updateAddButtonVisibility ( ) ;
227+ }
228+
229+ /**
230+ * Show or hide the "+" button based on whether the default panel is active.
231+ * The button is hidden when the default panel is the active tab (since
232+ * clicking "+" would be a no-op) and shown otherwise.
233+ * @private
234+ */
235+ function _updateAddButtonVisibility ( ) {
236+ if ( ! _$addBtn ) {
237+ return ;
238+ }
239+ if ( _defaultPanelId && _activeId === _defaultPanelId ) {
240+ _$addBtn . hide ( ) ;
241+ } else {
242+ _$addBtn . show ( ) ;
243+ }
207244 }
208245
209246 /**
@@ -229,6 +266,7 @@ define(function (require, exports, module) {
229266 newPanel . $panel . addClass ( "active-bottom-panel" ) ;
230267 }
231268 _updateActiveTabHighlight ( ) ;
269+ _updateAddButtonVisibility ( ) ;
232270 }
233271
234272
@@ -422,13 +460,20 @@ define(function (require, exports, module) {
422460 * @param {jQueryObject } $tabsOverflow The scrollable area holding tab elements.
423461 * @param {jQueryObject } $editorHolder The editor holder element (for maximize height calculation).
424462 * @param {function } recomputeLayoutFn Callback to trigger workspace layout recomputation.
463+ * @param {string } defaultPanelId The ID of the default/quick-access panel.
425464 */
426- function init ( $container , $tabBar , $tabsOverflow , $editorHolder , recomputeLayoutFn ) {
465+ function init ( $container , $tabBar , $tabsOverflow , $editorHolder , recomputeLayoutFn , defaultPanelId ) {
427466 _$container = $container ;
428467 _$tabBar = $tabBar ;
429468 _$tabsOverflow = $tabsOverflow ;
430469 _$editorHolder = $editorHolder ;
431470 _recomputeLayout = recomputeLayoutFn ;
471+ _defaultPanelId = defaultPanelId ;
472+
473+ // Create the "+" button inside the tabs overflow area (after all tabs)
474+ _$addBtn = $ ( '<span class="bottom-panel-add-btn"><i class="fa-solid fa-plus"></i></span>' )
475+ . attr ( 'title' , Strings . BOTTOM_PANEL_OPEN_PANEL ) ;
476+ _$tabsOverflow . append ( _$addBtn ) ;
432477
433478 // Tab bar click handlers
434479 _$tabBar . on ( "click" , ".bottom-panel-tab-close-btn" , function ( e ) {
@@ -452,6 +497,14 @@ define(function (require, exports, module) {
452497 }
453498 } ) ;
454499
500+ // "+" button opens the default/quick-access panel
501+ _$addBtn . on ( "click" , function ( e ) {
502+ e . stopPropagation ( ) ;
503+ if ( _defaultPanelId && _panelMap [ _defaultPanelId ] ) {
504+ _panelMap [ _defaultPanelId ] . show ( ) ;
505+ }
506+ } ) ;
507+
455508 // Hide-panel button collapses the container but keeps tabs intact
456509 _$tabBar . on ( "click" , ".bottom-panel-hide-btn" , function ( e ) {
457510 e . stopPropagation ( ) ;
0 commit comments