Float one chat pane over the app and toggle it with Ctrl+Y / Cmd+Y

This commit is contained in:
2026-11-10 12:56:39 +00:00
parent 19aa726e7f
commit bb669aface
18 changed files with 1957 additions and 56 deletions
@@ -11,6 +11,9 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
JsonMap? _rowFor(String id);
void _back();
bool get _pageOpen;
ChatFloatFrame get _floatFrame;
void _bindFloat(ChatFloatStore store, Future<void> restored);
void _unbindFloat();
Widget _thread(
String selected,
VoidCallback onBack, {
@@ -114,8 +117,17 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
_publishWorkspaceRoute();
},
);
unawaited(
_workspaceBinding!.start(initialSessionId: widget.initialSessionId),
final restored = _workspaceBinding!.start(
initialSessionId: widget.initialSessionId,
);
unawaited(restored);
_bindFloat(
SharedPreferencesChatFloatStore(
serverScope: widget.gateway is FederatedChatGateway
? 'all-saved-servers'
: scope,
),
restored,
);
}
@@ -127,6 +139,7 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
}
_workspaceBinding?.dispose();
_workspaceBinding = null;
_unbindFloat();
if (_workspaceScope != null && scope != _workspaceScope) {
_workspace.restoreLayout(ChatWorkspaceSnapshot.fromLayout(null, null)!);
_forgetRecentSessions();
@@ -297,6 +310,7 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
controller: _workspace,
onVisibleSessionIdsChanged: _workspaceVisibilityChanged,
shortcutsEnabled: _workspaceVisible,
floatFrame: _floatFrame,
singlePane: !showsListBesideDetail(context),
mobilePeeks: true,
paneTitle: (pane) =>