refactor(ui): name the auto-router prompt control Edit prompt and say it takes examples

The control is the one place an edited tier set writes calibration examples, so
the label and the line under it now say that rather than describing the text as
opening instructions. The label is fixed instead of switching on whether a
prompt is set, since the Reset to default link beside it already carries that.
This commit is contained in:
Tin Chi Lo 2026-08-26 23:36:28 -07:00
parent 8921bfb0fc
commit da80de7848
2 changed files with 6 additions and 5 deletions

View file

@ -42,7 +42,7 @@ const ClassificationPromptEditor: React.FC<ClassificationPromptEditorProps> = ({
<div>
<div className="flex items-center gap-2">
<Button type="button" size="sm" variant="outline" onClick={openEditor}>
{isOverridden ? "Edit opening instructions" : "Change default prompt"}
Edit prompt
</Button>
{isOverridden && (
<Button type="button" size="sm" variant="link" onClick={() => onChange(undefined)}>
@ -52,8 +52,8 @@ const ClassificationPromptEditor: React.FC<ClassificationPromptEditorProps> = ({
</div>
<p className="mt-1 text-xs text-muted-foreground">
{isOverridden
? "This router opens its classifier prompt with your own instructions."
: "Replace the opening instructions, and write calibration examples of your own. Your tier definitions and the injection guard are always appended below them."}
? "This router opens with your own instructions and calibration examples. Your tier definitions and the injection guard are still appended below them."
: "Write the opening instructions and your own calibration examples. Your tier definitions and the injection guard are always appended below them."}
</p>
<Dialog open={isOpen} onOpenChange={setIsOpen}>

View file

@ -1301,7 +1301,8 @@ describe("ComplexityRouterConfig tier editing", () => {
it("lets an edited tier set write its own opening instructions instead of refusing a prompt outright", () => {
renderWithProviders(<ComplexityRouterConfig {...baseProps} value={customValue} onEditingTiersChange={vi.fn()} />);
fireEvent.click(screen.getByText("Advanced: Classification Method"));
expect(screen.getByText("write calibration examples of your own", { exact: false })).toBeInTheDocument();
expect(screen.getByText("your own calibration examples", { exact: false })).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Edit prompt" })).toBeInTheDocument();
expect(screen.queryByText("A replacement prompt drops the tier bullets", { exact: false })).not.toBeInTheDocument();
});
@ -1315,7 +1316,7 @@ describe("ComplexityRouterConfig tier editing", () => {
);
fireEvent.click(screen.getByText("Advanced: Classification Method"));
expect(screen.getByText("Replace the built-in complexity rubric", { exact: false })).toBeInTheDocument();
expect(screen.queryByText("write calibration examples of your own", { exact: false })).not.toBeInTheDocument();
expect(screen.queryByText("your own calibration examples", { exact: false })).not.toBeInTheDocument();
});
it("leaves built-in routers with their display-name inputs and no restriction copy", () => {