feat: hide session pill when sidebar is open (redundant switcher)
Hide the floating session pill when the sidebar is visible, since the sidebar already shows the complete session list. The pill reappears when the sidebar is collapsed (via toggle or click-away on mobile). Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This commit is contained in:
@@ -1026,6 +1026,9 @@ function toggleSidebar() {
|
||||
|
||||
var collapseBtn = $('sidebar-collapse-btn');
|
||||
if (collapseBtn) collapseBtn.innerHTML = isOpen ? _icons.chevronLeft : _icons.chevronRight;
|
||||
|
||||
// Show/hide the session pill based on sidebar state — pill is redundant when sidebar is open
|
||||
updateSessionPill(_currentSessions || []);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1047,6 +1050,7 @@ function bindSidebarClickAway() {
|
||||
sidebar.classList.add('sidebar--collapsed');
|
||||
if (_serverSettings) _serverSettings.sidebarOpen = false;
|
||||
patchServerSetting('sidebarOpen', false);
|
||||
updateSessionPill(_currentSessions || []);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3606,7 +3610,10 @@ function updateSessionPill(sessions) {
|
||||
}
|
||||
var pillLabel = _viewingSession || '';
|
||||
pill.label = pillLabel;
|
||||
pill.visible = true;
|
||||
// Hide the pill when the sidebar is open — it's redundant as a session switcher
|
||||
var sidebar = $('session-sidebar');
|
||||
var sidebarOpen = sidebar && !sidebar.classList.contains('sidebar--collapsed');
|
||||
pill.visible = !sidebarOpen;
|
||||
|
||||
var viewingKey = _viewingRemoteId ? (_viewingRemoteId + ':' + _viewingSession) : _viewingSession;
|
||||
var othersWithBell = sessions.filter(function(s) {
|
||||
|
||||
Reference in New Issue
Block a user