-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/api migration and personal mode #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
f7f376a1fcd0d0e11a10ed1b6577c9
merged 17 commits into
main
from
feature/api-migration-and-personal-mode
Jun 24, 2025
Merged
Feature/api migration and personal mode #48
f7f376a1fcd0d0e11a10ed1b6577c9
merged 17 commits into
main
from
feature/api-migration-and-personal-mode
Jun 24, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
Update relay count endpoint from /api/relaycount to /api/relay/count and remove commented code.
- Migrate useRelaySettings and useChartData hooks to new backend API structure - Add core kinds protection system to prevent removal of essential event types - Implement file size limit controls for photos, videos, and audio - Add FileSizeLimitInput component with proper theme integration - Update MediaSection to include configurable file size inputs - Create transformation functions for new backend settings format - Support dynamic media types and chart data from backend configuration - Add TypeScript interfaces for new API structure
- Redesign FileSizeLimitInput with compact horizontal layout - Move file size controls to bottom of each media section for better UX flow - Reduce component footprint with smaller margins and inline design - Fix theme integration using CSS variables instead of props.theme - Remove unused description prop and simplify component interface - Improve visual hierarchy: toggle → formats → size limits
- Update RelayInfoSettings.tsx to use tags mode for custom NIP support - Add number conversion logic to ensure NIPs are sent as numbers to backend - Enhance useGenericSettings.ts with comprehensive field mapping for all groups - Remove query_cache from settings types as it's no longer used
- Fix image moderation and wallet settings to use prefixed fields directly - Add comprehensive field mapping for wallet, general, and image moderation settings - Remove query cache panel from advanced settings layout - Update general settings to read from both server and relay sections - Ensure proper bidirectional field mapping for all settings groups
- Delete NestFeederSettings.tsx and QueryCacheSettings.tsx files - Remove nest feeder and query cache from SettingsPage.tsx navigation - Remove from SettingsNavigation.tsx tabs array - Remove nest feeder logic from useGenericSettings.ts hook - Remove from settings type definitions - Clean up unused imports (DatabaseOutlined, ApiOutlined) - Update advanced settings layout to exclude removed components
- Remove NestFeederPanel.tsx and QueryCachePanel.tsx to fix TypeScript errors - Fix relay info pubkey mapping to use 'public_key' from backend - Update reverse mapping for saving relay pubkey correctly - Remove default empty value for pubkey since it exists in backend
- Fix TypeScript error in allowedUsers.api.ts with proper type casting - Update API endpoints to use unified /api/settings endpoint - Update response parsing for new nested settings.allowed_users structure - Update request format to send data in settings.allowed_users structure - Add new 'personal' mode for single-user private relays - Update mode labels for better clarity: * free -> 'Free - Public Relay' * paid -> 'Paid - Subscription Tiers' * exclusive -> 'Free - Invite Only' * personal -> 'Free - Only Me' (NEW) - Add personal mode configuration with unlimited access and NPUB management - Update API logic to handle personal mode like free mode for tier filtering
- Update useRelaySettings.ts to send correct field names (mime_patterns, max_size_mb) - Add backward compatibility for reading both old and new field names - Add comprehensive logging to useChartData.ts to debug media count issues - Ensure media definitions are always sent with complete structure to avoid backend conflicts
- Add tierConversion utility with MB/GB/TB conversion and validation
- Create TierEditor component with number input + unit dropdown
- Update AllowedUsersTier to use price_sats and monthly_limit_bytes
- Migrate DEFAULT_TIERS to new format with proper byte values
- Update API layer to send/receive new backend format
- Fix all TypeScript errors in tier management components
- Add validation for 1MB-1TB range and unlimited tiers
- Maintain backward compatibility during transition
Backend format: {name, price_sats, monthly_limit_bytes, unlimited}
Frontend UI: User-friendly number + unit selection with real-time validation
- Change from horizontal layout to 2x2 grid for better visual organization - Update button labels and order to match design: Only Me, Invite Only, Public Relay, Subscription - Increase button height to 80px to properly accommodate two-line text - Add proper flexbox layout to prevent text overlapping - Improve typography with larger main labels and smaller subtitle text - Maintain existing colors and functionality while improving layout Layout: Top row (Only Me, Invite Only), Bottom row (Public Relay, Subscription)
…oding - Add working View All button functionality with modal display - Implement horizontal list layout for better scrolling through many subscribers - Use proper nostr-tools nip19.npubEncode() for correct npub format display - Add fallback to original hex format if encoding fails - Improve visual design with larger avatars, better shadows, and modern card styling - Remove loading spinner that was blocking content display - Enhance hover effects and typography for better user experience Each subscriber now displays with avatar, name, and properly formatted npub/hex
f7f376a1fcd0d0e11a10ed1b6577c9
approved these changes
Jun 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
API Migration and Personal Mode Enhancement
🎯 Summary
This PR migrates the allowed users system to use the new unified backend API endpoints and introduces a new
"Personal Mode" for single-user private relays. It also improves mode labels for better user clarity.
🔧 API Migration Changes
Endpoint Updates
~/api/settings/allowed_users→~/api/settings~/api/settings/allowed_users→~/api/settingsData Structure Changes
data.settings.allowed_userssettings.allowed_usersstructureError Handling
🆕 New Personal Mode
"Free - Only Me" Mode
Configuration