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:
tin-berri 2026-08-31 19:55:16 -07:00 committed by GitHub
parent 8d6d7f9ce9
commit 0565d33fa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -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 &lt; {ranges.simpleMedium}
</li>

View file

@ -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();