fix(ai): lisibilite des modeles + contexte @ en mode General (BUG-010, BUG-011)
CI / lint (push) Successful in 1m8s
CI / security (push) Successful in 44s
CI / test (push) Successful in 2m5s
CI / build (push) Successful in 39s
CI / e2e (push) Successful in 10m37s

BUG-011: popover des modeles aligne a droite (right:0), largeur 340px bornee, noms sur plusieurs lignes + title. BUG-010: la selection @ capture le vault renvoye par tree-search et _contextVault() le propage aux requetes /context et /chat, corrigeant le contexte ad-hoc en mode General.
This commit is contained in:
2026-09-12 13:50:14 -04:00
parent 7f0e34d318
commit eea2108ac2
7 changed files with 99 additions and 24 deletions
+35
View File
@@ -760,6 +760,41 @@ async function main() {
b._panel.remove();
});
// ── 35b. `@` captures the vault for General-mode ad-hoc context (BUG-010) ──
await test("mention selection stores its vault and feeds the context request", async () => {
localStorage.clear();
globalThis.fetch = async (url) => {
if (String(url).includes("/api/tree-search")) {
return {
ok: true, status: 200,
json: async () => ({ results: [{ vault: "TestVault", path: "notes/a.md", type: "file" }] }),
};
}
return { ok: true, status: 200, json: async () => ({}) };
};
const b = new BooksLM();
b._panel = b._render();
document.body.appendChild(b._panel);
b._mode = MODE.GENERAL;
b._vault = null;
await b._showMentionMenu("notes");
b._selectMention({ id: "notes/a.md", type: "file", vault: "TestVault" });
assert.equal(b._adhocFiles[0].vault, "TestVault", "ad-hoc entry keeps its vault");
assert.equal(b._contextVault(), "TestVault", "context vault derives from the ad-hoc entry");
let posted = null;
globalThis.fetch = async (url, opts) => {
if (String(url).includes("/api/ai/bookslm/context")) posted = JSON.parse(opts.body);
return { ok: true, status: 200, json: async () => ({ files: [], scope: "documents" }) };
};
await b._loadContext();
assert.equal(posted.vault, "TestVault", "context request carries the vault");
assert.deepEqual(posted.extra_files, ["notes/a.md"]);
b._panel.remove();
localStorage.clear();
});
// ── 36. Capability checklist rendering (#81) ──
await test("capability list renders checked and unchecked flags", () => {
const caps = {