-
Notifications
You must be signed in to change notification settings - Fork 107
Fix memory saving #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory saving #196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,16 +11,13 @@ export async function sendMessage() { | |||||||||||||||
| if (!message) return; | ||||||||||||||||
|
|
||||||||||||||||
| const selectedValue = getSelectedGraph() || ''; | ||||||||||||||||
| if (!selectedValue || selectedValue === "Select Database") { | ||||||||||||||||
| addMessage('Please select a graph from the dropdown before sending a message.', "followup"); | ||||||||||||||||
| return; | ||||||||||||||||
| } | ||||||||||||||||
| if (!selectedValue || selectedValue === "Select Database") return | ||||||||||||||||
|
|
||||||||||||||||
| if (state.currentRequestController) { | ||||||||||||||||
| state.currentRequestController.abort(); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| addMessage(message, "user", (window as any).currentUser || null); | ||||||||||||||||
| addMessage(message, "user", false, (window as any).currentUser || null); | ||||||||||||||||
| if (DOM.messageInput) DOM.messageInput.value = ''; | ||||||||||||||||
|
Comment on lines
+20
to
21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainEnsure all addMessage call sites use the updated argument order. This call is correct (3rd arg isQuery=false, 4th user). There are older call sites passing the user object as the 3rd arg, which drops the avatar. Verify and align. Run to find suspicious 3-arg "user" calls: If matches exist, update them to 🏁 Script executed: #!/bin/bash
# 3-arg addMessage with "user" as 2nd arg (likely missing the boolean third arg)
rg -nP --type=ts -C2 '\baddMessage\s*\(\s*[^,]+,\s*"user"\s*,\s*[^,\)]+\s*\)'Length of output: 407 Update the 3-arg addMessage call on line 257 to include the isQuery boolean. --- a/app/ts/modules/chat.ts
+++ b/app/ts/modules/chat.ts
@@ 255,262
- addMessage(`User choice: ${confirmation}`, "user", (window as any).currentUser || null);
+ addMessage(`User choice: ${confirmation}`, "user", false, (window as any).currentUser || null);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| // Show typing indicator | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,10 @@ export function addGraphOption(name: string, onSelect: (n: string) => void, onDe | |||||||||||||||||||||||||||||||||||||
| row.appendChild(delBtn); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| row.addEventListener('click', () => { | ||||||||||||||||||||||||||||||||||||||
| if (DOM.graphSelectRefresh && DOM.submitButton) { | ||||||||||||||||||||||||||||||||||||||
| DOM.graphSelectRefresh.disabled = false | ||||||||||||||||||||||||||||||||||||||
| DOM.submitButton.disabled = false | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+46
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Also enable the message input; enable controls independently Currently only refresh and submit are enabled, and only if both elements exist. Enable each control independently and re-enable the input so users can type immediately. - if (DOM.graphSelectRefresh && DOM.submitButton) {
- DOM.graphSelectRefresh.disabled = false
- DOM.submitButton.disabled = false
- };
+ if (DOM.graphSelectRefresh) {
+ DOM.graphSelectRefresh.disabled = false;
+ DOM.graphSelectRefresh.removeAttribute('aria-disabled');
+ }
+ if (DOM.submitButton) {
+ DOM.submitButton.disabled = false;
+ }
+ if (DOM.messageInput) {
+ DOM.messageInput.disabled = false;
+ DOM.messageInput.focus();
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| setSelectedGraph(name); | ||||||||||||||||||||||||||||||||||||||
| onSelect(name); | ||||||||||||||||||||||||||||||||||||||
| optionsContainer.classList.remove('open'); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.