Commit Graph

1069 Commits

Author SHA1 Message Date
Fringg
a819f309c8 fix: show actual connected devices count instead of device limit 2026-02-25 10:30:37 +03:00
Fringg
bef5102a71 fix: remove duplicate tariff info line, make tariff card clickable 2026-02-25 10:27:44 +03:00
Fringg
6b688ad451 refactor: rewrite dashboard components to match prototype design
- Rewrite TrafficProgressBar with multi-segment gradient fill, flex-based
  zone tints, shimmer + highlight overlays, radial glow at fill edge
- Rewrite SubscriptionCardActive with zone header, big percentage on right,
  connect device card with device dots, tariff/days-left two-column row,
  sparkline placeholder, traffic refresh controls
- Rewrite SubscriptionCardExpired with red glow, grid pattern, gradient
  renew button, outline tariffs button
- Rewrite TrialOfferCard with animated glow background, grid pattern,
  icon glow animation, price tag with old price, gradient CTA buttons
- Rewrite StatsGrid with 2x2 card layout, icon+label+chevron header,
  big value numbers, zone-colored balance/earnings cards
- Update Sparkline with color prop and last-point dot indicator
- Update useAnimatedNumber to use easeOutExpo matching prototype
- Add formatTraffic utility for MB/GB/TB unit formatting
- Add mainHex to trafficZone for inline style support
- Update animations to match prototype timing
- Add new i18n keys for redesigned components
2026-02-25 10:22:50 +03:00
Fringg
78fe3c48eb refactor: redesign Dashboard and Subscription pages with new components
Decompose monolithic Dashboard into SubscriptionCardActive,
SubscriptionCardExpired, TrialOfferCard, and StatsGrid sub-components.
Replace Subscription page progress bar with TrafficProgressBar compact.
Add i18n keys for traffic zones, stats labels, expired/trial states.
2026-02-25 10:08:05 +03:00
Fringg
909374d369 feat: add dashboard sub-components for subscription cards and stats grid
SubscriptionCardActive with animated zone dot, traffic bar, connect button.
SubscriptionCardExpired with red theme and renewal actions.
TrialOfferCard with stats grid and free/paid activation.
StatsGrid 2x2 with font-display values and font-mono labels.
2026-02-25 10:07:57 +03:00
Fringg
eb1f788033 feat: add TrafficProgressBar and Sparkline components
TrafficProgressBar with zone tints, shimmer animation, glow dot,
threshold markers, scale labels, unlimited/compact modes, and full
ARIA support. Sparkline SVG component ready for daily usage data.
2026-02-25 10:07:49 +03:00
Fringg
7e345fc7d0 feat: add fonts, animations, and shared utilities for dashboard redesign
Add Outfit + IBM Plex Mono fonts, traffic progress animations
(shimmer, unlimited flow/pulse, trial glow), traffic zone utility,
and animated number hook.
2026-02-25 10:07:42 +03:00
Fringg
d8b83ccdb8 fix: rewrite gradient border with @property CSS angle animation
Pure CSS approach: @property --border-angle + conic-gradient on border-box.
No extra elements, no overflow issues, no JS animation.
Smooth rotation via CSS Houdini custom property animation.
2026-02-25 08:48:48 +03:00
Fringg
e95db23573 fix: rewrite HoverBorderGradient with CSS rotate instead of framer-motion
Replace framer-motion gradient interpolation (buggy in TG WebView) with
pure CSS conic-gradient + transform:rotate() keyframe animation.
Transform animations are GPU-accelerated and reliable everywhere.
2026-02-25 08:44:42 +03:00
Fringg
4332c2bd25 fix: improve HoverBorderGradient visibility with accent colors and darker bg
- Use accent CSS vars for gradient (matches app theme dynamically)
- Increase gradient spot size for visible animation
- Darker inner bg (dark-900) for better contrast
- Increase blur to 3px for glow effect
2026-02-25 08:41:18 +03:00
Fringg
3fb9606fd0 feat: add HoverBorderGradient effect to key action buttons
Apply animated gradient border effect (Aceternity UI) to:
- Dashboard "Connect Devices" button
- Dashboard "Activate Trial" buttons (free and paid variants)
- Subscription page "Connect Devices" button
2026-02-25 08:37:28 +03:00
Fringg
5c1be1471e perf: eagerly load Dashboard to improve LCP on main route
Dashboard is the default landing page for all authenticated users.
Loading it eagerly eliminates one extra network round-trip for the
JS chunk (+30KB / +7KB gzip to main bundle, but saves ~200-500ms
of chunk fetch + parse time on first load).
2026-02-25 08:22:24 +03:00
Fringg
962dd43756 perf: improve LCP — move font loading to HTML, defer logo preload
- Move Google Fonts from CSS @import (render-blocking) to <link> in
  index.html with preconnect for earlier discovery
- Remove @import from globals.css — browser no longer waits for CSS
  parse -> @import fetch -> font CSS parse before first paint
- Defer initLogoPreload() to requestIdleCallback so logo fetch
  doesn't compete with critical resources during page load
2026-02-25 08:19:26 +03:00
Fringg
44d88f7653 perf: prefetch background chunk on page load from localStorage cache
- Add prefetchBackground() to registry — triggers dynamic import
  without creating React component
- Call prefetch at module init in BackgroundRenderer using cached
  config from localStorage, before React renders
- Background JS chunk starts downloading immediately instead of
  waiting for Suspense to trigger lazy() import
2026-02-25 08:14:13 +03:00
Fringg
65afb29274 fix: boxes background not covering viewport
- Use 300% oversized CSS grid container instead of fixed-size flex cells
- Grid with 1fr units auto-fills the container, skew+scale covers viewport
- Simplified to flat cell array, removed SVG crosses for cleaner look
2026-02-25 07:57:56 +03:00
Fringg
f16f96e442 fix: boxes background not covering full screen
- Use original Aceternity positioning: translate(-40%,-60%) with
  -top-1/4 left-1/4 to cover viewport after skew transform
- Switch from CSS grid to flex layout matching original structure
- Add cross (+) SVG markers at grid intersections
- Use pastel color palette from original, animate opacity per cell
- Increase default rows to 20 for better coverage
2026-02-25 07:53:30 +03:00
Fringg
94ddf319bd fix: animation config not updating for users after admin change
- Remove refetchOnWindowFocus: false — allow refetch on miniapp return
- Add initialDataUpdatedAt: 0 — treat localStorage cache as stale,
  refetch immediately instead of serving cached data for 60s
- Lower staleTime to 30s
2026-02-25 07:48:49 +03:00
Fringg
79ff7412cb fix: remove gemini-effect and noise backgrounds, fix aurora animation
- Delete google-gemini-effect.tsx and noise-background.tsx
- Remove from types, registry, and backend whitelist
- Rewrite aurora: use animate-aurora directly on element instead of
  invisible pseudo-element with mix-blend-difference
2026-02-25 07:43:41 +03:00
Fringg
de97a030d2 fix: rewrite 5 broken background components from Aceternity sources
- Aurora: remove invert filter (broken on dark bg), use dark gradient directly
- Beams: use animated linearGradient positions instead of pathLength animation
- Beams Collision: add collision detection, explosion particles, AnimatePresence
- Gemini Effect: rewrite as SVG motion.path with animated pathLength (was canvas)
- Noise: change mixBlendMode from overlay to screen (overlay invisible on dark bg)
2026-02-25 07:31:16 +03:00
Fringg
1a702a68b9 feat: replace animated backgrounds with Aceternity UI system
- Add 16 animated background components (aurora, sparkles, vortex, shooting-stars,
  beams, beams-collision, gradient-animation, wavy, lines, boxes, meteors, grid,
  dots, spotlight, noise, ripple, gemini-effect)
- Add full admin BackgroundEditor with live preview, type gallery, per-type settings
- Add BackgroundRenderer with lazy loading, localStorage cache, mobile reduction
- Add input sanitization (sanitizeColor, clampNumber) across all components
- Add translations for en, ru, zh, fa locales
- Remove old Aurora (WebGL/OGL) and AnimatedBackground (CSS wave-blob)
- Remove ogl dependency, add simplex-noise
2026-02-25 07:12:59 +03:00
Fringg
78e70992f1 fix: replace broken modal with inline confirmation for role revoke 2026-02-25 05:36:23 +03:00
Fringg
f829076bc2 fix: redesign role revoke confirmation dialog 2026-02-25 05:30:05 +03:00
Fringg
66f7fcb3dc feat: show query params in audit log details 2026-02-25 05:24:25 +03:00
Fringg
5d0e3539e2 feat: improve audit log - translate actions, fix resource filter, show request body 2026-02-25 05:11:57 +03:00
Fringg
a1a8dc2203 feat: add weekdays condition to ABAC policies 2026-02-25 04:53:42 +03:00
Fringg
a050125ea8 feat: allow editing system roles 2026-02-25 04:45:46 +03:00
Fringg
3d6987f761 feat: add granular user permissions (balance, subscription, promo_group, referral, send_offer)
Split users:edit into fine-grained permissions. Guard UI sections
with hasPermission checks so moderators only see what they can do.
2026-02-25 04:42:40 +03:00
Fringg
80bfaca457 feat: add translations for permission sections and actions
Translate all permission section names (users, tickets, etc.) and
action names (read, edit, delete, etc.) in ru/en/zh/fa locales.
Apply translations in PermissionMatrix, PolicyEdit, and Policies list.
2026-02-25 04:33:35 +03:00
Fringg
bc5d832e0d fix: guard user detail API calls with RBAC permission checks
Hide sync tab and skip sync/promo-groups API calls when moderator
lacks users:sync and promo_groups:read permissions.
2026-02-25 04:29:35 +03:00
Fringg
85c93158fb refactor: replace role/policy modals with separate pages
- Create AdminRoleEdit.tsx for /admin/roles/create and /admin/roles/:id/edit
- Create AdminPolicyEdit.tsx for /admin/policies/create and /admin/policies/:id/edit
- Remove create/edit modals from AdminRoles.tsx and AdminPolicies.tsx
- Add new lazy routes in App.tsx with proper permission gates
- Keep delete confirmation as small inline modal (appropriate for destructive action)
2026-02-25 04:20:37 +03:00
Fringg
56188b1f8a fix: RBAC policies page role handling and permission gates
- Read policy role_id from top-level field instead of conditions object
- Use policy.role_name for display, remove conditions.role_id lookup
- Remove duplicate role_id injection into conditions payload on submit
- Fix PermissionGate strings: policies:* -> roles:* to match backend
- Remove redundant client-side status filtering in audit log (already
  filtered server-side)
2026-02-25 04:07:13 +03:00
Fringg
4c9c3992ab fix: RBAC frontend type mismatches and translations
- Move RBAC translations from banSystem to admin namespace in all 4 locales
- Fix AccessPolicy type: action (string) -> actions (string[])
- Fix AuditLogEntry type to match backend: add status, request_method, request_path, resource_type, user info
- Fix AuditLogFilters: resource -> resource_type, add status filter
- Handle null details safely in audit log expanded view
- Fix policy form submission and display to use actions array
2026-02-25 03:40:54 +03:00
Fringg
c4e3211baa fix: add missing onError handlers on RBAC mutations
- deleteMutation onError in AdminRoles and AdminPolicies
- revokeMutation onError in AdminRoleAssign
- handleExport error handling in AdminAuditLog
- add missing i18n keys: deleteFailed, revokeFailed, exportError
2026-02-25 03:17:12 +03:00
Fringg
874ee2682e feat: add RBAC permission system to admin cabinet frontend
- Permission store (Zustand) with wildcard matching and role level checks
- PermissionRoute guard for route-level access control
- PermissionGate component for element-level visibility
- Admin Roles page: CRUD, permission editor, role assignment
- Admin Policies page: ABAC policy management (time/IP conditions)
- Admin Audit Log page: filterable log viewer with CSV export
- AdminPanel sidebar navigation gated by permissions
- 4 locale files updated (en, ru, zh, fa) with RBAC translations
- API client module for all RBAC endpoints
2026-02-25 03:02:52 +03:00
Fringg
48be067d1b feat: add per-channel disable settings and global settings to channel admin
- Add global settings section (CHANNEL_IS_REQUIRED_SUB, trial/paid toggles)
  at top of AdminChannelSubscriptions page
- Add per-channel disable_trial_on_leave and disable_paid_on_leave toggles
  in each channel card with inline Toggle controls
- Update RequiredChannel type and API request interfaces with new fields
- Add translations for globalSettings and perChannel in en/ru/fa/zh locales
2026-02-25 00:24:36 +03:00
Fringg
5a55892145 feat: add channel edit in admin, hide subscribed channels in blocking screen
- Admin panel: added Edit button on channel cards with inline edit form
  (title, link, sort order) using existing PATCH API
- Subscription screen: filter out already-subscribed channels so users
  only see what they still need to subscribe to
- Updated channelIdHint to remove @username reference (numeric only)
- Added i18n keys: edit, editing, form.save (en/ru/fa/zh)
2026-02-24 03:12:12 +03:00
Fringg
a767fe96d3 feat: add multi-channel subscription blocking UI and admin management
- Channel subscription blocking screen with per-channel status display
- Safe URL handling with protocol validation (no open redirect)
- Race-condition-safe subscription check with useRef guard
- Admin channel management page with create, toggle, delete
- Error handlers on all admin mutations with haptic feedback
- Proper type guard for channel subscription error detection
- Accessibility: aria-labels on icon-only buttons
- Localization: en, ru, zh, fa translations
2026-02-24 02:51:03 +03:00
Egor
8ea9a1d6a0 Merge pull request #234 from BEDOLAGA-DEV/main
Dev
2026-02-23 23:38:14 +03:00
Egor
3ba30fa456 Merge pull request #233 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.19.1
2026-02-23 21:33:14 +03:00
github-actions[bot]
c1c6e98ee1 chore(main): release 1.19.1 2026-02-23 18:32:32 +00:00
Egor
06f68c76bc Merge pull request #232 from BEDOLAGA-DEV/dev
Dev
2026-02-23 21:31:48 +03:00
Fringg
67bacd3e7a fix: correct memory display to use actual usage instead of cache-inclusive
memory.used from systeminformation includes disk cache/buffers,
showing ~91% when actual usage is ~18%. Now uses (total - available)
which matches htop/free output. Also added PB/EB units to formatBytes.
2026-02-23 19:27:18 +03:00
Fringg
e8acfee3e4 fix: remove double URL-decode in extractTelegramUserId 2026-02-23 18:13:02 +03:00
Fringg
ee6ec5959c fix: detect Telegram account switch across tab closes
The old clearStaleSessionIfNeeded stored initData in sessionStorage for
comparison, but sessionStorage is cleared on tab close — so switching
Telegram accounts between separate Mini App openings was never detected.

Fix: store the Telegram user ID in localStorage (survives tab close).
On every launch, compare the fresh initData user ID with the stored one.
If they differ, clear all auth tokens and cached user data to force
re-authentication as the correct account.
2026-02-23 17:53:47 +03:00
Fringg
d1043e83ea fix: add max attribute to expected referrals input
Prevent users from entering values exceeding int32 range.
2026-02-23 17:27:34 +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
Fringg
30ece694d4 perf: fix render cycle in useBranding and conditional polling
- Remove isFullscreen from useBranding useEffect deps to prevent
  re-render loop (requestFullscreen changes isFullscreen which
  re-triggers the effect); use ref guard instead
- Make AdminBroadcasts 5s polling conditional: only poll when there
  are active broadcasts (queued/in_progress/cancelling)
2026-02-23 17:15:20 +03:00
Fringg
7cf72735ec fix: plug memory leaks in blob URLs and traffic cache
- Add URL.revokeObjectURL on unmount and media removal in
  AdminBroadcastCreate, AdminPinnedMessageCreate, Support
- Track blob URLs via refs to revoke before creating new ones
- Add clearCreateAttachment/clearReplyAttachment helpers in Support
  to properly revoke blob URLs when clearing attachments
- Cap adminTraffic cache at 20 entries with FIFO eviction to prevent
  unbounded memory growth from different filter combinations
2026-02-23 17:15:11 +03:00
Fringg
17b2f2e903 perf: extract Twemoji options to module-level const
Prevent MutationObserver re-initialization on every render by moving
the options object out of JSX (was creating a new object reference
on each render of AppWithNavigator).
2026-02-23 17:15:03 +03:00
Fringg
860493058a perf: fix GPU-heavy CSS patterns
- Remove mix-blend-mode: overlay from body::before noise texture
  (was forcing fullscreen GPU compositing on every paint)
- Disable noise texture on mobile via display:none media query
- Replace backdrop-filter animation in backdropFadeIn/Out keyframes
  with opacity-only animation (backdrop-filter transition is expensive)
- Replace toast progress bar width animation with scaleX (GPU-composited)
- Remove redundant will-change: transform from .glass and .wave-blob
2026-02-23 17:14:57 +03:00