diff --git a/gui/main.qml b/gui/main.qml index 6b0af3c..13f6f30 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -491,13 +491,6 @@ ApplicationWindow { } scrollTimer.start() } - function onSessionConnected() { - chatModel.appendData("\n[[[info]]]\nsession connected\n[[[end]]]\n") - scrollTimer.start() - } - function onStreamingDone() { - chatModel.appendData("\n[[[info]]]\nsession ended\n[[[end]]]\n") - } } // --- Rename Error Dialog --- @@ -928,14 +921,14 @@ ApplicationWindow { focus: false activeFocusOnTab: false - // Show placeholder when empty + // Show placeholder when empty or disconnected Label { anchors.centerIn: parent - text: "(no sessions)" + text: ollie.daemonConnected ? "(no sessions)" : "(not connected)" color: theme.midColor font.italic: true font.pixelSize: theme.fontSize > 0 ? theme.fontSize * 0.9 : 12 - visible: sessionList.count === 0 + visible: sessionList.count === 0 || !ollie.daemonConnected activeFocusOnTab: false } @@ -1209,14 +1202,18 @@ ApplicationWindow { Layout.fillHeight: true clip: true - // Placeholder when no agent selected + // Placeholder when no agent selected or disconnected Label { anchors.centerIn: parent - text: ollie.activeSessionId ? "Select an agent to view chat" : "Select a session" + text: { + if (!ollie.daemonConnected) return "Not connected" + if (!ollie.activeSessionId) return "Select a session" + return "Select an agent to view chat" + } color: theme.midColor font.italic: true font.pixelSize: theme.fontSize > 0 ? theme.fontSize : 12 - visible: !ollie.activeAgentId + visible: !ollie.activeAgentId || !ollie.daemonConnected } ListView { @@ -1226,7 +1223,7 @@ ApplicationWindow { anchors.fill: parent anchors.margins: 4 boundsBehavior: Flickable.StopAtBounds - visible: ollie.activeAgentId !== "" + visible: ollie.daemonConnected && ollie.activeAgentId !== "" onCountChanged: { if (count > 0) @@ -1371,12 +1368,13 @@ property bool blockExpanded: { id: promptInput Layout.fillWidth: true placeholderText: { + if (!ollie.daemonConnected) return "Not connected" if (!ollie.activeSessionId) return "No session" if (!ollie.activeAgentId) return "No agent" if (ollie.isSessionPaused(ollie.activeSessionId)) return "Session paused" return "Message..." } - enabled: ollie.activeSessionId !== "" && ollie.activeAgentId !== "" && !ollie.isSessionPaused(ollie.activeSessionId) + enabled: ollie.daemonConnected && ollie.activeSessionId !== "" && ollie.activeAgentId !== "" && !ollie.isSessionPaused(ollie.activeSessionId) wrapMode: TextEdit.Wrap property string _lastText: "" diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index b1d0b47..c94323a 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -45,9 +45,6 @@ Ollie9pClient::Ollie9pClient(QObject *parent) if (!data.isEmpty()) emit chatReceived(QString::fromUtf8(data)); }); - connect(m_chat, &StreamFsm::died, this, [this]() { - emit streamingDone(); - }); // State stream — guarded, reads agent statewait. Auto-restarts until // session/agent is deselected (guard returns false). @@ -81,7 +78,6 @@ Ollie9pClient::Ollie9pClient(QObject *parent) // Restart streams for the active agent if we have one if (!m_activeSessionId.isEmpty() && !m_agentId.isEmpty()) { startActiveAgentStreams(); - emit sessionConnected(); } }); connect(m_daemon, &NinePConnection::disconnected, this, [this]() { diff --git a/gui/ollie9pclient.h b/gui/ollie9pclient.h index 93a26df..24e79c6 100644 --- a/gui/ollie9pclient.h +++ b/gui/ollie9pclient.h @@ -93,8 +93,6 @@ signals: void activeStateChanged(); void agentStateChanged(const QString &sessionId, const QString &agentId, const QString &state); void chatReceived(const QString &text); - void sessionConnected(); - void streamingDone(); // chat process exited (session killed) void rootBackendsLoadedChanged(); void availableBackendsChanged(); void rootAgentsLoadedChanged();