documentation added / comments removed

This commit is contained in:
Gamosoft 2026-06-04 14:24:03 +02:00
parent aac6e9feee
commit febf5e27fd
3 changed files with 4 additions and 54 deletions

View File

@ -9,6 +9,7 @@
- **Resume where you left off** - Editor scroll position is remembered per note within the session, so switching back to a long note returns you to the same spot - **Resume where you left off** - Editor scroll position is remembered per note within the session, so switching back to a long note returns you to the same spot
- **Undo/Redo** - Ctrl+Z / Ctrl+Y support - **Undo/Redo** - Ctrl+Z / Ctrl+Y support
- **Note templates** - Create notes from templates with dynamic placeholders - **Note templates** - Create notes from templates with dynamic placeholders
- **Quick-create** - Set the **+ / New** button to skip the type chooser and create your most common item (note, folder, template, or drawing) in one click; **Shift+click** always shows the full chooser. Optionally pre-fill new note titles with a `yyyymmddHHMMSS` timestamp.
- **Syntax highlighting** for code blocks (50+ languages) - **Syntax highlighting** for code blocks (50+ languages)
- **Copy code blocks** - One-click copy button on hover - **Copy code blocks** - One-click copy button on hover
- **LaTeX/Math rendering** - Beautiful mathematical equations with MathJax (see [MATHJAX.md](MATHJAX.md)) - **LaTeX/Math rendering** - Beautiful mathematical equations with MathJax (see [MATHJAX.md](MATHJAX.md))

View File

@ -43,22 +43,13 @@ const LOCAL_SETTINGS = {
hideUnderscoreFolders: { key: 'hideUnderscoreFolders', type: 'boolean', default: false }, hideUnderscoreFolders: { key: 'hideUnderscoreFolders', type: 'boolean', default: false },
tabInsertsTab: { key: 'tabInsertsTab', type: 'boolean', default: false }, tabInsertsTab: { key: 'tabInsertsTab', type: 'boolean', default: false },
sidebarPanelCollapsed: { key: 'sidebarPanelCollapsed', type: 'boolean', default: false }, sidebarPanelCollapsed: { key: 'sidebarPanelCollapsed', type: 'boolean', default: false },
// When true, the New Note name modal opens with a yyyymmddHHMMSS title pre-selected
// (Zettelkasten-style). Press Enter to accept, or type to replace. See issue #217.
autoFillNoteTitle: { key: 'autoFillNoteTitle', type: 'boolean', default: false }, autoFillNoteTitle: { key: 'autoFillNoteTitle', type: 'boolean', default: false },
// String settings // String settings
sortMode: { key: 'sortMode', type: 'string', default: 'a-z' }, sortMode: { key: 'sortMode', type: 'string', default: 'a-z' },
// What clicking + (or the top-level New button) does. 'chooser' preserves the
// current dropdown-with-4-options behaviour; the other values dispatch straight
// to that creation flow. Shift+click always falls back to 'chooser'. See #217.
newButtonAction: { newButtonAction: {
key: 'newButtonAction', type: 'string', default: 'chooser', key: 'newButtonAction', type: 'string', default: 'chooser',
valid: ['chooser', 'note', 'folder', 'template', 'drawing'] valid: ['chooser', 'note', 'folder', 'template', 'drawing']
}, },
// Name of the last template that successfully created a note. Used to pre-select
// it the next time the "Create from Template" modal opens, so the common case of
// "I always use the same template" is one click less. Cleared / ignored silently
// if the template no longer exists.
lastUsedTemplate: { key: 'lastUsedTemplate', type: 'string', default: '' }, lastUsedTemplate: { key: 'lastUsedTemplate', type: 'string', default: '' },
// Number settings with validation // Number settings with validation
sidebarWidth: { key: 'sidebarWidth', type: 'number', default: CONFIG.DEFAULT_SIDEBAR_WIDTH, min: 200, max: 600 }, sidebarWidth: { key: 'sidebarWidth', type: 'number', default: CONFIG.DEFAULT_SIDEBAR_WIDTH, min: 200, max: 600 },
@ -423,9 +414,6 @@ function noteApp() {
availableTemplates: [], availableTemplates: [],
selectedTemplate: '', selectedTemplate: '',
newTemplateNoteName: '', newTemplateNoteName: '',
// Persisted via LOCAL_SETTINGS; hydrated by loadLocalSettings() at app init.
// Inline defaults below mirror the LOCAL_SETTINGS defaults so the reactive
// proxy has the right type/shape before hydration runs. See issue #217.
newButtonAction: 'chooser', newButtonAction: 'chooser',
autoFillNoteTitle: false, autoFillNoteTitle: false,
lastUsedTemplate: '', lastUsedTemplate: '',
@ -1763,8 +1751,6 @@ function noteApp() {
const data = await response.json(); const data = await response.json();
// Remember for pre-selection next time openTemplateModal() runs (see #217).
// Captured BEFORE the reset below so the name is still available.
this.lastUsedTemplate = this.selectedTemplate; this.lastUsedTemplate = this.selectedTemplate;
try { localStorage.setItem('lastUsedTemplate', this.selectedTemplate); } catch (_) {} try { localStorage.setItem('lastUsedTemplate', this.selectedTemplate); } catch (_) {}
@ -4596,18 +4582,7 @@ function noteApp() {
// DROPDOWN MENU SYSTEM // DROPDOWN MENU SYSTEM
// ===================================================== // =====================================================
// Entry point for every "+" button and the top-level "New" button. Either opens // Shift+click always forces the chooser regardless of newButtonAction.
// the type-chooser dropdown (default behaviour) or dispatches straight to a
// single creation flow, depending on the user's `newButtonAction` setting.
//
// Shift+click ALWAYS forces the chooser regardless of configured default — a
// single discoverable escape hatch (mentioned in the settings description) that
// saves users from needing to open Settings just to reach the other modes once
// in a while. See issue #217.
//
// Folder context (dropdownTargetFolder) is set by the calling site BEFORE this
// method runs; each dispatched action reads it via inferredNewItemTargetFolder()
// and clears the dropdown state itself, so we don't call closeDropdown() here.
toggleNewDropdown(event) { toggleNewDropdown(event) {
const wantsChooser = const wantsChooser =
(event && event.shiftKey) || (event && event.shiftKey) ||
@ -4628,9 +4603,6 @@ function noteApp() {
} }
}, },
// Open the type-chooser dropdown anchored next to the clicking element. Extracted
// verbatim from the original toggleNewDropdown body so existing positioning logic
// is preserved bit-for-bit; the new routing layer above is a thin wrapper.
_openNewDropdownChooser(event) { _openNewDropdownChooser(event) {
this.showNewDropdown = true; this.showNewDropdown = true;
@ -4652,14 +4624,6 @@ function noteApp() {
} }
}, },
// Open "Create from Template" modal. Shared by:
// - the type-chooser dropdown's "from template" button
// - the quick-dispatch path from toggleNewDropdown()
// so both paths consistently pre-select the last-used template (if it still
// exists) AND pre-fill the name when autoFillNoteTitle is on, matching the
// plain New Note popup behaviour. dropdownTargetFolder is intentionally NOT
// cleared — it's read at submit time by createNoteFromTemplate() via
// inferredNewItemTargetFolder(). See issue #217.
openTemplateModal() { openTemplateModal() {
this.showNewDropdown = false; this.showNewDropdown = false;
this.mobileSidebarOpen = false; this.mobileSidebarOpen = false;
@ -4668,10 +4632,7 @@ function noteApp() {
this.selectedTemplate = hasLastUsed ? this.lastUsedTemplate : ''; this.selectedTemplate = hasLastUsed ? this.lastUsedTemplate : '';
this.newTemplateNoteName = this.autoFillNoteTitle ? this._autoTitleTimestamp() : ''; this.newTemplateNoteName = this.autoFillNoteTitle ? this._autoTitleTimestamp() : '';
this.showTemplateModal = true; this.showTemplateModal = true;
// If a template was pre-selected the modal can be submitted with Enter // Only steal focus when the modal is one-Enter-away from submission.
// alone, so focus the name input and select its contents (so typing
// immediately replaces). When no template is pre-selected the user has
// to pick one first, so we don't steal focus from the dropdown.
if (hasLastUsed) { if (hasLastUsed) {
this.$nextTick(() => { this.$nextTick(() => {
const el = document.getElementById('template-note-name-input'); const el = document.getElementById('template-note-name-input');
@ -4743,10 +4704,6 @@ function noteApp() {
this.mobileSidebarOpen = false; this.mobileSidebarOpen = false;
this.createNameModalKind = kind; this.createNameModalKind = kind;
this.createNameModalTargetFolder = targetFolder; this.createNameModalTargetFolder = targetFolder;
// Auto-fill title with a yyyymmddHHMMSS timestamp when the user opted in
// (notes only; doesn't make sense for folders). The input gets .select()'d
// below, so typing anything immediately replaces it — Enter accepts it as
// a Zettelkasten-style filename. See issue #217.
this.createNameModalInput = this.createNameModalInput =
(kind === 'note' && this.autoFillNoteTitle) ? this._autoTitleTimestamp() : ''; (kind === 'note' && this.autoFillNoteTitle) ? this._autoTitleTimestamp() : '';
this.showCreateNameModal = true; this.showCreateNameModal = true;
@ -4759,9 +4716,7 @@ function noteApp() {
}); });
}, },
// Zettelkasten convention: yyyymmddHHMMSS — compact, sorts chronologically, // Zettelkasten-style yyyymmddHHMMSS in local time.
// and contains no characters that need escaping on any filesystem. Local
// time deliberately (matches what users see on the clock).
_autoTitleTimestamp() { _autoTitleTimestamp() {
const d = new Date(); const d = new Date();
const pad = (n) => String(n).padStart(2, '0'); const pad = (n) => String(n).padStart(2, '0');

View File

@ -2228,9 +2228,6 @@
<p class="text-xs mt-1" style="color: var(--text-tertiary);" x-text="t('settings.tab_inserts_tab_desc')"></p> <p class="text-xs mt-1" style="color: var(--text-tertiary);" x-text="t('settings.tab_inserts_tab_desc')"></p>
</div> </div>
<!-- + / New button action (issue #217). Lets the user skip the
type-chooser dropdown when they almost always create the same
kind of thing. Persisted in LOCAL_SETTINGS.newButtonAction. -->
<div class="mb-4"> <div class="mb-4">
<label class="block text-xs font-medium mb-2" style="color: var(--text-secondary);" x-text="t('settings.new_button_action')"></label> <label class="block text-xs font-medium mb-2" style="color: var(--text-secondary);" x-text="t('settings.new_button_action')"></label>
<select <select
@ -2248,9 +2245,6 @@
<p class="text-xs mt-1" style="color: var(--text-tertiary);" x-text="t('settings.new_button_action_desc')"></p> <p class="text-xs mt-1" style="color: var(--text-tertiary);" x-text="t('settings.new_button_action_desc')"></p>
</div> </div>
<!-- Auto-fill new-note title with timestamp (issue #217). Only
applies to plain-note creation (folder/template have their
own naming flows). Persisted as autoFillNoteTitle. -->
<div class="mb-4"> <div class="mb-4">
<label class="flex items-center justify-between gap-3 cursor-pointer"> <label class="flex items-center justify-between gap-3 cursor-pointer">
<span class="text-xs font-medium flex-1 min-w-0" style="color: var(--text-secondary);" x-text="t('settings.auto_fill_note_title')"></span> <span class="text-xs font-medium flex-1 min-w-0" style="color: var(--text-secondary);" x-text="t('settings.auto_fill_note_title')"></span>