Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import AppKit
public import AppKit
import CmuxNextDesign

// Leo (T3 Code ref, 2026-10-07): while the window shows a full-page
// destination (`SidebarModel.showsBack`), the footer band gives way to one
// wide Back button in the same spot, a universal way back to where you were.
// The footer: its accessory slots, and Back. Leo (T3 Code ref, 2026-10-07):
// while the window shows a full-page destination (`SidebarModel.showsBack`),
// the footer band gives way to one wide Back button in the same spot, a
// universal way back to where you were.
extension SidebarView {
/// Installs (or removes, with nil) the view in a footer slot.
public func setAccessory(_ view: NSView?, for slot: SidebarAccessorySlot) {
accessories[slot]?.removeFromSuperview()
accessories[slot] = view
if let view {
view.translatesAutoresizingMaskIntoConstraints = true
footer.addSubview(view)
}
needsLayout = true
}

func installBackButton() {
backButton.isHidden = true
backButton.onPress = { [weak self] in self?.model.onBack?() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public final class SidebarView: NSView {
var isChromeRevealed = false
/// Bands minimal mode hides right now (the fade's target, R54).
var minimalHiddenBands: (top: Bool, bottom: Bool) = (false, false)
private var accessories: [SidebarAccessorySlot: NSView] = [:]
var accessories: [SidebarAccessorySlot: NSView] = [:]
let footer = NSView()
/// The staged update card above the footer (`SidebarModel.updateCard`).
let updateCardView = SidebarUpdateCardView()
/// Back, in the footer band's spot while a destination is open (`SidebarView+Back`).
/// Back, in the footer band's spot while a destination is open (`SidebarView+Footer`).
let backButton = SidebarBackButton()
/// Where the spaces dots sit (`sidebar.spacesPosition`, R109).
public var spacesPosition: SpacesPosition = .bottom {
Expand Down Expand Up @@ -108,17 +108,6 @@ public final class SidebarView: NSView {
}
}

/// Installs (or removes, with nil) the view in a footer slot.
public func setAccessory(_ view: NSView?, for slot: SidebarAccessorySlot) {
accessories[slot]?.removeFromSuperview()
accessories[slot] = view
if let view {
view.translatesAutoresizingMaskIntoConstraints = true
footer.addSubview(view)
}
needsLayout = true
}

/// Focuses the workspace list for keyboard navigation.
public func focusList() {
window?.makeFirstResponder(list)
Expand Down
Loading