From 44a5466793e62cdf01ec10de7ba524e30ee75e97 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 23 Jul 2026 21:58:59 -0400 Subject: [PATCH] M9 S5 (frontend): shared BaseModal for the standard modals + BaseInput in Account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BaseModal.vue (new): the backdrop + dialog-panel shell (dimmed fixed overlay, bordered rounded panel, role=dialog, close on Escape + backdrop mousedown). Caller sizes/pads/shadows the panel via `panelClass`, picks start/center `align`, and sets an `ariaLabel` for header-less panels. - LabelsModal, CommandPalette, and the AppShell keyboard-shortcuts overlay drop their hand-rolled backdrop+panel shells and slot their content into BaseModal (~12 lines of overlay boilerplate each → gone). - NoteEditor deliberately keeps its own shell: its backdrop mousedown is drag-guarded and its Esc/⌘-Enter handling is bespoke (unsaved-edit safety), so folding it in would risk regressing the app's core editing surface (rule 28). - AccountView's one device-name field now uses the shared BaseInput. SettingsView is intentionally NOT converted — its rows are a horizontal label+control pattern (checkbox/number/text, direct value mutation), a different shape than BaseInput's vertical form field. Frontend-only; CI vue-tsc is the type/template gate (no local typecheck, rule 10). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm --- frontend/src/components/AppShell.vue | 18 ++++------ frontend/src/components/BaseModal.vue | 41 ++++++++++++++++++++++ frontend/src/components/CommandPalette.vue | 17 ++++----- frontend/src/components/LabelsModal.vue | 17 +++------ frontend/src/views/AccountView.vue | 20 +++++------ 5 files changed, 66 insertions(+), 47 deletions(-) create mode 100644 frontend/src/components/BaseModal.vue diff --git a/frontend/src/components/AppShell.vue b/frontend/src/components/AppShell.vue index 2c02403..fac73a3 100644 --- a/frontend/src/components/AppShell.vue +++ b/frontend/src/components/AppShell.vue @@ -7,6 +7,7 @@ import { useLabelsStore } from "../stores/labels"; import { useSavedFiltersStore, type SavedFilter } from "../stores/savedFilters"; import { useReminderStore } from "../stores/reminders"; import { useUiStore } from "../stores/ui"; +import BaseModal from "./BaseModal.vue"; import CommandPalette from "./CommandPalette.vue"; import Icon from "./Icon.vue"; import ImportNotes from "./ImportNotes.vue"; @@ -382,17 +383,13 @@ async function signOut() { -
- -
+ diff --git a/frontend/src/components/BaseModal.vue b/frontend/src/components/BaseModal.vue new file mode 100644 index 0000000..edf031b --- /dev/null +++ b/frontend/src/components/BaseModal.vue @@ -0,0 +1,41 @@ + + + diff --git a/frontend/src/components/CommandPalette.vue b/frontend/src/components/CommandPalette.vue index a9408b8..707301f 100644 --- a/frontend/src/components/CommandPalette.vue +++ b/frontend/src/components/CommandPalette.vue @@ -4,6 +4,7 @@ import { useRouter } from "vue-router"; import { useSessionStore } from "../stores/session"; import { useTitlesStore } from "../stores/titles"; import { useUiStore } from "../stores/ui"; +import BaseModal from "./BaseModal.vue"; const emit = defineEmits<{ (e: "close"): void }>(); @@ -94,16 +95,11 @@ onMounted(async () => { diff --git a/frontend/src/components/LabelsModal.vue b/frontend/src/components/LabelsModal.vue index 4f96c96..f0a8a4b 100644 --- a/frontend/src/components/LabelsModal.vue +++ b/frontend/src/components/LabelsModal.vue @@ -2,6 +2,7 @@ import { computed, ref } from "vue"; import { useLabelsStore, type Label } from "../stores/labels"; import { NOTE_COLOR_KEYS, NOTE_COLOR_LABELS, NOTE_SWATCH_CLASSES, type NoteColor } from "../notes/colors"; +import BaseModal from "./BaseModal.vue"; import Icon from "./Icon.vue"; const emit = defineEmits<{ (e: "close"): void }>(); @@ -54,17 +55,8 @@ async function doMerge(sourceId: string, targetId: string) { diff --git a/frontend/src/views/AccountView.vue b/frontend/src/views/AccountView.vue index d421dc7..d078b45 100644 --- a/frontend/src/views/AccountView.vue +++ b/frontend/src/views/AccountView.vue @@ -3,6 +3,7 @@ import { onMounted, ref } from "vue"; import { useDevicesStore } from "../stores/devices"; import { useUiStore } from "../stores/ui"; import BaseButton from "../components/BaseButton.vue"; +import BaseInput from "../components/BaseInput.vue"; import Icon from "../components/Icon.vue"; // Per-user (not admin) management of linked native clients — the Tauri desktop and @@ -124,18 +125,13 @@ onMounted(load);
-
- - -
+ Create token