keyboard: global shortcuts + ? cheat-sheet
App-shell keydown dispatcher (active only inside the authed shell): - c new note (jump to board / reopen composer via a ui-store signal) - / focus the search box - g b/g/r jump to Board / Graph / Reminders (two-key, 800ms window) - ? open a keyboard-shortcuts cheat-sheet overlay - Esc blur a focused field / close the cheat-sheet Ignored while typing in an input/textarea/contenteditable (except Esc). New stores/ui.ts carries the compose signal; QuickAdd exposes open(); the board reopens the composer on the signal when already on the board. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
@@ -2,14 +2,24 @@
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useNotesStore, type Note, type NoteView } from "../stores/notes";
|
||||
import { useUiStore } from "../stores/ui";
|
||||
import QuickAdd from "../components/QuickAdd.vue";
|
||||
import NoteCard from "../components/NoteCard.vue";
|
||||
import NoteEditor from "../components/NoteEditor.vue";
|
||||
|
||||
const notes = useNotesStore();
|
||||
const route = useRoute();
|
||||
const ui = useUiStore();
|
||||
|
||||
const editing = ref<Note | null>(null);
|
||||
const quickAdd = ref<InstanceType<typeof QuickAdd> | null>(null);
|
||||
|
||||
// The global `c` shortcut bumps composeTick; reopen the composer when we're
|
||||
// already on the board (a fresh navigation autofocuses it via the prop).
|
||||
watch(
|
||||
() => ui.composeTick,
|
||||
() => quickAdd.value?.open(),
|
||||
);
|
||||
|
||||
function viewForRoute(name: unknown): NoteView {
|
||||
if (name === "archive") return "archived";
|
||||
@@ -77,7 +87,7 @@ async function onDrop(target: Note) {
|
||||
|
||||
<template>
|
||||
<div class="mx-auto w-full max-w-6xl px-4 py-6">
|
||||
<QuickAdd v-if="isMainBoard" autofocus class="mb-8" />
|
||||
<QuickAdd v-if="isMainBoard" ref="quickAdd" autofocus class="mb-8" />
|
||||
|
||||
<div v-if="notes.loading" class="py-24 text-center text-sm text-neutral-400">Loading…</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user