feat(FN-2006): split quick chat flows into agent and model modes

- Add explicit agent/model mode toggles to QuickChatFAB and NewChatDialog
- Update session target logic so model mode starts chats with the KB agent while agent mode uses selected agents
- Clear opposite selections when switching modes and adjust placeholders/disabled states to match active mode
- Expand ChatView and QuickChatFAB tests to cover toggle visibility, mode switching, and session payload behavior
- Add useQuickChat coverage to verify agent-only switchSession calls omit model parameters
This commit is contained in:
Fusion
2026-04-17 15:02:54 -07:00
committed by gsxdsm
parent 24c4c008ad
commit 0132328128
6 changed files with 385 additions and 147 deletions

View File

@@ -60,6 +60,25 @@ describe("useQuickChat", () => {
});
});
it("switchSession with only agentId creates session without model params", async () => {
const { result } = renderHook(() => useQuickChat("proj-123"));
await act(async () => {
await result.current.switchSession("agent-001");
});
await waitFor(() => {
expect(mockCreateChatSession).toHaveBeenCalledWith(
{ agentId: "agent-001" },
"proj-123",
);
// Ensure model params are not included
const callArg = mockCreateChatSession.mock.calls[0][0];
expect(callArg).not.toHaveProperty("modelProvider");
expect(callArg).not.toHaveProperty("modelId");
});
});
it("switchSession falls back to KB agent when no explicit agent is provided", async () => {
const { result } = renderHook(() => useQuickChat("proj-123"));