Compare commits

..
2 Commits
4 changed files with 49 additions and 7 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
+7 -5
View File
@@ -200,8 +200,8 @@
{ {
"id": "reverse-proxy", "id": "reverse-proxy",
"source": "tmxplug", "source": "tmxplug",
"url": "https://github.com/Termix-SSH/Plugin-Reverse-Proxy/releases/download/v1.1.0/reverse-proxy-1.1.0.tmxplug", "url": "https://github.com/Termix-SSH/Plugin-Reverse-Proxy/releases/download/v1.1.1/reverse-proxy-1.1.1.tmxplug",
"sha256": "c8a9851da7ca6291c1f47cf6ab235da5057455a86b4ed0dc1c1a3026afb30aa7", "sha256": "f5e0089ca5eae1254f21ce18b222e70eb2beeae3bd874c2abc4faa1a68d3e47a",
"tier": "full" "tier": "full"
}, },
{ {
@@ -288,7 +288,9 @@
"onboarding": { "onboarding": {
"recommended": false, "recommended": false,
"consent": false, "consent": false,
"enabledByEnv": ["OIDC_CLIENT_ID"] "enabledByEnv": [
"OIDC_CLIENT_ID"
]
} }
}, },
{ {
@@ -351,8 +353,8 @@
{ {
"id": "tunnels", "id": "tunnels",
"source": "tmxplug", "source": "tmxplug",
"url": "https://github.com/Termix-SSH/Plugin-Tunnels/releases/download/v1.2.2/tunnels-1.2.2.tmxplug", "url": "https://github.com/Termix-SSH/Plugin-Tunnels/releases/download/v1.2.3/tunnels-1.2.3.tmxplug",
"sha256": "92d89c5bf7fa43fff790cc5240ae75eaf05c3c9089c6a0dfb68bbc37c517bf04", "sha256": "5a23953ee19b2951bb895e033d2099b8f6d5abc0121253ef3da25328134984ad",
"tier": "standard", "tier": "standard",
"onboarding": { "onboarding": {
"recommended": true, "recommended": true,
+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({