Populate metadata for every restored chat pane
This commit is contained in:
@@ -295,6 +295,7 @@ class _ChatScreenState extends State<ChatScreen> with _ChatScreenWorkspace {
|
||||
void _adoptRows(List<JsonMap> rows) {
|
||||
if (!mounted) return;
|
||||
final selected = _selected;
|
||||
final retained = _workspace.panes.map((pane) => pane.sessionId).toSet();
|
||||
final next = <String, JsonMap>{};
|
||||
for (final row in rows) {
|
||||
final id = '${row['id'] ?? ''}';
|
||||
@@ -303,7 +304,7 @@ class _ChatScreenState extends State<ChatScreen> with _ChatScreenWorkspace {
|
||||
final previous = _listedRows[id];
|
||||
_listedRows[id] = listed;
|
||||
final opened = _openedSessions[id];
|
||||
if (opened == null && id != selected) continue;
|
||||
if (opened == null && id != selected && !retained.contains(id)) continue;
|
||||
if (opened != null && chatJsonEquals(previous, listed)) continue;
|
||||
final adopted = <String, dynamic>{...?opened, ...listed};
|
||||
if (opened != null && opened.containsKey('running')) {
|
||||
@@ -336,7 +337,7 @@ class _ChatScreenState extends State<ChatScreen> with _ChatScreenWorkspace {
|
||||
/// The row to open for [id], with an accepted model folded in.
|
||||
@override
|
||||
JsonMap? _rowFor(String id) {
|
||||
final row = _openedSessions[id];
|
||||
final row = _openedSessions[id] ?? _listedRows[id];
|
||||
final accepted = _acceptedModels[id];
|
||||
if (row == null || accepted == null) return row;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user