Float one chat pane over the app and toggle it with Ctrl+Y / Cmd+Y
This commit is contained in:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user