Skip to content

Conversation

@Maphikza
Copy link
Member

This PR implements a comprehensive migration from the legacy subscription system to a new allowed users
management system with mode-specific tier configurations. The changes align the frontend with recent backend
changes that moved subscription tiers from relay_settings to allowed_users configuration.

Key Changes

🗑️ Removed Legacy Components

  • SubscriptionTiersManager: Obsolete subscription tier management component
  • SubscriptionSection: Legacy subscription configuration section
  • Cleaned up all related imports and prop passing

🔧 Enhanced Allowed Users System

  • Mode-specific tier defaults: Added separate configurations for free, paid, and exclusive modes
  • Free mode logic: Implemented radio button selection with only one active tier at a time
  • API optimization: Only sends active tier to backend for free mode, reconstructs UI options on load
  • Exclusive mode permissions: Added "All Users" option for write access alongside "Allowed Users"

🎨 UI/UX Improvements

  • Unified user management: Redesigned NPubManagement from inefficient tabs to single table with toggle
    controls
  • Enhanced switch visibility: Improved styling for better off-state visibility in dark theme
  • Better error handling: Added proper error catching with user-friendly messages
  • Immediate saves: User management operations now save immediately vs batched saves for settings

🧹 Code Cleanup

  • Removed subscription-related fields from relay settings types and hooks
  • Updated layout components to remove subscription props
  • Fixed TypeScript/ESLint errors for better code quality
  • Cleaned up unused imports and references

Testing

  • ✅ All three modes (free, paid, exclusive) work correctly
  • ✅ Free mode tier selection functions properly with radio buttons
  • ✅ User management with immediate saves works as expected
  • ✅ Build passes without errors
  • ✅ TypeScript/ESLint compliance maintained

Breaking Changes

This PR removes the legacy subscription management system. Ensure the backend changes for the allowed users
system are deployed before merging this PR.

Migration Notes

  • Subscription configuration has moved from relay settings to allowed users management
  • Free mode now uses a single active tier selection instead of multiple tiers
  • User permissions are now managed through the unified allowed users interface

Maphikza added 5 commits June 18, 2025 14:01
- Implement free, paid, and exclusive modes with distinct tier configurations
- Add mode-specific default tiers (free: 100MB-1GB, paid: 1-10GB with pricing, exclusive: 2-25GB)
- Create comprehensive allowed users page with permissions and tier management
- Add API integration for allowed users settings and NPUB management
- Implement tier validation and automatic price handling per mode
- Add navigation and routing for allowed users functionality
- Apply dark background (#25284B) with light text (#d9d9d9) for better readability
- Maintain visual consistency across all alert components
- Improve contrast and accessibility for notification messages
- Replace separate read/write tabs with single unified table
- Add read/write access toggle switches for instant permission management
- Enhance add user modal with permission selection toggles
- Improve bulk import to support permission flags (r/w/rw)
- Update export format to include permission information
- Streamline user experience - manage all permissions from one view
- Add 'All Users' option to exclusive mode write access for more flexibility
- Create custom styled switches with better visibility in off state
- Use dark gray background (#434343) for unchecked switches instead of faded appearance
- Add proper styling for loading and disabled switch states
- Improve user experience in both table view and modal forms
- Maintain excellent appearance of checked/on state while making off state clearly visible
…system

- Remove SubscriptionTiersManager and SubscriptionSection components
- Clean up relay settings layouts to remove subscription props
- Update allowed users API to handle free mode tier selection
- Improve NPubManagement component with better error handling
- Enhance TiersConfig with radio button selection for free mode
- Clean up relay settings types and hooks
@f7f376a1fcd0d0e11a10ed1b6577c9 f7f376a1fcd0d0e11a10ed1b6577c9 merged commit f30f26d into main Jun 24, 2025
2 checks passed
@AnthonyMarin AnthonyMarin deleted the feature/allowed-users branch June 26, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants