From 72d426ef74caed50f9d37aafb747e62e3cf16fec Mon Sep 17 00:00:00 2001 From: "v.lagerev" Date: Sat, 9 May 2026 15:09:24 +0300 Subject: [PATCH] =?UTF-8?q?feat(channels):=20drop=20NEW=20badge=20from=20?= =?UTF-8?q?=D0=9A=D0=B0=D0=BD=D0=B0=D0=BB=D1=8B=20segment=20per=20product?= =?UTF-8?q?=20call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en.json | 1 - public/locales/ru.json | 1 - .../client/direct/DirectStreamHeader.tsx | 65 ++----------------- 3 files changed, 4 insertions(+), 63 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index ced63d15..6eae0d87 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -394,7 +394,6 @@ "explore_cta": "Find a community", "pick_channel_title": "Pick a channel", "pick_channel_desc": "Choose a channel from the list on the left to start reading.", - "badge_new": "New", "root_category": "Channels" }, "Call": { diff --git a/public/locales/ru.json b/public/locales/ru.json index d46b754d..5c40fa2a 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -396,7 +396,6 @@ "explore_cta": "Найти сообщество", "pick_channel_title": "Выберите канал", "pick_channel_desc": "Откройте канал из списка слева, чтобы начать читать.", - "badge_new": "Новое", "root_category": "Каналы" }, "Call": { diff --git a/src/app/pages/client/direct/DirectStreamHeader.tsx b/src/app/pages/client/direct/DirectStreamHeader.tsx index 4be938d5..d1c9c086 100644 --- a/src/app/pages/client/direct/DirectStreamHeader.tsx +++ b/src/app/pages/client/direct/DirectStreamHeader.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect, useState } from 'react'; +import React, { forwardRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useMatch, useNavigate } from 'react-router-dom'; import { Box, color, toRem } from 'folds'; @@ -7,17 +7,14 @@ import { BOTS_PATH, CHANNELS_PATH, DIRECT_PATH } from '../../paths'; import { isNativePlatform } from '../../../utils/capacitor'; import { useBotPresets } from '../../../features/bots/catalog'; -const CHANNELS_TOOLTIP_SEEN_KEY = 'vojo.channelsTooltipSeen'; - type SegmentProps = { active: boolean; disabled?: boolean; label: string; - badge?: string; onClick?: () => void; }; const Segment = forwardRef( - ({ active, disabled, label, badge, onClick }, ref) => ( + ({ active, disabled, label, onClick }, ref) => ( ) ); @@ -74,41 +51,8 @@ export function DirectStreamHeader() { const channelsMatch = useMatch({ path: CHANNELS_PATH, caseSensitive: true, end: false }); const showBotsSegment = bots.length > 0 || !!botsMatch; - // Migration "NEW" badge — one-shot promo for the new Channels surface. - // Replaces the old "Coming soon" disabled state. Hidden once the user has - // visited /channels/* or already saw it in a prior session (persisted in - // localStorage). Visible default until first interaction. - const [showBadge, setShowBadge] = useState(false); - useEffect(() => { - if (channelsMatch) { - try { - localStorage.setItem(CHANNELS_TOOLTIP_SEEN_KEY, '1'); - } catch { - /* private mode — non-fatal, badge just keeps showing */ - } - setShowBadge(false); - return; - } - try { - if (localStorage.getItem(CHANNELS_TOOLTIP_SEEN_KEY) === '1') return; - } catch { - return; - } - setShowBadge(true); - }, [channelsMatch]); - const navOpts = { replace: isNativePlatform() }; - const handleChannelsClick = () => { - setShowBadge(false); - try { - localStorage.setItem(CHANNELS_TOOLTIP_SEEN_KEY, '1'); - } catch { - /* private mode */ - } - navigate(CHANNELS_PATH, navOpts); - }; - return ( @@ -120,8 +64,7 @@ export function DirectStreamHeader() { navigate(CHANNELS_PATH, navOpts)} /> {showBotsSegment && (