Float the last chat and float from the chat list
Any tiled chat can float now, including the only one; the tiling is left empty. A chat list row's More menu offers Float too: a tiled chat leaves the tiling, a chat with a window shows it, any other opens a new window.
This commit is contained in:
@@ -8,9 +8,8 @@ extension ChatWorkspaceFloat on ChatWorkspaceController {
|
||||
bool holdsSession(String sessionId) =>
|
||||
panes.any((pane) => pane.sessionId == sessionId);
|
||||
|
||||
/// A tiled pane can float while another chat stays in the tiling.
|
||||
bool canFloat(String paneId) =>
|
||||
paneCount > 1 && panes.any((pane) => pane.id == paneId);
|
||||
/// Any tiled pane can float, the last one too; the tiling is then empty.
|
||||
bool canFloat(String paneId) => panes.any((pane) => pane.id == paneId);
|
||||
|
||||
/// Takes the tiled pane [paneId] out of the tiling for a window; the pane
|
||||
/// beside it becomes active. Null when it cannot float.
|
||||
@@ -21,7 +20,9 @@ extension ChatWorkspaceFloat on ChatWorkspaceController {
|
||||
_root = _remove(_root!, paneId);
|
||||
if (_active == paneId) {
|
||||
final after = panes;
|
||||
_active = after[index.clamp(0, after.length - 1)].id;
|
||||
_active = after.isEmpty
|
||||
? null
|
||||
: after[index.clamp(0, after.length - 1)].id;
|
||||
}
|
||||
_changed();
|
||||
return pane;
|
||||
|
||||
Reference in New Issue
Block a user