Focus floating chat from terminal shortcut

Raise the most recently used chat when Ctrl+Y is invoked from another window, then rely on the existing host lifecycle to focus its composer. Preserve toggle behavior while chat is active and retain the Apple shortcut aliases.
This commit is contained in:
2026-11-11 19:40:30 +00:00
parent 3da71c3053
commit 4668deeaf7
8 changed files with 142 additions and 17 deletions
+14
View File
@@ -289,6 +289,20 @@ class WindowManager extends ChangeNotifier {
return true;
}
/// Hides the group when it is active; otherwise shows and raises its most
/// recently used window. A global shortcut should bring a group forward when
/// pressed from another window, rather than hide it behind that window.
bool toggleOrRaiseGroup(String groupId) {
final group = inGroup(groupId).toList();
if (group.isEmpty) return false;
if (group.any(isVisible) && active?.groupId == groupId) {
setGroupShown(groupId, false);
} else {
show(group.last.id);
}
return true;
}
/// Brings the next ([step] 1) or previous (-1) visible window to the top.
void cycle([int step = 1]) {
final visible = windows.where(isVisible).toList();