Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/content/docs/docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This page is a reference for the QuickAdd settings tab, one group at a time. Eac
The choice picker is the list you see when you run **QuickAdd: Run**.

- **Search nested choices** - find a choice even when it lives inside a folder. When on, searching also matches choices nested in folders and shows their path. A nested match can rank above a same-level one. Turn it off to search only the level you have open.
- **"New note from template" in the launcher** - decide where the "create a note from a template" row sits in the picker, so you can make a note from any template without building a dedicated Template choice. *Show at the bottom* (default) keeps your most-used choice in the first slot, *Show at the top* makes the template row first, and *Hide* removes it. The row only appears once you have a [template folder](#templates--properties) configured. The **New note from template** command is always in the command palette, but it needs a configured folder too - without one it shows a notice and opens these settings.
- **"New note from template" in the launcher** - decide where the "create a note from a template" row sits in the picker, so you can make a note from any template without building a dedicated Template choice. *Bottom* (default) keeps your most-used choice in the first slot, *Top* makes the template row first, and *Hidden* removes it. The row only appears once you have a [template folder](#templates--properties) configured. The **New note from template** command is always in the command palette, but it needs a configured folder too - without one it shows a notice and opens these settings.

## Input {#input}

Expand All @@ -34,7 +34,7 @@ The choice picker is the list you see when you run **QuickAdd: Run**.

## Notifications {#notifications}

- **Announce updates** - see what changed when a new version installs, including new features, demo videos, and bug fixes. Choose *Show updates on each new release*, *Show updates only on major releases (new features, breaking changes)*, or *Don't show*.
- **Announce updates** - see what changed when a new version installs, including new features, demo videos, and bug fixes. Choose *Every release*, *Feature releases* (default; new features and breaking changes, not bug-fix-only releases), or *Never*.
- **Show capture notifications** - get a confirmation that a capture landed. When on, QuickAdd shows a notice after content is captured successfully.
- **Show input cancellation notifications** - get a notice when you dismiss a prompt without submitting. Turn it off to avoid the extra notice every time you cancel a prompt.

Expand Down
13 changes: 6 additions & 7 deletions src/gui/components/settingsDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export function createSettingDefinitions(
key: "templateFolderLauncherRow",
defaultValue: "bottom",
options: {
bottom: "Show at the bottom (keeps your top choice first)",
top: "Show at the top",
off: "Hide",
bottom: "Bottom",
top: "Top",
off: "Hidden",
},
},
},
Expand Down Expand Up @@ -153,10 +153,9 @@ export function createSettingDefinitions(
key: "announceUpdates",
defaultValue: "major",
options: {
all: "Show updates on each new release",
major:
"Show updates only on major releases (new features, breaking changes)",
none: "Don't show",
all: "Every release",
major: "Feature releases",
none: "Never",
},
},
},
Expand Down
41 changes: 41 additions & 0 deletions tests/e2e/settings-layout.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { expect, it } from "vitest";
import { createQuickAddE2EHarness } from "./e2eVault";
import { waitForElement } from "./uiHelpers";

const getContext = createQuickAddE2EHarness("settings-layout");

it("leaves every dropdown's label room in an 800px window", async () => {
const { obsidian } = getContext();
const size = await obsidian.dev.evalJson<number[]>(
"require('electron').remote.getCurrentWindow().getSize()",
);
try {
await obsidian.dev.evalJson(
"require('electron').remote.getCurrentWindow().setSize(800, 800); true",
);
await expect.poll(() => obsidian.dev.evalJson<number>("innerWidth")).toBe(800);
await obsidian.dev.evalJson("app.setting.open(); app.setting.openTabById('quickadd'); true");
await waitForElement(obsidian, ".mod-settings .setting-item select");
const rows = await obsidian.dev.evalJson<Record<string, number>>(`(() => Object.fromEntries(
[...document.querySelectorAll('.mod-settings .vertical-tab-content .setting-item')]
.filter((row) => row.querySelector(':scope > .setting-item-control > select'))
.map((row) => [
row.querySelector('.setting-item-name').textContent,
row.querySelector(':scope > .setting-item-info').getBoundingClientRect().width /
row.getBoundingClientRect().width,
]),
))()`);
expect(Object.keys(rows)).toEqual(
expect.arrayContaining(["Announce updates", "“New note from template” in the launcher"]),
);
for (const [name, share] of Object.entries(rows)) {
expect(share, name).toBeGreaterThanOrEqual(0.5);
}
} finally {
await obsidian.dev.evalJson(`(() => {
app.setting.close();
require('electron').remote.getCurrentWindow().setSize(${size[0]}, ${size[1]});
return true;
})()`);
}
});
Loading