Skip to content

Conversation

@Maphikza
Copy link
Member

Advanced Settings Implementation and Node.js v23 Compatibility

Overview

This PR implements a comprehensive advanced settings system for the HORNETS-Relay-Panel, along with critical fixes for Node.js v23 compatibility and several UI improvements.

Key Features

Generic Settings System

  • Added useGenericSettings hook to provide a unified approach for handling all types of relay settings
  • Implemented proper synchronization between prefixed and unprefixed settings keys
  • Fixed issues with settings persistence and backend compatibility

Advanced Settings Layout

  • Created a new AdvancedSettingsLayout component to organize complex settings panels
  • Implemented consistent UI patterns across all settings components
  • Added proper form validation and error handling

Node.js v23 Compatibility

  • Fixed OpenSSL 3.0 compatibility issues by adding legacy provider flag
  • Modified package.json scripts to include NODE_OPTIONS=--openssl-legacy-provider
  • Created environment variables to ensure global application of compatibility settings
  • Updated browserslist database to address outdated caniuse-lite data

UI Improvements

  • Fixed settings form editing issues with isUserEditing state flag
  • Improved form state management to prevent accidental data loss
  • Enhanced user feedback during settings changes
  • Fixed TypeScript errors in notification components

Technical Details

Settings Synchronization Fix

  • The API returns settings with unprefixed keys (like mode: "full"), but the form uses prefixed keys (like image_moderation_mode)
  • When a user changed a setting, only the prefixed version was updated, causing settings to revert on reload
  • Updated the useGenericSettings hook to sync prefixed and unprefixed values
  • Now when a prefixed setting is changed, the corresponding unprefixed setting is also updated

Backend Compatibility Fix

  • The backend expects settings with unprefixed keys (like mode, api, etc.)
  • Fixed the saveSettings function to extract only the unprefixed keys before sending to the backend
  • Ensured that the backend receives settings in the expected format

Partial Settings Update Fix

  • Fixed an issue where modifying one setting would send empty values for other settings
  • Simplified the saveSettings function to transform all prefixed keys to unprefixed keys
  • Now sends the complete set of values to the backend, preserving all settings

Testing

  • Verified settings persistence across page reloads
  • Tested compatibility with Node.js v23.6.1
  • Confirmed proper functioning of all settings panels

Maphikza added 16 commits April 19, 2025 16:27
This commit includes:
- New API endpoints for viewing and unblocking moderated events
- Enhanced ModerationNotifications component with event details modal
- Unblock button for false positives in moderation system
- Scroll position reset after event deletion
- Updated BaseModal to use 'open' prop instead of deprecated 'visible' prop
This commit includes:
- Implementation of moderation mode feature in relay settings
- Addition of strict and passive mode options
- Improved text color contrast for better readability on dark backgrounds
- Integration with existing relay settings UI
- Add TypeScript interfaces for all settings groups
- Create useGenericSettings hook for unified settings management
- Implement BaseSettingsForm component for consistent UI
- Create components for all settings groups:
  - ContentFilterSettings
  - NestFeederSettings
  - OllamaSettings
  - WalletSettings
  - GeneralSettings
  - RelayInfoSettings
  - QueryCacheSettings
  - XNostrSettings (with complex nested settings)
- Update AppRouter with new settings routes
- Modify useRelaySettings to use the generic hook
- Restore original useRelaySettings.ts implementation
- Add new 'Advanced Settings' entry to sidebar navigation
- Remove relay settings from SettingsPage component
- Update SettingsNavigation to remove relay settings tab
- Keep relay settings and generic settings completely separate
…yer. This resolves the issue where image moderation and other settings values weren't displaying properly in the advanced settings panels.
…issues

- Simplify moderation mode options to three (Basic, Strict, Full)
- Add detailed descriptions for each mode with focus, performance, and use cases
- Fix property name transformation between unprefixed backend keys and prefixed UI keys
- Fix ESLint errors by escaping quotes in JSX text
- Ensure UI correctly displays values from the backend

Known issue: When modifying a single setting, other values may become undefined when saving.
This needs further investigation to better preserve existing values during save operations.
When updating individual fields in advanced settings panels like image moderation, ensure all other field values are preserved. The fix maintains proper field prefix handling when saving to the backend API.
- Added isUserEditing state to track when user is actively editing a form
- Prevented form values from being overwritten during editing
- Fixed issues in ContentFilterSettings, NestFeederSettings, OllamaSettings, XNostrSettings, WalletSettings, and panel components
- Added custom save/reset handlers to manage editing state properly
@f7f376a1fcd0d0e11a10ed1b6577c9 f7f376a1fcd0d0e11a10ed1b6577c9 merged commit ca1e0c4 into main May 13, 2025
1 of 2 checks passed
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