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:
2026-11-12 00:43:03 +00:00
parent b264043eee
commit 4f1b45571f
16 changed files with 147 additions and 37 deletions
@@ -491,26 +491,29 @@ void main() {
);
}
test('Alt+E toggles by physical key position, including Option dead keys', () {
const event = KeyDownEvent(
physicalKey: PhysicalKeyboardKey.keyE,
logicalKey: LogicalKeyboardKey(0x00B4),
character: '´',
timeStamp: Duration.zero,
);
expect(chatCenterStageShortcut(event, _AltHeld()), isTrue);
expect(
chatCenterStageShortcut(
const KeyUpEvent(
physicalKey: PhysicalKeyboardKey.keyE,
logicalKey: LogicalKeyboardKey(0x00B4),
timeStamp: Duration.zero,
test(
'Alt+E toggles by physical key position, including Option dead keys',
() {
const event = KeyDownEvent(
physicalKey: PhysicalKeyboardKey.keyE,
logicalKey: LogicalKeyboardKey(0x00B4),
character: '´',
timeStamp: Duration.zero,
);
expect(chatCenterStageShortcut(event, _AltHeld()), isTrue);
expect(
chatCenterStageShortcut(
const KeyUpEvent(
physicalKey: PhysicalKeyboardKey.keyE,
logicalKey: LogicalKeyboardKey(0x00B4),
timeStamp: Duration.zero,
),
_AltHeld(),
),
_AltHeld(),
),
isFalse,
);
});
isFalse,
);
},
);
testWidgets('Alt+E toggles from a focused composer without typing', (
tester,
@@ -27,13 +27,17 @@ void main() {
expect(c.holdsSession('b'), isFalse);
});
test('a lone pane cannot leave: the tiling never empties by floating', () {
test('the lone pane floats too and leaves the tiling empty', () {
final c = ChatWorkspaceController()..open('a');
final only = c.panes.single;
expect(c.canFloat(only.id), isFalse);
expect(c.detach(only.id), isNull);
expect(c.canFloat(only.id), isTrue);
expect(c.detach('nope'), isNull);
expect(c.detach(only.id)?.sessionId, 'a');
expect(c.paneCount, 0);
expect(c.activePane, isNull);
c.dock('a');
expect(_sessions(c), ['a']);
expect(c.activePane?.sessionId, 'a');
});
test('dock puts the chat right of the active pane and activates it', () {