mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-11-03 09:05:24 +00:00
Compare commits
1
Commits
main
..
dev-26.11.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fb91850a0 |
No files matched your search
@@ -1,5 +1,11 @@
|
||||
# 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
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { pluginLogger } from "../utils/logger.js";
|
||||
import { getPluginRuntime } from "./index.js";
|
||||
import { onboardingDefaults } from "./bundled-index.js";
|
||||
import { isDefaultLookPlugin, onboardingDefaults } from "./bundled-index.js";
|
||||
import {
|
||||
isLinkedDesktop,
|
||||
serialized,
|
||||
@@ -99,6 +99,11 @@ export async function offerPluginSetup(fresh: boolean): Promise<void> {
|
||||
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[] {
|
||||
return getPluginRuntime()
|
||||
.loader.list()
|
||||
@@ -118,6 +123,7 @@ export async function describeOnboardingPlugins(): Promise<OnboardingPluginList>
|
||||
);
|
||||
const plugins = getPluginRuntime()
|
||||
.loader.list()
|
||||
.filter(inPicker)
|
||||
.map((plugin): OnboardingPluginInfo => {
|
||||
const defaults =
|
||||
plugin.source === "bundled"
|
||||
@@ -158,7 +164,12 @@ export function applyOnboardingChoices(
|
||||
): Promise<OnboardingApplyResult> {
|
||||
return serialized(async () => {
|
||||
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> = {};
|
||||
for (const [id, choice] of Object.entries(choices)) {
|
||||
if (installed.has(id)) wanted[id] = choice;
|
||||
|
||||
@@ -197,6 +197,13 @@ describe("describeOnboardingPlugins", () => {
|
||||
});
|
||||
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", () => {
|
||||
@@ -263,6 +270,22 @@ describe("applyOnboardingChoices", () => {
|
||||
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 () => {
|
||||
await chain();
|
||||
const result = await onboarding.applyOnboardingChoices({
|
||||
|
||||
Reference in new issue
Block a user