feat(editor): skip toolbar in tab order; auto-focus title; type-dependent placeholders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-08 13:25:07 -04:00
parent 87f74b1cd5
commit 317d8f25d0
2 changed files with 14 additions and 1 deletions
@@ -78,6 +78,7 @@ const groups = [
:class="['md-btn', { active: btn.isActive() }]" :class="['md-btn', { active: btn.isActive() }]"
:title="btn.title" :title="btn.title"
type="button" type="button"
tabindex="-1"
@mousedown.prevent="btn.command()" @mousedown.prevent="btn.command()"
> >
<span class="btn-icon" v-html="ICONS[btn.id]" /> <span class="btn-icon" v-html="ICONS[btn.id]" />
+13 -1
View File
@@ -49,6 +49,15 @@ const noteId = computed(() =>
); );
const isEditing = computed(() => noteId.value !== null); const isEditing = computed(() => noteId.value !== null);
const titlePlaceholder = computed(() => {
switch (noteType.value) {
case 'person': return 'Name';
case 'place': return 'Place name';
case 'list': return 'List title';
default: return 'Title';
}
});
const renderedPreview = computed(() => renderMarkdown(body.value)); const renderedPreview = computed(() => renderMarkdown(body.value));
// AI Assist — pass noteId for draft persistence // AI Assist — pass noteId for draft persistence
@@ -243,6 +252,9 @@ onMounted(async () => {
// No draft — normal // No draft — normal
} }
await nextTick();
titleRef.value?.focus();
// Initial link suggestions // Initial link suggestions
fetchLinkSuggestions(); fetchLinkSuggestions();
}); });
@@ -357,7 +369,7 @@ onUnmounted(() => assist.clearSelection());
ref="titleRef" ref="titleRef"
v-model="title" v-model="title"
type="text" type="text"
placeholder="Title" :placeholder="titlePlaceholder"
class="title-input" class="title-input"
@input="markDirty" @input="markDirty"
@keydown.ctrl.s.prevent="save" @keydown.ctrl.s.prevent="save"