Up-arrow (and toggle hotkey) folds chat/terminal back into the notch even while held open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -563,7 +563,7 @@ struct IslandHeader: View {
|
||||
Button(action: {
|
||||
state.chatDragHeight = nil
|
||||
state.chatDetent = 0
|
||||
NotificationCenter.default.post(name: .islandCollapse, object: nil)
|
||||
NotificationCenter.default.post(name: .islandCollapse, object: "user")
|
||||
}) {
|
||||
Image(systemName: "chevron.up")
|
||||
.font(.system(size: 13, weight: .semibold))
|
||||
|
||||
@@ -369,8 +369,14 @@ final class IslandWindowController: NSWindowController {
|
||||
state.lastActivity = .now
|
||||
}
|
||||
|
||||
func collapse() {
|
||||
/// `byUser`: the ⌃ button or the toggle hotkey — folds a chat/terminal tab away too;
|
||||
/// only a pending approval still keeps the island open.
|
||||
func collapse(byUser: Bool = false) {
|
||||
if byUser {
|
||||
guard state.pendingApproval == nil else { return }
|
||||
} else {
|
||||
guard fsm.isHeldOpen?() != true else { return }
|
||||
}
|
||||
state.isPinned = false
|
||||
finishedPinTimer?.cancel()
|
||||
// Keep the FSM in step with what is on screen (home/coucou → petit now).
|
||||
@@ -391,7 +397,7 @@ final class IslandWindowController: NSWindowController {
|
||||
switch action {
|
||||
case .toggleIsland:
|
||||
if state.mode == .expanded {
|
||||
collapse()
|
||||
collapse(byUser: true)
|
||||
} else {
|
||||
islandPanel.makeKey()
|
||||
expand(to: defaultView())
|
||||
@@ -617,8 +623,9 @@ final class IslandWindowController: NSWindowController {
|
||||
}
|
||||
|
||||
// Collapse requests from views (OK button, etc.)
|
||||
NotificationCenter.default.addObserver(forName: .islandCollapse, object: nil, queue: .main) { [weak self] _ in
|
||||
self?.collapse()
|
||||
NotificationCenter.default.addObserver(forName: .islandCollapse, object: nil, queue: .main) { [weak self] note in
|
||||
let byUser = (note.object as? String) == "user"
|
||||
MainActor.assumeIsolated { self?.collapse(byUser: byUser) }
|
||||
}
|
||||
|
||||
// Wardrobe open/close from desktop Mochi right-click (does NOT post .hookExpand)
|
||||
|
||||
Reference in New Issue
Block a user