Skip to content

Commit 7b1817d

Browse files
authored
Merge pull request #80 from NeuralNomadsAI/dev
Release 0.7.4
2 parents 5bc3c23 + 05f193d commit 7b1817d

9 files changed

Lines changed: 38 additions & 14 deletions

File tree

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codenomad-workspace",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"private": true,
55
"description": "CodeNomad monorepo workspace",
66
"workspaces": {

packages/electron-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neuralnomads/codenomad-electron-app",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "CodeNomad - AI coding assistant",
55
"author": {
66
"name": "Neural Nomads",

packages/server/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neuralnomads/codenomad",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "CodeNomad Server",
55
"author": {
66
"name": "Neural Nomads",

packages/tauri-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codenomad/tauri-app",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"private": true,
55
"scripts": {
66
"dev": "tauri dev",

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codenomad/ui",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"private": true,
55
"type": "module",
66
"scripts": {

packages/ui/src/stores/instances.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ function workspaceDescriptorToInstance(descriptor: WorkspaceDescriptor): Instanc
9292
}
9393
}
9494

95+
function ensureActiveInstanceSelected(): void {
96+
const current = activeInstanceId()
97+
const instanceMap = instances()
98+
if (current && instanceMap.has(current)) return
99+
100+
for (const [id, instance] of instanceMap.entries()) {
101+
if (instance.status === "ready") {
102+
setActiveInstanceId(id)
103+
return
104+
}
105+
}
106+
}
107+
95108
function upsertWorkspace(descriptor: WorkspaceDescriptor) {
96109
const mapped = workspaceDescriptorToInstance(descriptor)
97110
if (instances().has(descriptor.id)) {
@@ -102,6 +115,9 @@ function upsertWorkspace(descriptor: WorkspaceDescriptor) {
102115

103116
if (descriptor.status === "ready") {
104117
attachClient(descriptor)
118+
// If no tab is currently selected (common after UI refresh),
119+
// auto-select the first ready instance.
120+
ensureActiveInstanceSelected()
105121
}
106122
}
107123

@@ -225,15 +241,18 @@ async function hydrateInstanceData(instanceId: string) {
225241
}
226242
}
227243

228-
void (async function initializeWorkspaces() {
244+
void (async function initializeWorkspaces() {
229245
try {
230246
const workspaces = await serverApi.fetchWorkspaces()
231247
workspaces.forEach((workspace) => upsertWorkspace(workspace))
248+
// After a UI refresh, we may have instances but no active selection.
249+
ensureActiveInstanceSelected()
232250
} catch (error) {
233251
log.error("Failed to load workspaces", error)
234252
}
235253
})()
236254

255+
237256
serverEvents.on("*", (event) => handleWorkspaceEvent(event))
238257

239258
function handleWorkspaceEvent(event: WorkspaceEventPayload) {

packages/ui/src/stores/session-events.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { loadMessages } from "./session-api"
3939
import {
4040
applyPartUpdateV2,
4141
replaceMessageIdV2,
42+
reconcilePendingQuestionsV2,
4243
upsertMessageInfoV2,
4344
upsertPermissionV2,
4445
upsertQuestionV2,
@@ -230,6 +231,10 @@ function handleMessageUpdate(instanceId: string, event: MessageUpdateEvent | Mes
230231

231232
applyPartUpdateV2(instanceId, { ...part, sessionID: sessionId, messageID: messageId })
232233

234+
if (part.type === "tool" && part.tool === "question") {
235+
// Questions can arrive before their tool part exists; re-link now.
236+
reconcilePendingQuestionsV2(instanceId, sessionId)
237+
}
233238

234239
updateSessionInfo(instanceId, sessionId)
235240
} else if (event.type === "message.updated") {

0 commit comments

Comments
 (0)