From 0fca61eb65a40077d4464e0aadbcd012e8a9d94b Mon Sep 17 00:00:00 2001 From: Wild Karl-Heinz Date: Sat, 24 Oct 2026 00:38:01 +0200 Subject: [PATCH] Add in-app help, formula reference outlines, underline and auto-closing - Help dialog (?, F1, Datei > Hilfe): user topics, all shortcuts and the formula functions with one search over everything. Topics and shortcuts are plain data in data/help.ts; the function list comes from codeReference.ts so new built-ins appear by themselves. - While a formula is edited, the grid outlines each referenced cell/range in the colour of its position in the text, and the outline can be dragged to move or resize the reference, as in Excel. Point-mode picks (click, drag, arrow keys) are outlined too, so keyboard picking is no longer blind. - Underline as a cell format, plus Mod+Shift+B/I/U toggles that switch on unless every selected cell already has the format. - A formula committed with open parentheses or an open text literal gets the missing closers appended; anything that still doesn't parse is left alone so the usual error shows instead of a guess. - Cells and tables with a fill but no text colour get dark or light text by WCAG contrast instead of the theme colour (no black on black). --- README.md | 18 +- app/frontend/components/AppToolbar.vue | 21 + app/frontend/components/FormulaBar.vue | 6 +- app/frontend/components/HelpModal.vue | 410 ++++++++++++++++++ app/frontend/components/SettingsPanel.vue | 5 +- app/frontend/components/TableGrid.vue | 224 +++++++++- app/frontend/data/__tests__/help.spec.ts | 56 +++ app/frontend/data/help.ts | 231 ++++++++++ app/frontend/engine/__tests__/parser.spec.ts | 19 + app/frontend/engine/__tests__/refs.spec.ts | 29 +- app/frontend/engine/index.ts | 3 + app/frontend/engine/parser.ts | 47 ++ app/frontend/engine/refs.ts | 96 ++++ app/frontend/io/json.ts | 1 + app/frontend/store/__tests__/document.spec.ts | 98 +++++ app/frontend/store/__tests__/format.spec.ts | 22 +- app/frontend/store/document.ts | 117 ++++- app/frontend/store/format.ts | 32 ++ app/frontend/store/types.ts | 1 + 19 files changed, 1420 insertions(+), 16 deletions(-) create mode 100644 app/frontend/components/HelpModal.vue create mode 100644 app/frontend/data/__tests__/help.spec.ts create mode 100644 app/frontend/data/help.ts diff --git a/README.md b/README.md index d4dc3bb..f77b0f6 100644 --- a/README.md +++ b/README.md @@ -651,8 +651,22 @@ Inspector unter **Objekt · Auswahl**: horizontale **Ausrichtung** **Prozent** 0/2 Stellen, **Datum**/**Zeit**/**Datum + Zeit** — kombiniert mit der Locale unten — sowie **Datum (ISO)**, das immer `JJJJ-MM-TT` zeigt, unabhängig von der Locale), **Zell-Textfarbe**, -**Zell-Füllfarbe**, **Fett**/**Kursiv**, „Formatierung entfernen". Auch exakte -**Spaltenbreite** und **Zeilenhöhe** der Fokuszelle. +**Zell-Füllfarbe**, **Fett**/**Kursiv**/**Unterstrichen**, „Formatierung +entfernen". Auch exakte **Spaltenbreite** und **Zeilenhöhe** der Fokuszelle. +Per Tastatur: `Strg`/`Cmd`+`Umschalt`+`B` (oder `F`) fett, `+I` kursiv, `+U` +unterstrichen; jeweils ein, wenn noch nicht jede Zelle der Auswahl es hat, +sonst aus. + +### Hilfe (`?`, F1) + +Das `?` in der Symbolleiste, **Datei › Hilfe …** oder `F1` öffnet die +eingebaute Hilfe ([`HelpModal.vue`](app/frontend/components/HelpModal.vue)): +Themen für Benutzer, alle Tastenkürzel und die Formelfunktionen samt +Rechenzeichen, mit einer Suche über alles. Themen und Kürzel stehen in +[`data/help.ts`](app/frontend/data/help.ts) und werden von Hand gepflegt, wer +ein Kürzel oder eine sichtbare Funktion ändert, passt sie dort mit an. Die +Funktionsliste kommt aus `data/codeReference.ts` und ist damit immer +vollständig. ### Einstellungen (⚙, links neben dem Titel) diff --git a/app/frontend/components/AppToolbar.vue b/app/frontend/components/AppToolbar.vue index 8fb473d..ab1e31c 100644 --- a/app/frontend/components/AppToolbar.vue +++ b/app/frontend/components/AppToolbar.vue @@ -4,6 +4,7 @@ import { useDocument } from '../store/document'; import { useTheme } from '../composables/useTheme'; import { useToasts } from '../composables/useToasts'; import BaseModal from './BaseModal.vue'; +import HelpModal from './HelpModal.vue'; import CustomFunctionsModal from './CustomFunctionsModal.vue'; import NamedRangesModal from './NamedRangesModal.vue'; import MacrosModal from './MacrosModal.vue'; @@ -120,6 +121,17 @@ const uploadOpen = ref(false); const loginOpen = ref(false); const loginReason = ref(); const accountMenuOpen = ref(false); +const helpOpen = ref(false); + +// F1 opens the help from anywhere (also out of a cell editor -- the browser's +// own F1 help is what preventDefault keeps away) +function onHelpKey(e: KeyboardEvent) { + if (e.key !== 'F1') return; + e.preventDefault(); + helpOpen.value = true; +} +onMounted(() => window.addEventListener('keydown', onHelpKey)); +onBeforeUnmount(() => window.removeEventListener('keydown', onHelpKey)); function openLogin(reason?: string) { loginReason.value = reason; @@ -470,10 +482,13 @@ async function onSample() {
  • +
  • + + - + + +