einrichtungs-tour beim erststart
- Beim ersten Start (keine Einstellungen) öffnet sich die Einrichtung mit geführter Tour: Willkommen → Projektordner → mehrere einlesen → Backup-Ziel (optional) → automatisch sichern → Sprache → Funktionen → Speichern. Wechselt die Reiter selbst, eigenes Tempo (kein Auto-Play). - Auch über Hilfe & Überblick → "Einrichten" → "Diesen Bereich zeigen". - Tour-Overlay klick-durchlässig (man kann währenddessen tippen/klicken), Pfeiltasten ignoriert beim Tippen, nur sichtbare Ziele, endet beim Speichern/Schließen der Einstellungen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -264,7 +264,11 @@ async function load() {
|
||||
// last-change dates are still being collected in the background → refresh once more
|
||||
clearTimeout(load.again)
|
||||
if (data.activityPending > 0) load.again = setTimeout(load, 2500)
|
||||
if (data.setupNeeded) openSettings(true) // first start: choose the projects folder
|
||||
// first start: choose the projects folder – with the guided setup tour (once per session)
|
||||
if (data.setupNeeded) {
|
||||
const opening = openSettings(true)
|
||||
if (!load.setupToured) { load.setupToured = true; Promise.resolve(opening).then(() => setTimeout(() => startTour('setup'), 400)) }
|
||||
}
|
||||
// projects found in subfolders that were never looked at: one hint per session
|
||||
if (data.nestedHint > 0 && !load.nestedHinted && !data.setupNeeded) {
|
||||
load.nestedHinted = true
|
||||
@@ -659,6 +663,7 @@ function closeSettings() {
|
||||
panel.classList.remove('open')
|
||||
panel.setAttribute('aria-hidden', 'true')
|
||||
if (!editing && !document.getElementById('bpanel').classList.contains('open')) document.getElementById('overlay').classList.remove('open')
|
||||
if (tour?.def === TOURS.setup) endTour() // saved / closed: the setup tour is done
|
||||
}
|
||||
|
||||
async function saveSettings() {
|
||||
@@ -1008,6 +1013,7 @@ const HELP_PAGES = [
|
||||
{ id: 'project', t: 'help.g.project', rows: [['pencil', 'help.edit'], ['info', 'help.info'], ['play', 'help.actions'], ['folder-open', 'help.quick']] },
|
||||
{ id: 'backup', t: 'help.g.backup', rows: [['hard-drive-upload', 'help.backup'], ['clock-alert', 'help.due']] },
|
||||
{ id: 'misc', t: 'help.g.misc', rows: [['folders', 'help.folders'], ['languages', 'help.lang'], ['keyboard', 'help.keys']] },
|
||||
{ id: 'setup', t: 'help.g.setup', rows: [['folders', 'tour.setup.folders'], ['hard-drive-upload', 'tour.setup.backup'], ['sliders-horizontal', 'tour.setup.general']] },
|
||||
]
|
||||
let helpPage = 0
|
||||
function renderHelp() {
|
||||
@@ -1065,19 +1071,36 @@ const TOURS = {
|
||||
{ sel: '#btnSettings', key: 'help.lang' },
|
||||
{ sel: '#btnHelp', key: 'help.keys' },
|
||||
] },
|
||||
// first start (and Help → Setup): walks through the settings panel; manual pace, user types meanwhile
|
||||
setup: { auto: false, keepView: true, before: () => (document.getElementById('spanel').classList.contains('open') ? null : openSettings(false)), steps: [
|
||||
{ key: 'tour.setup.welcome' },
|
||||
{ before: () => setSettingsTab('folders'), wait: 150, sel: '#fRoots', key: 'tour.setup.folders' },
|
||||
{ sel: '#fImportOpen', key: 'tour.setup.import' },
|
||||
{ before: () => setSettingsTab('backup'), wait: 150, sel: '#fTargets:not(:empty), #fAddTarget', key: 'tour.setup.backup' },
|
||||
{ sel: '#fAutoInt', key: 'tour.setup.auto' },
|
||||
{ before: () => setSettingsTab('general'), wait: 150, sel: '#fLang', key: 'tour.setup.general' },
|
||||
{ sel: '.featrow:has(#fFeatItch)', key: 'tour.setup.features' },
|
||||
{ before: () => setSettingsTab('folders'), wait: 150, sel: '#spSave', key: 'tour.setup.save' },
|
||||
] },
|
||||
}
|
||||
const AUTO_MS = 3400
|
||||
let tour = null
|
||||
function startTour(id) {
|
||||
async function startTour(id) {
|
||||
const def = TOURS[id]
|
||||
if (!def) return
|
||||
document.getElementById('helpDlg').close()
|
||||
tour = { def, steps: def.steps, i: -1, playing: true, timer: null, prevView: activeView, prevMode: uiMode, openedEditor: false }
|
||||
try { def.before?.() } catch {}
|
||||
tour = { def, steps: def.steps, i: -1, playing: def.auto !== false, timer: null, prevView: activeView, prevMode: uiMode, openedEditor: false }
|
||||
try { await def.before?.() } catch {}
|
||||
if (!tour) return
|
||||
document.getElementById('tour').hidden = false
|
||||
setTimeout(() => tourGo(1), 320) // let a view/mode switch render first
|
||||
setTimeout(() => tourGo(1), 320) // let a view/mode switch (or the panel sliding in) render first
|
||||
}
|
||||
// only elements that are actually on screen (hidden sections are skipped)
|
||||
const tourTarget = (s) => {
|
||||
if (!s.sel) return null
|
||||
const el = document.querySelector(s.sel)
|
||||
return el && el.getClientRects().length ? el : null
|
||||
}
|
||||
const tourTarget = (s) => (s.sel ? document.querySelector(s.sel) : null)
|
||||
async function tourGo(dir) {
|
||||
if (!tour) return
|
||||
clearTimeout(tour.timer)
|
||||
@@ -1134,10 +1157,11 @@ function positionSpot(el) {
|
||||
function endTour() {
|
||||
if (!tour) return
|
||||
clearTimeout(tour.timer)
|
||||
const opened = tour.openedEditor, pv = tour.prevView, pm = tour.prevMode
|
||||
const opened = tour.openedEditor, pv = tour.prevView, pm = tour.prevMode, keep = tour.def.keepView
|
||||
tour = null
|
||||
document.getElementById('tour').hidden = true
|
||||
if (opened) try { closeEditor() } catch {}
|
||||
if (keep) return
|
||||
try { applyUiMode(pm) } catch {}
|
||||
try { setView(pv) } catch {}
|
||||
}
|
||||
@@ -1152,6 +1176,7 @@ document.getElementById('tourPause').onclick = () => {
|
||||
addEventListener('resize', () => { if (tour) tourShow() })
|
||||
addEventListener('keydown', (e) => {
|
||||
if (!tour) return
|
||||
if (e.target.closest?.('input, textarea, select, [contenteditable]')) return // typing a path etc.
|
||||
if (e.key === 'Escape') { e.preventDefault(); endTour() }
|
||||
else if (e.key === 'ArrowRight') tourGo(1)
|
||||
else if (e.key === 'ArrowLeft') tourGo(-1)
|
||||
|
||||
Reference in New Issue
Block a user