diff --git a/src/core/menu/islands/Banner.mjs b/src/core/menu/islands/Banner.mjs
index b9ed77a..4726ba0 100644
--- a/src/core/menu/islands/Banner.mjs
+++ b/src/core/menu/islands/Banner.mjs
@@ -185,7 +185,6 @@ function Banner({ updateAvailable, isDevelopmentBuild }) {
$sponsorship.style.display = agreedToTerms === version ? "" : "none";
});
- // todo: show popup if update available
return html``;
diff --git a/src/core/menu/islands/Options.mjs b/src/core/menu/islands/Options.mjs
index 81b89d9..9c1e21c 100644
--- a/src/core/menu/islands/Options.mjs
+++ b/src/core/menu/islands/Options.mjs
@@ -22,14 +22,18 @@ const camelToSentenceCase = (string) =>
// ignore platform-specific options
if (opt.platforms && !opt.platforms.includes(platform)) return options;
// replace consective headings
- const prev = options[options.length - 1];
- if (opt.type === "heading" && prev?.type === opt.type) {
+ opt.autoremove ??= true;
+ const prev = options[options.length - 1],
+ canReplacePrev = prev?.autoremove && prev?.type === opt.type;
+ if (opt.type === "heading" && canReplacePrev) {
options[options.length - 1] = opt;
} else options.push(opt);
return options;
}, []);
// remove trailing heading
- return options.at(-1)?.type === "heading" ? options.slice(0, -1) : options;
+ return options.at(-1)?.type === "heading" && options.at(-1)?.autoremove
+ ? options.slice(0, -1)
+ : options;
};
function Option({ _get, _set, ...opt }) {
diff --git a/src/core/menu/islands/Sidebar.mjs b/src/core/menu/islands/Sidebar.mjs
index e99b1fb..f163db5 100644
--- a/src/core/menu/islands/Sidebar.mjs
+++ b/src/core/menu/islands/Sidebar.mjs
@@ -86,10 +86,12 @@ function Sidebar({ items, categories }) {
for (const { title, mods } of categories) {
const $title = html`<${SidebarHeading}>${title}/>`,
- $mods = mods.map((mod) => [
- mod.id,
- html`<${SidebarButton} id=${mod.id}>${mod.name}/>`,
- ]);
+ $mods = mods
+ .filter((mod) => mod.options?.length)
+ .map((mod) => [
+ mod.id,
+ html`<${SidebarButton} id=${mod.id}>${mod.name}/>`,
+ ]);
$sidebar.append($title, ...$mods.map(([, $btn]) => $btn));
useState(["rerender"], async () => {
diff --git a/src/core/menu/islands/Telemetry.mjs b/src/core/menu/islands/Telemetry.mjs
index 531b603..2af9290 100644
--- a/src/core/menu/islands/Telemetry.mjs
+++ b/src/core/menu/islands/Telemetry.mjs
@@ -33,17 +33,17 @@ function Telemetry() {
}
});
- // todo: actually collect telemetry
return html`<${Option}
type="toggle"
label="Telemetry"
- description=${html`If telemetry is enabled, usage data will be collected
- once a week from your device in order to better understand how and where
- the notion-enhancer is used. This data is anonymous and includes only your
- platform (${$.platform}), notion-enhancer version (${$.version}), timezone
- (${$.timezone}), and enabled mods (${$.enabledMods}). You can opt in or
- out of telemetry at any time. This setting syncs across configuration
- profiles. For more information, read the notion-enhancer's
+ description=${html`If telemetry is enabled, usage data will be collected at
+ a regular interval from your device in order to better understand how and
+ where the notion-enhancer is used. This data is anonymous and includes
+ only your platform (${$.platform}), notion-enhancer version
+ (${$.version}), timezone (${$.timezone}), and enabled mods
+ (${$.enabledMods}). You can opt in or out of telemetry at any time. This
+ setting syncs across configuration profiles. For more information, read
+ the notion-enhancer's
privacy policy.`}
...${{ _get, _set }}
/>`;
diff --git a/src/core/menu/menu.mjs b/src/core/menu/menu.mjs
index 83d748c..8adf814 100644
--- a/src/core/menu/menu.mjs
+++ b/src/core/menu/menu.mjs
@@ -103,7 +103,7 @@ const render = async () => {
}
for (let i = 0; i < mods.length; i++) {
const options = mods[i].options?.filter((opt) => opt.type !== "heading");
- if (mods[i]._src === "core" || !options.length) continue;
+ if (mods[i]._src === "core" || !options?.length) continue;
const _get = () => isEnabled(mods[i].id),
_set = async (enabled) => {
await setEnabled(mods[i].id, enabled);
diff --git a/src/core/mod.json b/src/core/mod.json
index fda9f5c..cccd2dc 100644
--- a/src/core/mod.json
+++ b/src/core/mod.json
@@ -26,12 +26,6 @@
"type": "heading",
"label": "Appearance"
},
- {
- "type": "toggle",
- "key": "toggle",
- "description": "Sets whether the notion-enhancer icon added to Notion's sidebar should be coloured or monochrome. The latter style will match the theme's icon colour for users who would like the icon to be less noticeable.",
- "value": true
- },
{
"type": "select",
"key": "menuButtonIconStyle",
@@ -52,7 +46,8 @@
},
{
"type": "heading",
- "label": "Advanced"
+ "label": "Advanced",
+ "autoremove": false
},
{
"type": "toggle",
@@ -60,24 +55,6 @@
"description": "Activates built-in debugging tools accessible through the application menu.",
"platforms": ["darwin", "win32", "linux"],
"value": false
- },
- {
- "type": "color",
- "key": "color",
- "description": "Activates built-in debugging tools accessible through the application menu.",
- "value": "rgb(232, 69, 93)"
- },
- {
- "type": "text",
- "key": "text",
- "description": "Activates built-in debugging tools accessible through the application menu.",
- "value": ""
- },
- {
- "type": "number",
- "key": "number",
- "description": "Activates built-in debugging tools accessible through the application menu.",
- "value": ""
}
],
"clientStyles": ["variables.css"],
diff --git a/src/themes/classic-dark/mod.json b/src/themes/classic-dark/mod.json
index 4115748..e8a62c6 100644
--- a/src/themes/classic-dark/mod.json
+++ b/src/themes/classic-dark/mod.json
@@ -12,50 +12,5 @@
"avatar": "https://dragonwocky.me/avatar.jpg"
}
],
- "options": [
- {
- "type": "heading",
- "label": "Hotkeys"
- },
- {
- "type": "hotkey",
- "key": "openMenuHotkey",
- "description": "Opens the notion-enhancer menu from within Notion.",
- "value": "Ctrl+Shift+,"
- },
- {
- "type": "heading",
- "label": "Appearance"
- },
- {
- "type": "select",
- "key": "menuButtonIconStyle",
- "description": "Sets whether the notion-enhancer icon added to Notion's sidebar should be coloured or monochrome. The latter style will match the theme's icon colour for users who would like the icon to be less noticeable.",
- "values": ["Colour", "Monochrome"]
- },
- {
- "type": "select",
- "key": "loadThemeOverrides",
- "description": "Loads the styling required for a theme to customise Notion's interface. Disabling this will increase client performance.",
- "values": ["Auto", "Enabled", "Disabled"]
- },
- {
- "type": "file",
- "key": "customStyles",
- "description": "Adds the styles from an uploaded .css file to Notion. Use this if you would like to customise the current theme or otherwise tweak Notion's appearance.",
- "extensions": ["css"]
- },
- {
- "type": "heading",
- "label": "Advanced"
- },
- {
- "type": "toggle",
- "key": "debugMode",
- "description": "Activates built-in debugging tools accessible through the application menu.",
- "platforms": ["darwin", "win32", "linux"],
- "value": false
- }
- ],
"clientStyles": ["client.css"]
}