дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 09:11:10 +02:00
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.
Цей коміт міститься в:
1 джерело
4cfc794f60
коміт
1f6fca0021
2 files changed
+9
-1
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Заблокувати користувача