feat: redesign user host defaults system

This commit is contained in:
LukeGus committed 2026-09-30 06:19:56 -05:00
1 parent 3028ab1176
commit a4a4d4f27b
144 files changed
+24609 -2555

No files matched your search

@@ -105,7 +105,7 @@ describe("syncHostFeatureTabs", () => {
expect(getHostEditorSection(hostFeatureTabId("docker"))?.group).toBe("top");
});
it("skips a plugin that registered its own host editor section", () => {
it("gives a plugin with its own section a tab only in the defaults editor", () => {
registerHostEditorSection({
id: "docker-own",
pluginId: "docker",
@@ -113,10 +113,34 @@ describe("syncHostFeatureTabs", () => {
labelKey: "k",
component: () => null,
});
expect(syncHostFeatureTabs([plugin()])).toEqual([
hostFeatureTabId("docker"),
]);
expect(getHostEditorSection(hostFeatureTabId("docker"))?.defaults).toBe(
"only",
);
});
it("skips a plugin whose own section already covers the defaults editor", () => {
registerHostEditorSection({
id: "docker-own",
pluginId: "docker",
group: "top",
labelKey: "k",
defaults: true,
component: () => null,
});
expect(syncHostFeatureTabs([plugin()])).toEqual([]);
expect(getHostEditorSection(hostFeatureTabId("docker"))).toBeUndefined();
});
it("offers a generated tab to both the host and the defaults editor", () => {
syncHostFeatureTabs([plugin()]);
expect(getHostEditorSection(hostFeatureTabId("docker"))?.defaults).toBe(
true,
);
});
it("registers nothing for a plugin whose host fields are all hidden", () => {
const own = plugin({
contributes: {