diff --git a/README.md b/README.md
index da6fbfe..e3defc9 100644
--- a/README.md
+++ b/README.md
@@ -196,13 +196,13 @@ src/
│ ├── admin/ PostsTab, AdvertisingCreate/EditModal, CampaignCreate/EditModal, ...
│ ├── landing/ Hero, Navbar, StepsSection, RadarBeacon, FinalCta, Footer, Icon
│ ├── icons/ NavIcons + Calendar/Close/Globe/Menu/Moon/Phone/Pin/Sun/Trash
-│ └── … AuthModal, Toast, MapView, PostDetailModal, AdCard, AdSlot, ...
+│ └── … AuthModal, Toast, MapView, PostDetailModal, GuideModal, GuestGuideBanner, AdCard, AdSlot, ...
│
├── styles/
│ ├── index.css # Точка входа CSS
│ ├── base.css # Переменные, сброс, keyframes
│ ├── layout.css, sidebar.css, card.css, modal.css, ui.css
-│ ├── chat.css, desktop.css
+│ ├── chat.css, desktop.css, guide.css
│ └── reviews.css, rules.css, admin.css, NakhodkaLanding.css
│
└── locales/
@@ -715,6 +715,14 @@ CSS-переменные в `base.css`:
загрузку → `PUT` прямо в MinIO с процентом → подтверждение → в ленте заглушка
«обрабатывается», через несколько секунд по сокету приходит готовый плеер.
+**Первый визит.** Гость открывает ленту → через секунду появляется подсказка
+«Ты здесь впервые?» (`GuestGuideBanner`: на телефоне сверху, смахивается вверх; на
+десктопе справа внизу, закрывается крестиком) → «Как пользоваться» открывает
+`GuideModal` — шесть шагов (лента и карта, объявление, чат, номер, «вернулось») и правила безопасности. Закрытая или открытая подсказка
+больше не показывается (`localStorage`, ключ `nakhodka:guideBannerDismissed`).
+Инструкция всегда доступна из меню: пункт «Инструкция» в мобильном меню и в
+десктопной навигации.
+
**Показ номера.** «Показать номер» → `GET …/phone/challenge` → браузер решает задачу
(доли секунды) → `POST …/phone` → номер-ссылка `tel:`.
diff --git a/src/components/GuestGuide.test.jsx b/src/components/GuestGuide.test.jsx
new file mode 100644
index 0000000..1964812
--- /dev/null
+++ b/src/components/GuestGuide.test.jsx
@@ -0,0 +1,118 @@
+/**
+ * Подсказка гостю «Ты здесь впервые?» и инструкция: появление с задержкой,
+ * закрытие крестиком и смахиванием вверх, запоминание, открытие инструкции.
+ */
+import { render, screen, fireEvent, act } from "@testing-library/react";
+import "@testing-library/jest-dom";
+import "../i18n";
+import i18n from "../i18n";
+import GuestGuideBanner, { GUIDE_BANNER_KEY } from "./GuestGuideBanner";
+import GuideModal from "./GuideModal";
+
+beforeAll(() => i18n.changeLanguage("ru"));
+
+beforeEach(() => {
+ localStorage.clear();
+ jest.useFakeTimers();
+});
+
+afterEach(() => {
+ jest.useRealTimers();
+});
+
+function showBanner(props = {}) {
+ render();
+ act(() => {
+ jest.advanceTimersByTime(1500);
+ });
+}
+
+test("подсказка появляется не сразу, а через секунду", () => {
+ render();
+ expect(screen.queryByText("Ты здесь впервые?")).toBeNull();
+
+ act(() => {
+ jest.advanceTimersByTime(1500);
+ });
+ expect(screen.getByText("Ты здесь впервые?")).toBeInTheDocument();
+ expect(screen.getByText(/Посмотри, как пользоваться приложением/)).toBeInTheDocument();
+});
+
+test("крестик закрывает подсказку навсегда", () => {
+ showBanner();
+
+ fireEvent.click(screen.getByLabelText("Скрыть подсказку"));
+ act(() => {
+ jest.advanceTimersByTime(300);
+ });
+
+ expect(screen.queryByText("Ты здесь впервые?")).toBeNull();
+ expect(localStorage.getItem(GUIDE_BANNER_KEY)).toBe("1");
+});
+
+test("закрытая подсказка больше не показывается", () => {
+ localStorage.setItem(GUIDE_BANNER_KEY, "1");
+ showBanner();
+
+ expect(screen.queryByText("Ты здесь впервые?")).toBeNull();
+});
+
+test("смахивание вверх закрывает, короткое движение — нет", () => {
+ showBanner();
+ const banner = screen.getByRole("status");
+
+ // Чуть-чуть потянули — карточка возвращается на место
+ fireEvent.touchStart(banner, { touches: [{ clientY: 100 }] });
+ fireEvent.touchMove(banner, { touches: [{ clientY: 85 }] });
+ fireEvent.touchEnd(banner);
+ expect(localStorage.getItem(GUIDE_BANNER_KEY)).toBeNull();
+ expect(screen.getByText("Ты здесь впервые?")).toBeInTheDocument();
+
+ // Смахнули вверх — закрылась и запомнилась
+ fireEvent.touchStart(banner, { touches: [{ clientY: 100 }] });
+ fireEvent.touchMove(banner, { touches: [{ clientY: 30 }] });
+ fireEvent.touchEnd(banner);
+ act(() => {
+ jest.advanceTimersByTime(300);
+ });
+ expect(screen.queryByText("Ты здесь впервые?")).toBeNull();
+ expect(localStorage.getItem(GUIDE_BANNER_KEY)).toBe("1");
+});
+
+test("кнопка открывает инструкцию и убирает подсказку", () => {
+ const onOpenGuide = jest.fn();
+ showBanner({ onOpenGuide });
+
+ fireEvent.click(screen.getByRole("button", { name: "Как пользоваться" }));
+
+ expect(onOpenGuide).toHaveBeenCalledTimes(1);
+ expect(screen.queryByText("Ты здесь впервые?")).toBeNull();
+ expect(localStorage.getItem(GUIDE_BANNER_KEY)).toBe("1");
+});
+
+test("инструкция: шаги, безопасность и вход для гостя", () => {
+ const onClose = jest.fn();
+ const onLoginClick = jest.fn();
+ render();
+
+ expect(screen.getByRole("dialog", { name: "Как пользоваться Находкой" })).toBeInTheDocument();
+ // 6 шагов + 4 совета по безопасности
+ expect(screen.getAllByRole("listitem")).toHaveLength(6 + 4);
+ expect(screen.getByText("Ищи в ленте или на карте")).toBeInTheDocument();
+ expect(screen.getByText("Смотри на карте")).toBeInTheDocument();
+ expect(screen.getByText("Пиши автору")).toBeInTheDocument();
+ expect(screen.getByText("Будь осторожен", { exact: false })).toBeInTheDocument();
+
+ fireEvent.click(screen.getByRole("button", { name: "Войти или зарегистрироваться" }));
+ expect(onLoginClick).toHaveBeenCalledTimes(1);
+
+ fireEvent.keyDown(window, { key: "Escape" });
+ expect(onClose).toHaveBeenCalledTimes(1);
+});
+
+test("инструкция для вошедшего — без кнопки входа", () => {
+ render();
+
+ expect(screen.queryByRole("button", { name: "Войти или зарегистрироваться" })).toBeNull();
+ expect(screen.getByRole("button", { name: "Понятно" })).toBeInTheDocument();
+});
diff --git a/src/components/GuestGuideBanner.jsx b/src/components/GuestGuideBanner.jsx
new file mode 100644
index 0000000..fbfc4b4
--- /dev/null
+++ b/src/components/GuestGuideBanner.jsx
@@ -0,0 +1,124 @@
+import { useCallback, useEffect, useRef, useState } from "react";
+import { useTranslation } from "react-i18next";
+import CloseIcon from "./icons/CloseIcon";
+import "../styles/guide.css";
+
+export const GUIDE_BANNER_KEY = "nakhodka:guideBannerDismissed";
+/** Подсказка появляется не сразу: сначала человек видит ленту. */
+const SHOW_DELAY_MS = 1200;
+/** Насколько смахнуть вверх, чтобы карточка закрылась, px. */
+const SWIPE_DISMISS_PX = 40;
+const LEAVE_ANIMATION_MS = 250;
+
+export function isGuideBannerDismissed() {
+ try {
+ return localStorage.getItem(GUIDE_BANNER_KEY) === "1";
+ } catch {
+ return false; // приватный режим — просто покажем ещё раз
+ }
+}
+
+function rememberDismissed() {
+ try {
+ localStorage.setItem(GUIDE_BANNER_KEY, "1");
+ } catch {
+ // нет хранилища — подсказка вернётся при следующем визите, это не страшно
+ }
+}
+
+/**
+ * Ненавязчивая подсказка для гостя в ленте: «Ты здесь впервые?» с кнопкой
+ * инструкции. На телефоне смахивается вверх, на десктопе закрывается крестиком
+ * (крестик есть и на телефоне — смахивание доступно не всем). Закрытая или
+ * открытая один раз подсказка больше не показывается.
+ *
+ * @param {{ onOpenGuide: () => void }} props
+ */
+export default function GuestGuideBanner({ onOpenGuide }) {
+ const { t } = useTranslation();
+ const [visible, setVisible] = useState(false);
+ const [leaving, setLeaving] = useState(false);
+ const [drag, setDrag] = useState(0);
+ const [dragging, setDragging] = useState(false);
+ const startYRef = useRef(null);
+ const leaveTimerRef = useRef(null);
+
+ useEffect(() => {
+ if (isGuideBannerDismissed()) return undefined;
+ const timer = setTimeout(() => setVisible(true), SHOW_DELAY_MS);
+ return () => clearTimeout(timer);
+ }, []);
+
+ useEffect(() => () => clearTimeout(leaveTimerRef.current), []);
+
+ const dismiss = useCallback(() => {
+ rememberDismissed();
+ setLeaving(true);
+ leaveTimerRef.current = setTimeout(() => setVisible(false), LEAVE_ANIMATION_MS);
+ }, []);
+
+ const openGuide = () => {
+ rememberDismissed();
+ setVisible(false);
+ onOpenGuide();
+ };
+
+ const onTouchStart = (e) => {
+ startYRef.current = e.touches[0].clientY;
+ setDragging(true);
+ };
+
+ const onTouchMove = (e) => {
+ if (startYRef.current == null) return;
+ const dy = e.touches[0].clientY - startYRef.current;
+ // Вверх — тянется за пальцем, вниз — едва поддаётся (как у системных уведомлений)
+ setDrag(dy < 0 ? dy : dy / 6);
+ };
+
+ const onTouchEnd = () => {
+ const shouldDismiss = drag < -SWIPE_DISMISS_PX;
+ startYRef.current = null;
+ setDragging(false);
+ if (shouldDismiss) {
+ dismiss();
+ } else {
+ setDrag(0);
+ }
+ };
+
+ if (!visible) return null;
+
+ const className = [
+ "guest-banner",
+ dragging ? "is-dragging" : "is-settling",
+ leaving ? "is-leaving" : "",
+ ].join(" ");
+
+ return (
+
+
+ 👋
+
+
+
{t("guide.bannerTitle")}
+
{t("guide.bannerText")}
+
+
+
+
+
+ );
+}
diff --git a/src/components/GuideModal.jsx b/src/components/GuideModal.jsx
new file mode 100644
index 0000000..23c7351
--- /dev/null
+++ b/src/components/GuideModal.jsx
@@ -0,0 +1,86 @@
+import { useEffect } from "react";
+import { useTranslation } from "react-i18next";
+import CloseIcon from "./icons/CloseIcon";
+import "../styles/guide.css";
+
+const STEPS = [
+ { key: "search", icon: "🔎" },
+ { key: "map", icon: "🗺️" },
+ { key: "create", icon: "📝" },
+ { key: "chat", icon: "💬" },
+ { key: "phone", icon: "📞" },
+ { key: "done", icon: "✅" },
+];
+
+const SAFETY = ["safety1", "safety2", "safety3", "safety4"];
+
+/**
+ * Короткая инструкция для обычного пользователя: шесть шагов и правила
+ * безопасности. Открывается из приветственной подсказки в ленте и из меню.
+ * onLoginClick — для гостя: кнопка «Войти или зарегистрироваться».
+ *
+ * @param {{ onClose: () => void, onLoginClick?: () => void }} props
+ */
+export default function GuideModal({ onClose, onLoginClick }) {
+ const { t } = useTranslation();
+
+ useEffect(() => {
+ const prev = document.body.style.overflow;
+ document.body.style.overflow = "hidden";
+ const onKey = (e) => {
+ if (e.key === "Escape") onClose();
+ };
+ window.addEventListener("keydown", onKey);
+ return () => {
+ document.body.style.overflow = prev;
+ window.removeEventListener("keydown", onKey);
+ };
+ }, [onClose]);
+
+ return (
+ e.target === e.currentTarget && onClose()}>
+
+
+ {t("guide.title")}
+
+
+
+
{t("guide.intro")}
+
+
+ {STEPS.map(({ key, icon }, i) => (
+ -
+ {icon}
+
+
+ {i + 1}. {t(`guide.${key}Title`)}
+
+
{t(`guide.${key}Text`)}
+
+
+ ))}
+
+
+
+ ⚠️ {t("guide.safetyTitle")}
+
+ {SAFETY.map((key) => - {t(`guide.${key}`)}
)}
+
+
+
+
+ {onLoginClick && (
+
+ )}
+
+
+
+
+ );
+}
diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx
index 926d5d8..1373576 100644
--- a/src/components/Sidebar.jsx
+++ b/src/components/Sidebar.jsx
@@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next';
import { useAuthContext } from "../context/AuthContext";
import { useIsDesktop } from "../hooks/useIsDesktop";
import SupportModal from "./SupportModal";
+import GuideModal from "./GuideModal";
import UploadAdModal from "./UploadAdModal";
import ProfileAvatar from "./profile/ProfileAvatar";
import NahodkaLogo from "./MainNahodkaLogo";
@@ -50,7 +51,9 @@ export default function Sidebar({
const { language, toggleLanguage } = useLanguageToggle();
const [supportOpen, setSupportOpen] = useState(false);
const [uploadAdOpen, setUploadAdOpen] = useState(false);
+ const [guideOpen, setGuideOpen] = useState(false);
const HelpIcon = NavIcons.help;
+ const BookIcon = NavIcons.book;
// Десктоп (>= 900px) — отдельная навигация с картой, CTA и свёрткой в рейку.
// Мобильный drawer ниже остаётся без изменений.
@@ -210,6 +213,16 @@ export default function Sidebar({
);
})}
+
@@ -246,6 +259,15 @@ export default function Sidebar({
{supportOpen && setSupportOpen(false)} />}
{uploadAdOpen && setUploadAdOpen(false)} />}
+ {guideOpen && (
+ setGuideOpen(false)}
+ onLoginClick={isAuthenticated ? undefined : () => {
+ setGuideOpen(false);
+ onLoginClick();
+ }}
+ />
+ )}
>
);
}
diff --git a/src/components/desktop/DesktopSidebar.jsx b/src/components/desktop/DesktopSidebar.jsx
index 2f59832..02b111d 100644
--- a/src/components/desktop/DesktopSidebar.jsx
+++ b/src/components/desktop/DesktopSidebar.jsx
@@ -8,6 +8,7 @@ import GlobeIcon from "../icons/GlobeIcon";
import NahodkaLogo from "../MainNahodkaLogo";
import ProfileAvatar from "../profile/ProfileAvatar";
import SupportModal from "../SupportModal";
+import GuideModal from "../GuideModal";
import UploadAdModal from "../UploadAdModal";
import { useTheme } from "../../context/ThemeContext";
import { useUnread } from "../../context/UnreadContext";
@@ -59,6 +60,7 @@ export default function DesktopSidebar({
const { language, toggleLanguage } = useLanguageToggle();
const [supportOpen, setSupportOpen] = useState(false);
const [uploadAdOpen, setUploadAdOpen] = useState(false);
+ const [guideOpen, setGuideOpen] = useState(false);
const profileName = `${profileData?.firstName || ""} ${profileData?.lastName || ""}`.trim();
@@ -180,6 +182,15 @@ export default function DesktopSidebar({
{NavIcons.star()}
{t("nav.reviews")}
+