Commit Graph

24 Commits

Author SHA1 Message Date
c0mrade
fd01c0f393 fix: preserve subscription context in navigation and cache keys
SubscriptionCardActive: passes ?sub= to /connection navigation.
Connection: QR state includes subscriptionId for back-navigation.
ConnectionQR: preserves subscription context on back button.
Dashboard + Subscription: localStorage traffic cache keyed per-subscription
to prevent cooldown bleed between different subscriptions.
2026-03-25 11:47:31 +03:00
c0mrade
4de47cfa94 fix: multi-subscription frontend improvements
- Connection page: reads subscription_id from ?sub= query param
- Subscription detail: passes subscriptionId to /connection URL
- Dashboard: skip single-subscription and devices queries in multi-tariff
  mode (data comes from subscriptions-list instead)
2026-03-24 22:18:02 +03:00
c0mrade
62188b8d2e fix: resolve all 14 ESLint warnings across the codebase
- Add varsIgnorePattern to no-unused-vars for destructuring patterns
- Fix all react-hooks/exhaustive-deps by adding missing dependencies
- Refactor useAnimatedNumber to use ref instead of stale state closure
- Wrap handleLinkResult in useCallback for stable deps
- Extract OAuth utilities from OAuthCallback.tsx to utils/oauth.ts
- Extract background config utilities to utils/backgroundConfig.ts
- Remove unused catch parameter in GiftSubscription
2026-03-13 20:19:09 +03:00
c0mrade
2dab25c5a0 fix: resolve telegram auth token expiration and clean up codebase
- Fix stale initData comparison in clearStaleSessionIfNeeded that destroyed
  valid refresh tokens on mobile WebView reopens
- Restrict X-Telegram-Init-Data header to auth endpoints only
- Close Mini App on auth retry to force fresh initData from Telegram
- Merge Connection page error/not-configured states for better UX
- Remove unnecessary comments across 40+ files (section dividers,
  restating comments, noise catch block comments)
- Configure ESLint allowEmptyCatch to properly handle intentional
  empty catch blocks (62 warnings resolved)
2026-03-13 17:50:49 +03:00
c0mrade
7bb75aa920 fix: use platform-conditional replace for QR navigation to preserve Telegram back behavior 2026-03-07 23:35:06 +03:00
c0mrade
8ce4b1a24a refactor: move ConnectionQR into standard Layout with proper navigation
- Wrap /connection/qr route in ProtectedRoute with Layout
- Remove fullscreen overlay and custom close button
- Add AdminBackButton with replace prop to avoid history cycles
- Use replace navigation from Connection to QR page
- Add replace prop support to AdminBackButton component
2026-03-07 23:25:33 +03:00
Fringg
4d14e3e806 feat: add fullscreen QR code for subscription connection
- New ConnectionQR page with fullscreen QR display (no modal)
- QR button in InstallationGuide header next to platform selector
- Respects hideLink setting: shows URL below QR only when visible
- i18n translations for ru, en, zh, fa
2026-02-27 03:14:15 +03:00
Fringg
03ad255bf1 perf: add Zustand selectors to prevent cascading re-renders
Replace all bare useAuthStore(), useBlockingStore(), and
useSuccessNotification() calls with individual field selectors.
This prevents components from re-rendering when unrelated store
fields change.

- 21 useAuthStore usages across 20 files: individual selectors
  for 1-2 fields, useShallow for 3+ fields
- 5 useBlockingStore usages: individual selectors
- 2 useSuccessNotification usages: individual selectors
2026-02-23 17:15:30 +03:00
c0mrade
a4e6e35da1 fix: check apps before subscription on connection page
Move the empty apps check before the subscription check so that
an empty or unconfigured appConfig shows "not configured" instead
of the misleading "no subscription" message.
2026-02-09 12:29:00 +03:00
c0mrade
fb25df6f0f feat: add empty state for connection page when no apps configured
Show different messages depending on user role:
- Regular users see a friendly "check back later" message
- Admins see a prompt with a link to /admin/apps settings
2026-02-09 11:23:33 +03:00
c0mrade
5171890745 refactor: extract BlockButtons component from InstallationGuide
Move button rendering logic (URL validation, copy handler, icon
components) into a dedicated BlockButtons component. Remove
duplicate getLocalizedText/getBaseTranslation helpers from
Connection page controller.
2026-02-06 18:05:40 +03:00
c0mrade
562ab7abf7 refactor: full codebase cleanup, dependency updates, and lint fixes
Phase 0: Remove ~920 lines of dead code (ThemeBentoPicker, PromoDiscountBadge,
AdminLayout, SettingsSidebar, MovingGradient, EmptyState, miniapp API, unused
types/functions/transitions/skeleton helpers). Fix API barrel file (add 20 missing exports).

Phase 1: Add ErrorBoundary (app/page/widget levels), centralize constants,
add axios timeout, fix staleTime:0 in React Query.

Phase 2: Consolidate hexToHsl, extract email validation, fix duplicate code.

Phase 3: Fix auth race condition (await checkAdminStatus), memoize useCurrency,
add WebSocket message validation.

Phase 4: Extract useBranding, useFeatureFlags, useScrollRestoration from AppShell.

Phase 5: Remove all eslint-disable react-hooks/exhaustive-deps (14 total),
simplify logger, remove deprecated hooks (useBackButton, useTelegramDnd,
useTelegramWebApp).

Dependencies: React 19, react-router 7, zustand 5, i18next 25, react-i18next 16,
eslint-plugin-react-refresh 0.5. Remove unused @lottiefiles/dotlottie-react.
Convert vite manualChunks to function-based approach for react-router v7 compat.

Lint: Fix logger.ts no-unused-expressions, fix react-refresh/only-export-components
in 6 Radix primitive files (const re-exports → direct re-exports), fix
WebSocketProvider exhaustive-deps. Result: 0 errors, 0 warnings.

Add CLAUDE.md to .gitignore.
2026-02-06 16:55:55 +03:00
c0mrade
813f6e4449 refactor: extract Installation Guides into block renderer components
Replace monolithic Connection.tsx (1076 lines) with modular architecture:
- 4 block renderers (cards, timeline, accordion, minimal) selectable
  via uiConfig.installationGuidesBlockType from RemnaWave config
- Color parser utility with 14 named colors + hex support
- InstallationGuide component handles platform/app selection and
  button rendering (subscriptionLink, copyButton, external)
- Remove classic step-based format (AppButton, AppStep, AppInfo)
- Add appConfig query invalidation on admin UUID change
2026-02-05 20:07:07 +03:00
c0mrade
5111b63f2e fix: use redirect page for all platforms and fallback to regular subscription URL
- Always route deep links through redirect.html instead of splitting
  mobile/desktop paths, fixing Telegram Mini App WebView limitation
  with custom URL schemes (happ://, clash://, etc.)
- Fallback to regular subscriptionUrl instead of crypto resolvedUrl
  for subscriptionLink buttons
2026-02-05 16:42:52 +03:00
c0mrade
1d7b984880 refactor: simplify AdminApps page to config selector and compact app chips
- Rewrite AdminApps.tsx from ~560 to ~165 lines: status card, config list, UUID input, save/disconnect
- Remove legacy types and conversion functions from adminApps.ts (~370 lines)
- Connection.tsx: flex-wrap app chips, reduce padding and icon size for compact layout
2026-02-05 14:56:41 +03:00
c0mrade
53940a0169 feat: use platform displayName from RemnaWave config in connection page
Add displayName to RemnawavePlatformData type and prioritize it
in getPlatformDisplayName over hardcoded fallback names.
2026-02-05 14:27:53 +03:00
c0mrade
966343a4d8 fix: restore platform dropdown with SVG icon and widen app chips to match original 2026-02-05 13:36:51 +03:00
c0mrade
4866003c23 fix: unify connection page design with global styles and add platform SVG icons
- Add svgIconKey to RemnawavePlatform and RemnawavePlatformData types
- Render platform OS icons from svgLibrary in AdminApps tabs and Connection page
- Replace platform dropdown with icon pill buttons on connection page
- Use .card class with colored left border for block cards
- Unify all back buttons with AdminBackButton pattern (border + bg)
- Fix app chips and platform tabs to not blend with background (btn-secondary style)
- Use accent outlined style for block action buttons matching original RemnaWave UI
- Use btn-secondary for tutorial button
2026-02-05 13:21:32 +03:00
c0mrade
91afbbf3c6 fix: resolve RemnaWave SVG icons and icon colors on connection page
SVG library entries from RemnaWave API are plain strings, not objects
with svgString property. Also map named colors (violet, cyan, teal, etc.)
to hex values for correct icon background rendering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:02:32 +03:00
c0mrade
42e70f72ff fix: restyle app cards to match original RemnaWave UI and debug icons
- Redesign app selector from small pills to card buttons with name left
  and large SVG icon right matching original RemnaWave subscription page
- Remove broken getAppIcon fallback (📦) for unknown apps
- Add svgIconKey field to app types for app-level logo from svgLibrary
- Use app.svgIconKey for admin apps page icons
- Increase subscription page tile opacity to 50% for readability
- Add temporary debug log to diagnose missing svgIconKey on apps
2026-02-05 11:42:54 +03:00
c0mrade
65a671470d feat: use app-level svgIconKey for app logos and improve tile contrast
- Add svgIconKey field to RemnawaveAppClient and RemnawaveApp types
- Render app logos from svgLibrary via app.svgIconKey on connection page
  chips with fallback to getAppIcon() by name
- Use app.svgIconKey for app icons on admin apps settings page
- Show featured indicator as amber dot matching original RemnaWave UI
- Increase inner tile background opacity from 30% to 50% on subscription
  page for better text readability
2026-02-05 11:27:03 +03:00
c0mrade
a50dea9a3d feat: connect RemnaWave baseTranslations and fix SVG icons
- Wire baseTranslations from RemnaWave config to connection page UI
  (copyLink, openApp, installApp, addSubscription, connectAndUse,
  tutorial, close) with locale fallback: current lang → en → ru → first
- Add tutorial button when baseSettings.isShowTutorialButton is enabled
- Fix SVG icon rendering on admin apps settings page with proper scaling
- Add colored circle backgrounds for block and app icons in admin panel
- Add tutorial translation key to all locale files
2026-02-05 09:44:42 +03:00
c0mrade
79afe3a733 feat: render original RemnaWave blocks on connection page
- Add RemnaWave types (RemnawaveAppClient, RemnawaveBlockClient, etc.)
- Dual rendering: RemnaWave blocks with SVG icons or legacy steps
- Platform dropdown, DOMPurify for SVG sanitization
- Button types: subscriptionLink, copyButton, external
2026-02-05 08:29:54 +03:00
c0mrade
445dd0601a feat: convert ConnectionModal to /connection page with crypto deep links
- Add @kastov/cryptohapp + jsencrypt for encrypted Happ deep links
- Add templateEngine utility to resolve {{SUBSCRIPTION_LINK}},
  {{HAPP_CRYPT3_LINK}}, {{HAPP_CRYPT4_LINK}}, {{USERNAME}} templates
- Convert ConnectionModal component into a standalone Connection page
- Add /connection route with ProtectedRoute and lazy loading
- Replace modal invocation in Dashboard and Subscription with
  navigate('/connection')
- Add type and svgIconKey optional fields to RemnawaveButton
- Show button type badge and SVG icon in AdminApps BlockCard
- Refactor ThemeTab to use local draft state with Save/Cancel flow
2026-02-05 07:33:45 +03:00