JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(/memory): remember list pointer location
ldstyle80f8d83098f04
diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex 1bbebe9e09..f87926b538 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -574,6 +574,9 @@ function filterConfigItems(return items;}+/** Last selected memory file path — restores cursor position within the same session. */+let lastMemorySelection: string | null = null;+export class AppScreen implements Component, Focusable {private readonly editor: Editor;private readonly unsubscribe: () => void;@@ -3793,7 +3796,11 @@ export class AppScreen implements Component, Focusable {list.onSelectionChange = () => {this.invalidate();};- const selectedValue = this.pendingQuestionAnswers.get(this.activeQuestionIndex);+ let selectedValue = this.pendingQuestionAnswers.get(this.activeQuestionIndex);+ // For memory edit, restore cursor to the last selected file within this session+ if (!selectedValue && pendingQuestion.source === "local_command_memory_edit" && lastMemorySelection) {+ selectedValue = lastMemorySelection;+ }const selectedIndex = selectedValue? items.findIndex((item) => item.value === selectedValue): 0;@@ -3825,6 +3832,11 @@ export class AppScreen implements Component, Focusable {return;}+ // Remember memory edit selection so cursor restores to the same file within this session+ if (pendingQuestion.source === "local_command_memory_edit") {+ lastMemorySelection = label;+ }+const answers = pendingQuestion.questions.map((question, index) => {const answerValue = this.pendingQuestionAnswers.get(index) ?? question.options[0]?.label ?? "";return {