Commit Graph

35 Commits

Author SHA1 Message Date
Fringg
60f11e97a2 feat: show MULTI_TARIFF_ENABLED setting only in tariffs sales mode
Hide MULTI_TARIFF_ENABLED and MAX_ACTIVE_SUBSCRIPTIONS from admin
settings when SALES_MODE is not 'tariffs'. Add Russian translations.
2026-03-29 07:04:34 +03:00
Fringg
e004d8103b fix: mobile layout and touch target improvements for admin settings
- SettingsTableRow: stack name above controls on mobile, show action
  buttons without hover (max-lg:opacity-100)
- SettingsMobileTabs: increase touch targets to 44px, add scroll spacers
- QuickToggles: increase chip touch targets
- SettingInput: increase display button touch target
- AdminSettings: add bottom padding buffer to mobile layout
2026-03-29 03:18:21 +03:00
Fringg
67055d58f7 fix: whitespace search guard and unknown section fallback
- SettingsTab: use searchQuery.trim() instead of searchQuery to prevent
  whitespace-only input from triggering empty search results view
- AdminSettings: fallback to branding when activeSection is unknown
  instead of rendering blank content area
2026-03-29 03:08:02 +03:00
Fringg
ea1c7359ce fix: stabilize useMemo deps and add category search to sidebar
- Use activeSection instead of activeTreeInfo as useMemo dependency
  (activeTreeInfo is derived from activeSection, new object each render)
- Add category label matching to sidebar autocomplete search filter
  to match global search behavior
2026-03-29 02:56:54 +03:00
Fringg
21813ef82e feat: redesign admin settings with tree navigation and compact layout
- Replace flat sidebar with collapsible tree groups (7 groups, 52 sub-items)
- Map all 61 backend category keys to sidebar navigation
- Add QuickToggles panel for boolean settings
- Replace card-style SettingRow with compact SettingsTableRow
- Add breadcrumb navigation for tree sub-items
- Add source badges (modified/DB/ENV) on settings
- Implement two-level mobile navigation with group chips
- Add i18n translations for all new keys (en, ru, zh, fa)
2026-03-29 02:38:52 +03:00
Fringg
23aa86f1a8 feat: add menu editor tab with drag-and-drop rows, custom URL buttons, and button configuration
- Add menuLayout.ts API client with normalizeConfig and type definitions
- Add MenuEditorTab.tsx with DnD rows, button CRUD, style/emoji/label editors
- Replace ButtonsTab with MenuEditorTab on admin settings page
- Add menu editor translations for ru, en, zh, fa locales
- Loading/error states, useMemo optimizations, proper ref patterns
2026-03-09 23:07:38 +03:00
Fringg
b2898730b9 feat: add ButtonsTab for per-section button style customization
Visual editor in admin settings for configuring Telegram button colors
and custom emoji IDs per menu section. Includes API client, draft state
management, save/reset, and translations for ru/en/fa/zh locales.
2026-02-12 23:16:08 +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
482bdd0b0d Remove replace flag from back button navigation to fix double-click issue
Fixed issue where users had to click the Telegram Mini App back button twice
in many admin pages. The replace flag was causing conflicts between Telegram's
BackButton internal history and React Router's history management.

Updated all 32 admin pages to use simple navigate() calls without replace flag.
2026-02-04 06:11:29 +03:00
c0mrade
55e2068606 Fix back button cycling in Telegram Mini App
Add replace: true to all navigate() calls in useBackButton hooks
Prevents history cycles when navigating back and forth
All 32 admin pages now use navigate(path, { replace: true })
Back button now goes directly to parent without cycling
2026-02-04 05:59:15 +03:00
c0mrade
e948cdc8d2 Complete back button logic for all admin pages in Telegram Mini App
Main sections navigate to /admin (15 pages)
Detail/edit pages navigate to parent lists (16 pages)
All pages use useBackButton hook with proper navigation paths
Native Telegram back button in Mini App, UI button on web
Email template pages keep UI-only back buttons as required
2026-02-04 05:03:06 +03:00
c0mrade
e5096d571f feat: add autocomplete to settings search
- Show dropdown with top 8 matching settings while typing
- Search by key, name, translated name, description and category
- Display setting name and category in suggestions
- Keyboard navigation (arrows, Enter, Escape)
- On select: switch to correct section and filter by setting key
- Works on both desktop and mobile
2026-02-02 09:17:51 +03:00
c0mrade
b953ee0b8c feat: Linear-style UI redesign with improved mobile experience
Major changes:
- Redesign cabinet with Linear-style components and top navigation
- Replace detail modals with dedicated pages (users, broadcasts, email templates)
- Add email channel support for broadcasts
- Remove pull-to-refresh, improve drag-and-drop on touch devices
- Fix Telegram Mini App: fullscreen, back button, scroll restoration
- Unify admin pages color scheme to design system
- Mobile-first improvements: horizontal tabs for settings, better touch targets
2026-02-01 18:58:10 +03:00
c0mrade
bc90ba3779 refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore
- Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url)
- Add .prettierrc and .prettierignore
- Format entire codebase with prettier
2026-01-27 17:37:31 +03:00
Egor
80da25c102 Update AdminSettings.tsx 2026-01-27 01:19:42 +03:00
PEDZEO
4c5fe78cf3 Fix AdminSettings mobile: scroll to top on open and add safe area padding 2026-01-21 05:05:33 +03:00
PEDZEO
8d4c00d176 Add SettingsSidebar and SettingsSearch components to AdminSettings
- Introduced SettingsSidebar for improved navigation and organization.
- Added SettingsSearch and its mobile variant for enhanced search functionality.
- Updated AdminSettings to utilize new components, streamlining the layout and improving user experience.
2026-01-21 04:31:07 +03:00
PEDZEO
82d38b829a Improve global search in AdminSettings
- Search across all settings regardless of active section
- Search by translated names, descriptions, and categories
- Add clear search button (X icon)
- Show search results count
2026-01-21 04:28:31 +03:00
PEDZEO
8776e2d128 Refactor AdminSettings into modular components
Split 1123-line monolithic AdminSettings.tsx into 11 modules:

Components:
- icons.tsx (85 lines) - All SVG icons
- Toggle.tsx (21 lines) - Reusable toggle component
- SettingInput.tsx (89 lines) - Text/select input for settings
- SettingRow.tsx (104 lines) - Single setting card
- BrandingTab.tsx (212 lines) - Logo, name, animation settings
- ThemeTab.tsx (277 lines) - Theme presets and custom colors
- FavoritesTab.tsx (59 lines) - Starred settings display
- SettingsTab.tsx (144 lines) - Accordion categories view

Utilities:
- constants.ts (55 lines) - MENU_SECTIONS, THEME_PRESETS
- utils.ts (35 lines) - formatSettingKey, stripHtml
- index.ts (13 lines) - Barrel exports

Result: AdminSettings.tsx reduced from 1123 to 251 lines
2026-01-21 03:56:21 +03:00
PEDZEO
dcac738aeb Add subscription translations and collapsible categories in AdminSettings
- Add 65+ new translations for subscription, trial, traffic, autopay settings
- Replace flat navigation with accordion-style collapsible subcategories
- Categories are collapsed by default, click to expand
- Search shows flat list when query is present
- Remove unused ChevronRightIcon and activeSubCategory state
2026-01-21 03:48:44 +03:00
PEDZEO
c572fc0b69 Move hardcoded translations from AdminSettings to locales
- Remove SETTING_TRANSLATIONS object with 50+ hardcoded Russian translations
- Add translations to ru.json under admin.settings.settingNames
- Rename formatSettingName to formatSettingKey
- Use t() function with fallback for setting names
2026-01-21 03:42:28 +03:00
PEDZEO
76b2d713f1 Add Russian translations for common settings in AdminSettings
- Introduced a dictionary for translating various settings into Russian.
- Updated the `formatSettingName` function to return translated names when available.
- Adjusted layout for sidebar and main content to improve responsiveness and organization.
2026-01-21 03:25:46 +03:00
PEDZEO
0679905c51 Add helper functions for formatting settings and cleaning HTML in AdminSettings
- Introduced `formatSettingName` to convert setting names from Snake_Case/CamelCase to a readable format.
- Added `stripHtml` function to remove HTML tags from setting descriptions.
- Updated rendering logic in `renderSettingRow` to utilize the new helper functions for improved display of setting names and descriptions.
- Enhanced layout for settings display with better spacing and organization.
2026-01-21 03:21:45 +03:00
PEDZEO
710bc32111 Fix AdminSettings mobile layout with drawer navigation 2026-01-21 03:09:32 +03:00
PEDZEO
329d063387 Redesign AdminSettings with sidebar navigation and localization
- Replace top tabs with sidebar menu navigation
- Add sub-categories for settings (payments, subscriptions, etc.)
- Implement full Russian localization for all UI elements
- Add category translations for all setting groups
- Collapsible presets and custom colors sections
- Favorites functionality with localStorage persistence
- Search functionality in settings
- Responsive layout with collapsible sidebar
2026-01-21 03:02:23 +03:00
PEDZEO
d7b387927f Redesign AdminSettings with tabs navigation and favorites
- Add tab-based navigation (Favorites, Branding, Theme, Payments, etc.)
- Create useFavoriteSettings hook for localStorage-based favorites
- Create SettingCard component for consistent setting display
- Add global search functionality
- Implement collapsible sections for theme presets and colors
- Group settings by meta-categories (payments, subscriptions, etc.)
- Add dropdown for additional categories (More menu)
- Modern UI with improved spacing and interactions
2026-01-21 02:52:37 +03:00
PEDZEO
215a65dbae Refactor theme settings with two collapsible sections
- Quick Presets: collapsible section with 8 theme presets
- Custom Colors: collapsible section with all color pickers
- Added translations for quickPresets, customColors in all locales (ru, en, zh, fa)
- Chevron icon rotates when section is expanded
- Preview section moved inside Custom Colors
2026-01-21 02:11:39 +03:00
PEDZEO
bf0a43384b Add collapsible theme sections and Russian translations
- Translated Quick Presets to Russian (Быстрые пресеты)
- Translated preset names: Стандарт, Океан, Лес, Закат, Фиолет, Роза, Полночь, Бирюза
- Made theme color sections collapsible (Accent, Dark Theme, Light Theme, Status Colors)
- Each section shows color preview when collapsed
2026-01-21 02:04:48 +03:00
PEDZEO
879031508b Enhance ColorPicker and AdminSettings components with improved styling and theme presets
- Updated ColorPicker component styles for better visual consistency and usability.
- Adjusted button sizes and input fields for a more cohesive design.
- Introduced theme presets in AdminSettings for quick color scheme selection, enhancing user experience.
- Added new color schemes with predefined colors for easier theme management.
2026-01-21 01:53:31 +03:00
PEDZEO
64acfbee72 Add fullscreen functionality: introduce API methods for getting and updating fullscreen settings, implement caching for fullscreen state, and integrate fullscreen toggle in AdminSettings. Remove unused fullscreen icons from Layout component. 2026-01-20 02:17:22 +03:00
Egor
164ec7a380 Update AdminSettings.tsx 2026-01-19 10:32:58 +03:00
Egor
5840c35f44 Update AdminSettings.tsx 2026-01-19 10:28:02 +03:00
Egor
17ba56fbc2 Update AdminSettings.tsx 2026-01-19 10:21:03 +03:00
PEDZEO
8667945501 Implement back navigation in admin pages by adding a BackIcon and linking to the admin dashboard across multiple components. 2026-01-18 07:42:29 +03:00
Egor
7be6b5c0ae Add files via upload 2026-01-15 19:18:17 +03:00