Compare commits

...
2 Commits
4 changed files with 44 additions and 4 deletions

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Changelog # Changelog
## 26.11.1
### Fixed
- The first run plugin picker no longer sets the default layout and themes to Remove. They always stay on
## 26.11.0 ## 26.11.0
### Fixed ### Fixed
+2 -2
View File
@@ -1,6 +1,6 @@
cask "termix" do cask "termix" do
version "26.10.6" version "26.11.0"
sha256 "970d579c438b20fc364912ac53b15f55384cc9b1c169d73320d845af3d9e5be8" sha256 "1b873e1315d769f8e416c1690032142efb152d1265c2f078b33f72cec3e6e03e"
url "https://github.com/Termix-SSH/Termix/releases/download/v#{version}/termix_macos_universal_dmg.dmg" url "https://github.com/Termix-SSH/Termix/releases/download/v#{version}/termix_macos_universal_dmg.dmg"
name "Termix" name "Termix"
+13 -2
View File
@@ -5,7 +5,7 @@
import { pluginLogger } from "../utils/logger.js"; import { pluginLogger } from "../utils/logger.js";
import { getPluginRuntime } from "./index.js"; import { getPluginRuntime } from "./index.js";
import { onboardingDefaults } from "./bundled-index.js"; import { isDefaultLookPlugin, onboardingDefaults } from "./bundled-index.js";
import { import {
isLinkedDesktop, isLinkedDesktop,
serialized, serialized,
@@ -99,6 +99,11 @@ export async function offerPluginSetup(fresh: boolean): Promise<void> {
await settings.set(PLUGIN_SETUP_OFFERED_KEY, "1"); await settings.set(PLUGIN_SETUP_OFFERED_KEY, "1");
} }
// The shipped default look always stays on, so the picker never offers it.
function inPicker(plugin: { id: string; source: string }): boolean {
return !(plugin.source === "bundled" && isDefaultLookPlugin(plugin.id));
}
function choicePlugins(): ChoicePlugin[] { function choicePlugins(): ChoicePlugin[] {
return getPluginRuntime() return getPluginRuntime()
.loader.list() .loader.list()
@@ -118,6 +123,7 @@ export async function describeOnboardingPlugins(): Promise<OnboardingPluginList>
); );
const plugins = getPluginRuntime() const plugins = getPluginRuntime()
.loader.list() .loader.list()
.filter(inPicker)
.map((plugin): OnboardingPluginInfo => { .map((plugin): OnboardingPluginInfo => {
const defaults = const defaults =
plugin.source === "bundled" plugin.source === "bundled"
@@ -158,7 +164,12 @@ export function applyOnboardingChoices(
): Promise<OnboardingApplyResult> { ): Promise<OnboardingApplyResult> {
return serialized(async () => { return serialized(async () => {
const plugins = choicePlugins(); const plugins = choicePlugins();
const installed = new Set(plugins.map((plugin) => plugin.id)); const installed = new Set(
getPluginRuntime()
.loader.list()
.filter(inPicker)
.map((plugin) => plugin.id),
);
const wanted: Record<string, PluginChoice> = {}; const wanted: Record<string, PluginChoice> = {};
for (const [id, choice] of Object.entries(choices)) { for (const [id, choice] of Object.entries(choices)) {
if (installed.has(id)) wanted[id] = choice; if (installed.has(id)) wanted[id] = choice;
@@ -197,6 +197,13 @@ describe("describeOnboardingPlugins", () => {
}); });
expect(byId.extra).toMatchObject({ recommended: true, consent: true }); expect(byId.extra).toMatchObject({ recommended: true, consent: true });
}); });
it("leaves out the default look", async () => {
writeIndex({ extra: { defaultLook: true } });
await chain();
const list = await onboarding.describeOnboardingPlugins();
expect(list.plugins.map((p) => p.id).sort()).toEqual(["addon", "base"]);
});
}); });
describe("applyOnboardingChoices", () => { describe("applyOnboardingChoices", () => {
@@ -263,6 +270,22 @@ describe("applyOnboardingChoices", () => {
expect(db.settings.get(onboarding.PLUGIN_SETUP_PENDING_KEY)).toBe("1"); expect(db.settings.get(onboarding.PLUGIN_SETUP_PENDING_KEY)).toBe("1");
}); });
it("never turns off or removes the default look", async () => {
writeIndex({ extra: { defaultLook: true } });
const loader = await chain();
const result = await onboarding.applyOnboardingChoices({
extra: "remove",
base: "remove",
addon: "remove",
});
expect(result.failed).toEqual([]);
expect(result.removed).toEqual(["addon", "base"]);
expect(loader.get("extra")?.state).toBe("active");
await onboarding.applyOnboardingChoices({ extra: "disabled" });
expect(loader.get("extra")?.state).toBe("active");
});
it("ignores ids that are not installed", async () => { it("ignores ids that are not installed", async () => {
await chain(); await chain();
const result = await onboarding.applyOnboardingChoices({ const result = await onboarding.applyOnboardingChoices({