Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 1f6fca0021 fix(plugins): keep a plugin's settings pages in manifest order
A plugin's settings sub-pages registered without an order, so the settings tree sorted them by title. They now keep the order the manifest lists them in. Part of #6745.
2026-11-29 17:28:24 +08:00
2 змінених файлів з 9 додано та 1 видалено

No files matched your search

+6
Переглянути файл
@@ -118,6 +118,12 @@ it("registers searchable child pages and removes all of them on unload", () => {
expect([...useSettingsPages.getState().pages.keys()].some((k) => k.startsWith("plugins.example-helper"))).toBe(false);
});
it("orders child pages as the manifest lists them, not by title", () => {
const pages = useSettingsPages.getState().pages;
const order = (page: string) => pages.get(`plugins.example-helper.settings:${page}`)!.order;
expect(["templates", "llm", "defaults", "server"].map(order)).toEqual([0, 1, 2, 3]);
});
it("stages table edits, keeps changes between pages and discards them on Cancel", () => {
const view = render(<Harness page="llm" />);
expect(screen.getByRole("heading", { name: "Provider" })).toBeInTheDocument();
+3 -1
Переглянути файл
@@ -498,9 +498,11 @@ export function projectSettings(pluginId: string, decl: SettingsDecl): () => voi
keywords: ["plugin", pluginId, ...keywords(decl)],
component: pages.length ? undefined : settingsPage(pluginId, decl),
},
...pages.map((p) => ({
// In the manifest's order, not alphabetically by title.
...pages.map((p, i) => ({
id: `${id}.settings:${p.id}`,
title: p.title,
order: i,
projectScope: true,
keywords: [pluginId, decl.title, ...keywords(p)],
component: settingsPage(pluginId, p),