fix: hide the built-in source pill in the host editor

This commit is contained in:
LukeGus committed 2026-09-30 17:50:42 -05:00
1 parent f97f35de1f
commit c28cb1bfc6
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -111,7 +111,7 @@ export function HostDefaultBadge({ settingKey }: { settingKey: string }) {
</button>
);
}
if (own) return null;
if (own || source?.level === "builtin") return null;
return (
<span
title={
@@ -54,6 +54,14 @@ describe("HostDefaultBadge", () => {
expect(screen.getByText("hostDefaults.source.folder:Prod")).toBeTruthy();
});
it("shows nothing for a value that follows the built-in default", () => {
const { container } = withContext(
context({ source: () => ({ level: "builtin" }) }),
<HostDefaultBadge settingKey="core.sshPort" />,
);
expect(container.textContent).toBe("");
});
it("offers a reset for a host's own value", () => {
const value = context({ isOwn: () => true });
withContext(value, <HostDefaultBadge settingKey="core.sshPort" />);