v0.9.1: the window opens on the session the engine already has open
A workspace is never empty on the second run: cst_agent_open() resumes the last session of the store, so the engine holds a transcript before the window exists. The window only filled its view on a session *switch*, and a start is not a switch -- the pane came up empty next to a sidebar pointing at the very session it belonged to (on the phone: "hello, 6 messages" highlighted, no transcript under it). - Main.qml: Component.onCompleted reloads the session list and replays the open session, the same call the sessionChanged handler makes. - AgentCore::switchSession(): a click on the row of the session that is already open emits sessionChanged instead of returning quietly, so the row redraws its transcript rather than being a dead spot. - --uitest: the window is now created over a seeded session (a fixture is written and switched to before the QML loads, which is what a restart looks like) and the check "the open session is on screen at startup" pins it -- it failed with 0 rows before the fix. Two qWaits in the settings-dialog section, whose clicks were racing the dialog's layout: the extra startup work made that visible (5 failures that had nothing to do with sessions). Verified: --uitest 79/79 (the new check among them), cst-app-selftest OK, and on the phone -- the APK rebuilt and installed, a restart of the app draws the whole stored session (messages, tool cards, thinking blocks, copy icons). Version 0.9.1. mode = coding
This commit is contained in:
@@ -551,8 +551,13 @@ bool AgentCore::newSession() {
|
||||
bool AgentCore::switchSession(const QString &id) {
|
||||
if (!m_agent || m_running || id.isEmpty())
|
||||
return false;
|
||||
if (id == sessionId())
|
||||
if (id == sessionId()) {
|
||||
/* A click on the row of the session that is already open: nothing to
|
||||
* switch, but the window still wants the transcript (the row is not a
|
||||
* dead spot), and sessionChanged is what draws it. */
|
||||
emit sessionChanged();
|
||||
return true;
|
||||
}
|
||||
if (cst_agent_switch_session(m_agent, id.toUtf8().constData()) != 0)
|
||||
return false;
|
||||
afterSessionChange();
|
||||
|
||||
Reference in New Issue
Block a user