mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(ui): let the auto-router scoring tier list follow the theme (#39040)
* fix(ui): let the auto-router scoring tier list follow the theme * test(ui): assert the tier list carries the muted-foreground token
This commit is contained in:
parent
8d6d7f9ce9
commit
0565d33fa5
2 changed files with 10 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ const HowClassificationWorks: React.FC<{ value: ComplexityRouterConfigValue }> =
|
|||
<strong className="block mb-2 font-semibold">How Classification Works</strong>
|
||||
<span className="text-[13px] text-muted-foreground">{scoringExplanation(value)}</span>
|
||||
{scorerRuns && ranges && (
|
||||
<ul style={{ marginTop: 8, marginBottom: 0, paddingLeft: 20, fontSize: 13, color: "rgba(0, 0, 0, 0.45)" }}>
|
||||
<ul className="mt-2 pl-5 text-[13px] text-muted-foreground">
|
||||
<li>
|
||||
<strong>{effectiveTierLabel("SIMPLE", value.tier_labels)}</strong>: Score < {ranges.simpleMedium}
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,15 @@ describe("ComplexityRouterConfig", () => {
|
|||
expect(screen.getByText(/Score > 0.60/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("leaves the score threshold list color to the theme instead of an inline style", () => {
|
||||
renderWithProviders(<ComplexityRouterConfig {...baseProps} />);
|
||||
fireEvent.click(screen.getByText("Advanced: Classification Method"));
|
||||
const list = screen.getByText(/Score < 0.15/).closest<HTMLUListElement>("ul");
|
||||
expect(list).toBeInTheDocument();
|
||||
expect(list).toHaveClass("text-muted-foreground");
|
||||
expect(list?.style.color).toBe("");
|
||||
});
|
||||
|
||||
it("should default to heuristic and hide classifier model/timeout fields", () => {
|
||||
renderWithProviders(<ComplexityRouterConfig modelInfo={mockModelInfo} value={defaultValue} onChange={vi.fn()} />);
|
||||
expect(screen.getByText("Advanced: Classification Method")).toBeInTheDocument();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue