fix(settings): reorder deck and scope cards

中文: 调整设置页卡片顺序,将卡片牌组设置放在插件运行范围之前。

English: Reorders settings cards so card deck settings appear before plugin run scope.
This commit is contained in:
Dusk 2026-04-26 10:04:27 +08:00
parent 09738b73ef
commit 2b366bbf1d
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -630,7 +630,9 @@ describe("PluginSettingTab", () => {
expect(queryByDataset(tab.containerEl, "settingsCardBody", "scope").style.display).toBe("none");
expect(queryByDataset(tab.containerEl, "settingsCardBody", "deck").style.display).toBe("none");
for (const cardId of ["card-types", "sync-content", "scope", "deck", "commands"] as const) {
expect(cards.map((card) => card.dataset.settingsCard)).toEqual(["card-types", "sync-content", "deck", "scope", "commands"]);
for (const cardId of ["card-types", "sync-content", "deck", "scope", "commands"] as const) {
expect(queryByDataset(tab.containerEl, "settingsCardToggle", cardId).textContent.startsWith("▸ ")).toBe(true);
}
});
@ -683,7 +685,7 @@ describe("PluginSettingTab", () => {
expect(getStyleProperty(tab.containerEl, "--ahs-settings-page-header-height")).toBe("64px");
expect(getStyleProperty(tab.containerEl, "--ahs-settings-sticky-card-gap")).toBe("8px");
for (const cardId of ["card-types", "sync-content", "scope", "deck", "commands"] as const) {
for (const cardId of ["card-types", "sync-content", "deck", "scope", "commands"] as const) {
const header = queryByDataset(tab.containerEl, "settingsCardToggle", cardId);
expect(header.style.position).toBe("sticky");
expect(header.style.top).toBe("var(--ahs-settings-page-header-height, 64px)");

View file

@ -34,7 +34,7 @@ import { buildFolderTreeSelection, toggleFolderTreeSelection, type FolderTreeSel
const FOLDER_TREE_STATUS_LOADING: UserFacingMessage = { key: "settings.scope.loading" };
const TEXT_SAVE_DEBOUNCE_MS = 500;
const SETTINGS_CARD_ORDER = ["card-types", "sync-content", "scope", "deck", "commands"] as const;
const SETTINGS_CARD_ORDER = ["card-types", "sync-content", "deck", "scope", "commands"] as const;
const VISIBLE_CARD_TYPE_CONFIG_IDS = ["basic", "qa-group", "cloze"] as const;
const SETTINGS_STICKY_CARD_GAP_PX = 8;
const SETTINGS_PAGE_HEADER_FALLBACK_HEIGHT_PX = 64;