From 90298fa6cce6ffb4b9b889548f1fec854eb91f46 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Wed, 16 Sep 2026 00:26:48 +0300 Subject: [PATCH] fix: keep tutorial spotlight visible on mobile --- backend/search/review.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/search/review.html b/backend/search/review.html index 882df03..f86c834 100644 --- a/backend/search/review.html +++ b/backend/search/review.html @@ -86,6 +86,7 @@ .review__workspace { grid-template-columns: 1fr; } .review__main { padding-block-end: 14rem; } .review__document { display: none; } + .review__document--tour-visible { display: block; } .review__search button { grid-column: 1 / -1; } .review__actions { padding-inline: 1rem; } .review__actions-inner { flex-wrap: wrap; } @@ -160,8 +161,8 @@ } $('dialog-close').addEventListener('click', () => { $('document-dialog').close(); if (state.selected) state.selected.focus(); }); let tutorialStep = 0; let tutorialReturnFocus = null; - function clearTourTarget() { $('tutorial-spotlight').hidden = true; } - function renderTutorial() { const step = TOUR_STEPS[tutorialStep]; const target = $(step.target); target.scrollIntoView({block: 'nearest', inline: 'nearest'}); const bounds = target.getBoundingClientRect(); $('tutorial-spotlight').style.cssText = `inset-block-start: ${Math.max(8, bounds.top - 4)}px; inset-inline-start: ${Math.max(8, bounds.left - 4)}px; inline-size: ${bounds.width + 8}px; block-size: ${bounds.height + 8}px;`; $('tutorial-spotlight').hidden = false; $('tutorial-heading').textContent = step.title; $('tutorial-text').textContent = step.text; $('tutorial-progress').textContent = step.label; $('tutorial-next').textContent = tutorialStep === TOUR_STEPS.length - 1 ? 'Понятно' : 'Далее'; } + function clearTourTarget() { $('tutorial-spotlight').hidden = true; $('document-panel').classList.remove('review__document--tour-visible'); } + function renderTutorial() { const step = TOUR_STEPS[tutorialStep]; const target = $(step.target); if (step.target === 'document-panel' && getComputedStyle(target).display === 'none') target.classList.add('review__document--tour-visible'); target.scrollIntoView({block: 'nearest', inline: 'nearest'}); const bounds = target.getBoundingClientRect(); $('tutorial-spotlight').style.cssText = `inset-block-start: ${Math.max(8, bounds.top - 4)}px; inset-inline-start: ${Math.max(8, bounds.left - 4)}px; inline-size: ${bounds.width + 8}px; block-size: ${bounds.height + 8}px;`; $('tutorial-spotlight').hidden = false; $('tutorial-heading').textContent = step.title; $('tutorial-text').textContent = step.text; $('tutorial-progress').textContent = step.label; $('tutorial-next').textContent = tutorialStep === TOUR_STEPS.length - 1 ? 'Понятно' : 'Далее'; } function closeTutorial() { clearTourTarget(); $('tutorial-dialog').close(); markTourSeen(); tutorialReturnFocus?.focus(); } function openTutorial() { tutorialReturnFocus = document.activeElement; tutorialStep = 0; renderTutorial(); $('tutorial-dialog').showModal(); $('tutorial-next').focus(); } $('tutorial-open').addEventListener('click', openTutorial); $('tutorial-next').addEventListener('click', () => { if (tutorialStep === TOUR_STEPS.length - 1) closeTutorial(); else { tutorialStep += 1; renderTutorial(); } }); $('tutorial-skip').addEventListener('click', closeTutorial); $('tutorial-dialog').addEventListener('cancel', (event) => { event.preventDefault(); closeTutorial(); });