Commit Graph

1747 Commits

Author SHA1 Message Date
c0mrade
9d3fb37d60 fix: remove duplicate back buttons, improve multi-subscription UX
- Remove custom back buttons from Subscription detail and SubscriptionPurchase
  pages — native Telegram mini-app back button already handles navigation
- SubscriptionListCard: distinct trial badge with star icon and amber styling,
  trial cards get amber border/background for visual differentiation
- SubscriptionPurchase: change "Купить тариф" to "Новый тариф" when adding
  a new tariff in multi-subscription mode
- Subscription detail: show tariff name as title in multi-tariff mode
2026-03-23 21:38:04 +03:00
c0mrade
376e1bb56d feat: enhance subscription list UX with progress bars, status badges, and glass theme
- SubscriptionListCard: replace status dot with localized status badge,
  add traffic progress bar with color coding, use locale-aware date format
- Subscriptions page: apply glass theme colors, improve empty state styling,
  add SVG plus icon for buy button, skeleton loader with glass theme
- Subscription detail: invalidate subscriptions-list cache on mutations
2026-03-23 18:57:05 +03:00
c0mrade
f4de6d8ad8 fix: multi-subscription UI audit fixes and cache invalidation improvements
- Fix AdminUserDetail multi-subscription display with useMemo optimization
- Update Dashboard subscription cards and purchase entry points
- Fix WebSocket notification handlers for multi-subscription context
- Update SubscriptionPurchase cache invalidation for multi-tariff mode
- Fix Subscriptions list page and navigation patterns
- Update App routing, DeepLinkRedirect, and CommandPalette for multi-sub
- Add SubscriptionListCard component
- Fix TopUpResult and PromoOffersSection navigation
2026-03-23 18:57:05 +03:00
c0mrade
258bfd7654 fix: remove unused multiSubCount variable 2026-03-23 18:57:05 +03:00
c0mrade
09f467bfb3 feat: show per-subscription mini-cards on Dashboard with tariff name, traffic, devices, date 2026-03-23 18:57:05 +03:00
c0mrade
865a78b801 fix: hide legacy subscription card on Dashboard in multi-tariff mode 2026-03-23 18:57:05 +03:00
c0mrade
bcbfa4191e feat: multi-tariff purchase UX - disable switch, show Buy for new tariffs, correct page title 2026-03-23 18:57:05 +03:00
c0mrade
a0c21a11aa fix: navigation links point to /subscriptions (list page) instead of legacy /subscription 2026-03-23 18:57:05 +03:00
c0mrade
f0d520dbaa fix: show subscriptions link on dashboard even with single subscription in multi-tariff mode 2026-03-23 18:57:05 +03:00
c0mrade
44d6069294 fix: correct glass theme and haptic API usage in Subscriptions page 2026-03-23 18:57:05 +03:00
c0mrade
820ba46cc4 feat: multi-subscription frontend support
- Add SubscriptionListItem and SubscriptionsListResponse types
- Add getSubscriptions/getSubscriptionById API methods
- Add optional subscriptionId parameter to all 30+ API methods
- Create /subscriptions page with subscription list cards
- Add /subscription/:subscriptionId route for per-subscription management
- Dashboard: show multi-tariff navigation block when user has 2+ subscriptions
- Subscription page: read subscriptionId from URL params, pass to all queries
- SubscriptionPurchase: accept subscriptionId from query params
- SubscriptionCardExpired: pass subscription.id to API calls
- Full backward compatibility: without subscriptionId, works as before
2026-03-23 18:57:05 +03:00
Fringg
84bded7974 fix: transliterate Cyrillic to Latin in news slug generation 2026-03-23 18:21:24 +03:00
Egor
8299fc15a7 Merge pull request #352 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.42.0
2026-03-23 16:57:47 +03:00
github-actions[bot]
846ea6212d chore(main): release 1.42.0 2026-03-23 13:57:19 +00:00
Egor
e86de809ae Merge pull request #351 from BEDOLAGA-DEV/dev
Dev
2026-03-23 16:56:44 +03:00
Fringg
be7219ec06 feat: add delete buttons for categories and tags in combobox dropdown
- Add onDelete prop to ColoredItemCombobox with X button per item
- Wire up deleteCategory/deleteTag API calls in AdminNewsCreate
- Auto-clear selection if the deleted item was selected
- Spinner on delete, haptic feedback, i18n aria-label
2026-03-23 15:48:27 +03:00
Fringg
13d27a5929 fix: tag color bug, FormData interceptor, falsy id check
- Fix tag using category_color instead of its own color when editing
- Add FormData auto-detection interceptor in client.ts (root cause of 422)
- Remove redundant Content-Type overrides from all 5 upload endpoints
- Fix falsy id check (id: 0 treated as null) with strict comparison
- Await invalidateQueries to prevent stale dropdown data
2026-03-23 15:36:22 +03:00
Fringg
4bcae6ce11 fix: add multipart/form-data header to news media upload request 2026-03-23 15:31:52 +03:00
Fringg
2ae01c95ae feat: add category/tag management UI with ColoredItemCombobox
- ColoredItemCombobox component with search, color swatches, inline creation
- Replace text inputs with combobox dropdowns for category and tag selection
- API methods for categories/tags CRUD
- TypeScript types for NewsCategory, NewsTag
- i18n keys for combobox (ru, en)
2026-03-23 15:30:02 +03:00
Fringg
59d8b66884 fix: disable duplicate link/underline extensions from StarterKit 2026-03-23 15:04:48 +03:00
Fringg
b7ab2cff55 fix: news section — remove duplicate title, add newspaper icon, hide views from users, fix cache invalidation 2026-03-23 15:00:11 +03:00
Fringg
de5414f42e fix: remove duplicate news title and replace N icon with newspaper SVG 2026-03-23 14:52:17 +03:00
Fringg
5c0eb129f4 fix: register DOMPurify hooks once, abort featured upload, fix double drop
- Register DOMPurify hooks at module init (not per sanitizeHtml call)
- Always set iframe allow attribute (not conditional on existing)
- Add AbortController to featured image upload for unmount cleanup
- Check defaultPrevented in React onDrop to prevent double upload with TipTap
- Remove explicit Content-Type header on upload (axios auto-sets boundary)
2026-03-23 12:43:47 +03:00
Fringg
f788f1034c fix: isolated DOMPurify instance and correct video controls attribute
- Use DOMPurify(window) to avoid global hook pollution
- Fix controls default from boolean to empty string (HTML attribute semantics)
- Remove redundant non-null assertion on featured_image_url
2026-03-23 12:32:04 +03:00
Fringg
25f3602aea fix: video not rendering — add TipTap Video extension, allow HTTP src
TipTap didn't recognize <video> tags without a custom node extension,
serializing them as escaped text. Also revert video src to allow HTTP
since request.base_url returns http:// behind reverse proxy.
2026-03-23 12:11:51 +03:00
Fringg
74080004e8 fix: media upload security hardening from 6-agent review
- uploadCount: always decrement in finally (prevent permanent uploading state)
- AbortSignal: pass to actual HTTP request (cancel network, not just UI)
- Concurrent uploads: use Set<AbortController> instead of single ref
- DOMPurify hooks: scope inside sanitizeHtml() to avoid global pollution
- Video src: restrict to HTTPS only (was allowing HTTP)
- GIF: remove from accept attributes (backend rejects GIF)
- Ref mutation: move handleMediaUploadRef update to useEffect
2026-03-23 12:05:55 +03:00
Fringg
723591e5c3 feat: add media upload to news editor with drag-drop, paste, and file picker
Upload images/videos directly to server from editor. DOMPurify video
sanitization, XSS protection, upload cancellation on unmount.
2026-03-23 11:58:18 +03:00
Fringg
8d994f75d9 fix: remove animated background from news section, fix mobile borders
- Remove GridBackground and ScanLine animations
- Use simple transparent blur background instead
- Remove negative margins that broke rounded corners on mobile
2026-03-23 11:23:44 +03:00
Fringg
38b0f4be9a fix: add news link to admin panel, prevent empty news section flash
- Add News item to marketing group in AdminPanel with NewspaperIcon
- Add news nav/panel translations for all 4 locales (ru, en, zh, fa)
- Don't render NewsSection until query confirms articles exist
- Remove skeleton that caused brief flash when news list is empty
2026-03-23 11:21:25 +03:00
Fringg
74e6d52fee fix: news feature security, accessibility, performance improvements
- DOMPurify strict allowlist with sandbox on iframes
- safeColor() CSS injection prevention for category_color
- URL validation (http/https) for images and links
- encodeURIComponent for slug in API calls
- Keyboard navigation on news cards (Enter/Space)
- aria-label, aria-pressed, type=button on all buttons
- 44px touch targets on remaining buttons
- memo() wrappers + stable callbacks (fewer re-renders)
- Canvas draw call batching (~75% reduction)
- TipTap extensions useMemo deps fix ([t] -> [])
- Featured image loading=eager fetchPriority=high (LCP)
- Unsafe Number(id) NaN guard
2026-03-23 11:09:52 +03:00
Fringg
99fc33625e feat: add news section with admin editor and public article view
- NewsSection with animated grid background, category filters, featured cards
- AdminNews list page with toggle publish/featured, pagination
- AdminNewsCreate with TipTap rich text editor, URL validation
- NewsArticle detail page with DOMPurify sanitization, Telegram back button
- Toggle component with WCAG 44px touch targets, role=switch
- Prose styles for highlight marks and responsive iframes
- i18n translations (en, ru, zh, fa)
2026-03-23 10:49:46 +03:00
Egor
eea3b6c269 Merge pull request #343 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.41.0
2026-03-22 10:56:31 +03:00
github-actions[bot]
be9c28cd14 chore(main): release 1.41.0 2026-03-22 07:56:07 +00:00
Egor
39c0d11962 Merge pull request #342 from BEDOLAGA-DEV/dev
Dev
2026-03-22 10:55:40 +03:00
Fringg
5b12784ab8 feat: show subscription revenue and referral earnings in network stats
Add subscription revenue (total from subscription payments) to the
stats panel alongside referral earnings. Layout updated to 2-column
grid with subscription revenue highlighted in accent color.
2026-03-22 10:31:29 +03:00
Fringg
ebe2c3af7e fix: use dark label color on hover (white bg), light on normal (dark bg)
Switch labelColor to attribute-based mode so hovered/highlighted nodes
get dark text (#111827) readable on the white hover background, while
normal labels stay light (#e5e7eb) readable on the dark canvas.
2026-03-22 10:26:16 +03:00
Fringg
0cc1cd5871 fix: use light label color for graph nodes on dark background 2026-03-22 10:18:34 +03:00
Fringg
2229eeecb0 fix: remove campaignUser fill color — campaign membership shown via edges
Campaign users no longer get a separate amber fill color. Their campaign
association is already visible through the edge connecting them to the
campaign node. Users from campaigns now show their subscription status
color (or regular gray if no subscription), reducing visual noise.
2026-03-22 10:13:56 +03:00
Fringg
2436060b5a fix: use white campaign edges to avoid blending with trial expired nodes 2026-03-22 10:08:42 +03:00
Fringg
2a57442e04 fix: make trial, campaign, and no-subscription node colors distinct
- campaignUser: #4dd9c0 (teal) → #fbbf24 (amber) — no longer blends with trial blue
- regular: #6b7280 (gray) → #94a3b8 (slate) — visible on dark background
- Campaign edges updated to amber tint
- defaultNodeColor now references NODE_COLORS.regular instead of hardcoded value
- Legend gradient uses actual campaign palette colors
2026-03-22 10:02:17 +03:00
Fringg
cc64f7b8ea fix: rename "Regular user" to "No subscription" in legend
The gray color in the referral network legend represents users without
a subscription, not "regular/organic" users. Updated labels in all
4 locales (en, ru, fa, zh) to reflect this.
2026-03-22 09:51:43 +03:00
Fringg
5a92484912 fix: add fill border to node-border program config
The createNodeBorderProgram was missing the second border entry
with { size: { fill: true }, color: { attribute: 'color' } }
which renders the node's fill color. Without it, node bodies
were transparent and only edges were visible.
2026-03-22 09:39:19 +03:00
Fringg
61ca5cc53d fix: fallback to referral role fill color when subscription_status is null
When subscription_status is not available (backend not deployed or user
has no subscription), fill color now falls through to referral role
(partner/topReferrer/activeReferrer) before defaulting to campaign/regular.
Increases border size from 0.25 to 0.35 and merges legend sections.
2026-03-22 09:32:53 +03:00
Fringg
b18f3fb211 feat: add fill+border dual-color nodes, radial layout, and dark labels
Node fill color now encodes subscription status (paid/trial active/expired),
while border color indicates referral role (partner/top/active referrer).
Added BFS-based radial initial positioning to spread referral branches outward.
Updated legend with two sections and adjusted FA2 gravity for less clustering.
2026-03-22 09:25:23 +03:00
Fringg
b289ea9c23 feat: color-code referral network nodes by subscription status
Add subscription status colors: green (paid active), blue (trial active),
red (paid expired), orange (trial expired). Extract NODE_COLORS constant
as single source of truth. Add SubscriptionStatus union type. Show status
badge in user detail panel. Add i18n for all 4 locales.
2026-03-22 09:07:32 +03:00
Fringg
8e59af96c5 fix: superadmin assignments show ENV badge, block UI revoke
Superadmin role (level 999) is managed via env config only. Hide X
button for superadmin assignments and show ENV badge instead. Filter
superadmin from assignable roles dropdown. Add envManaged translation
to all 4 locales.
2026-03-22 08:41:41 +03:00
Egor
15f13d8682 Merge pull request #340 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.40.0
2026-03-22 07:36:23 +03:00
github-actions[bot]
cb14f18d21 chore(main): release 1.40.0 2026-03-22 04:36:05 +00:00
Egor
b433149fb7 Merge pull request #339 from BEDOLAGA-DEV/dev
Dev
2026-03-22 07:35:31 +03:00
Fringg
3e27472c8a fix: clear all cached auth state on Telegram MiniApp retry
When users hit 'Try Again' after auth failure, clear ALL cached state
(tokens, SDK launch params, initData, zustand persist, tg_user_id)
to prevent stale token loops. Applies to both Login and TelegramRedirect
retry handlers.
2026-03-22 07:24:45 +03:00