I'm 100% going to have to destroy this commit later

This commit is contained in:
perf3ct
2025-03-09 02:19:26 +00:00
parent 733fdcf8ba
commit adaac46fbf
23 changed files with 1585 additions and 94 deletions

View File

@@ -7,8 +7,12 @@ import protectedSessionService from "../services/protected_session.js";
import options from "../services/options.js";
import froca from "../services/froca.js";
import utils from "../services/utils.js";
import LlmChatPanel from "../widgets/llm_chat_panel.js";
import toastService from "../services/toast.js";
export default class RootCommandExecutor extends Component {
private llmChatPanel: any = null;
editReadOnlyNoteCommand() {
const noteContext = appContext.tabManager.getActiveContext();
if (noteContext?.viewScope) {
@@ -226,4 +230,23 @@ export default class RootCommandExecutor extends Component {
appContext.tabManager.activateNoteContext(tab.ntxId);
}
}
async showLlmChatCommand() {
console.log("showLlmChatCommand triggered");
toastService.showMessage("Opening LLM Chat...");
try {
// We'll use the Note Map approach - open a known note ID that corresponds to the LLM chat panel
await appContext.tabManager.openTabWithNoteWithHoisting("_globalNoteMap", {
activate: true,
viewScope: {
viewMode: "llmChat" // We'll need to handle this custom view mode elsewhere
}
});
}
catch (e) {
console.error("Error opening LLM Chat:", e);
toastService.showError("Failed to open LLM Chat: " + (e as Error).message);
}
}
}