feat(ai): unify model discovery and effort handling
This commit is contained in:
1 parent
c54b95e274
commit
c7e7b7c9d9
41 files changed
+3291
-634
No files matched your search
+16
-2
@@ -29,8 +29,8 @@ test("AI composer labels an empty template selection explicitly", () => {
|
||||
});
|
||||
|
||||
test("AI composer exposes mode and action as one compact selector", () => {
|
||||
const footerStart = source.indexOf('<!-- Combined mode + action selector -->');
|
||||
const footerEnd = source.indexOf('<!-- Combined provider + model selector -->', footerStart);
|
||||
const footerStart = source.indexOf("<!-- Combined mode + action selector -->");
|
||||
const footerEnd = source.indexOf("<!-- Combined provider + model selector -->", footerStart);
|
||||
const footer = source.slice(footerStart, footerEnd);
|
||||
|
||||
assert.notEqual(footerStart, -1, "the combined mode and action selector should exist");
|
||||
@@ -45,6 +45,20 @@ test("AI composer exposes mode and action as one compact selector", () => {
|
||||
assert.match(source, /function selectModeActionItem\(action: AiAction\) \{\s*\/\/ Vector databases[\s\S]*?if \(!showActionButtons\.value\) return;/);
|
||||
});
|
||||
|
||||
test("AI effort control opens as a hoverable side submenu", () => {
|
||||
const selectorStart = source.indexOf("<!-- Combined provider + model selector -->");
|
||||
const selectorEnd = source.indexOf("</template>", source.indexOf("</Popover>", selectorStart));
|
||||
const selector = source.slice(selectorStart, selectorEnd);
|
||||
|
||||
assert.notEqual(selectorStart, -1, "the combined provider and model selector should exist");
|
||||
assert.match(selector, /<Popover v-model:open="effortMenuOpen">/);
|
||||
assert.match(selector, /<PopoverAnchor as-child>/);
|
||||
assert.match(selector, /@mouseenter="openEffortMenu"/);
|
||||
assert.match(selector, /@mouseleave="scheduleEffortMenuClose"/);
|
||||
assert.match(selector, /<PopoverContent[\s\S]*?side="left"[\s\S]*?:side-offset="6"/);
|
||||
assert.doesNotMatch(selector, /v-if="effortPanelOpen"/);
|
||||
});
|
||||
|
||||
test("AI composer template remains compilable", () => {
|
||||
const { descriptor, errors } = parse(source, { filename: aiAssistantPath });
|
||||
assert.deepEqual(errors, []);
|
||||
|
||||
Reference in new issue
Block a user