feat(FN-4173): enable always-on web search in ResearchView
Adds a changeset for a minor feature that locks the web search provider UI as always-on in ResearchView, with corresponding component and test updates. Fusion-Task-Id: FN-4173
This commit is contained in:
5
.changeset/fn-4173-web-search-always-on-ui.md
Normal file
5
.changeset/fn-4173-web-search-always-on-ui.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Align the Research view provider checklist with the always-on web search behavior from FN-4135 by keeping **Web Search** visible as a locked checked option with an **Always on** affordance.
|
||||||
@@ -86,6 +86,11 @@
|
|||||||
gap: var(--space-xs);
|
gap: var(--space-xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.research-view__provider-lock {
|
||||||
|
margin-left: var(--space-xs);
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
.research-view__history-header {
|
.research-view__history-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -278,7 +278,10 @@ export function ResearchView({ projectId, addToast, onOpenSettings, readinessVer
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span>{PROVIDER_LABELS[provider] ?? provider}{providerLocked ? " (always on)" : ""}</span>
|
<span>
|
||||||
|
{PROVIDER_LABELS[provider] ?? provider}
|
||||||
|
{providerLocked ? <span className="research-view__provider-lock">Always on</span> : null}
|
||||||
|
</span>
|
||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -384,7 +384,8 @@ describe("ResearchView", () => {
|
|||||||
});
|
});
|
||||||
mockFetchAuthStatus.mockResolvedValue({ providers: [{ id: "openrouter", type: "api_key", authenticated: true }] });
|
mockFetchAuthStatus.mockResolvedValue({ providers: [{ id: "openrouter", type: "api_key", authenticated: true }] });
|
||||||
render(<ResearchView projectId="p1" />);
|
render(<ResearchView projectId="p1" />);
|
||||||
expect(await screen.findByText("Web Search (always on)")).toBeInTheDocument();
|
expect(await screen.findByText("Web Search")).toBeInTheDocument();
|
||||||
|
expect(screen.getByText("Always on")).toBeInTheDocument();
|
||||||
expect(screen.getByText("Page Fetch")).toBeInTheDocument();
|
expect(screen.getByText("Page Fetch")).toBeInTheDocument();
|
||||||
expect(screen.getByText("LLM Synthesis")).toBeInTheDocument();
|
expect(screen.getByText("LLM Synthesis")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -412,7 +413,8 @@ describe("ResearchView", () => {
|
|||||||
|
|
||||||
render(<ResearchView projectId="p1" />);
|
render(<ResearchView projectId="p1" />);
|
||||||
|
|
||||||
const webSearch = (await screen.findByLabelText("Web Search (always on)")) as HTMLInputElement;
|
const webSearch = (await screen.findByLabelText(/Web Search/i)) as HTMLInputElement;
|
||||||
|
expect(screen.getByText("Always on")).toBeInTheDocument();
|
||||||
const pageFetch = screen.getByLabelText("Page Fetch") as HTMLInputElement;
|
const pageFetch = screen.getByLabelText("Page Fetch") as HTMLInputElement;
|
||||||
expect(webSearch.disabled).toBe(true);
|
expect(webSearch.disabled).toBe(true);
|
||||||
expect(webSearch.checked).toBe(true);
|
expect(webSearch.checked).toBe(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user