Overview
Settings are organized into sections accessible through a sidebar navigation (/pages/Settings/SettingsPage.jsx). Each section manages specific aspects of the application:
- Home - Quick access to frequently used settings
- Security - 2FA, sessions, and activity logs
- Appearance - Theme and visual customization
- Language & Region - Localization and formatting
- Accessibility - Accessibility features
- About - System information and version
Architecture
Settings use a context-based architecture with optimistic updates:- Lazy-loaded sections for performance
- Optimistic UI updates with automatic rollback on error
- Section-based saves (partial updates)
- Real-time synchronization with backend
Security Settings
Two-Factor Authentication (2FA)
Enable 2FA to add an extra layer of account security.Scan QR Code
A modal opens displaying:
- QR code for authenticator apps (Google Authenticator, Authy, etc.)
- Manual entry code as backup
Login Alerts
Enable email notifications when your account is accessed from a new device:Send email alerts for new login sessions
- Device information
- IP address
- Location (if available)
- Timestamp
Active Sessions
View and manage all active login sessions across devices. Session Information Displayed:- Device type (laptop/mobile) with icon
- Device name and browser
- IP address
- Last active timestamp
- Current session indicator
- Scroll to Active Sessions section
- Click Revoke All Other Sessions button
- Confirm the action
This feature is useful if you suspect unauthorized access or left yourself logged in on a public computer.
Activity Logs
View recent account activity in a scrollable table:| Column | Description |
|---|---|
| Action | What was performed (e.g., “Login”, “Password Changed”) |
| Device | Device information or IP address |
| Date | When the action occurred |
- Skeleton placeholders during data fetch
- “No recent activity” message if empty
Appearance Settings
Customize the visual appearance of the application:Choose between Light, Dark, or System (follows OS preference)
Primary color scheme for the interface
UI density: Comfortable, Compact, or Spacious
Base font size: Small, Medium, or Large
Language & Region Settings
Configure localization and formatting preferences:Interface language (e.g., “es-HN” for Spanish Honduras, “en-US” for English)
Timezone for timestamp display (default: “America/Tegucigalpa”)
Date format:
DD/MM/YYYY(31/12/2023)MM/DD/YYYY(12/31/2023)YYYY-MM-DD(2023-12-31)
Time format:
12h(3:00 PM)24h(15:00)
Accessibility Settings
Enhance usability for users with specific needs:Enable high contrast mode for better visibility
Minimize animations and transitions
Optimize interface for screen readers
Enhanced keyboard navigation support
Settings Context API
TheSettingsContext provides a powerful API for managing settings:
Using Settings Context
Context Properties
Complete settings object with all sections
True while initial settings are being loaded
Function to save a specific settings section:
Object tracking save state per section:
Force reload all settings from server
Saving Settings
Settings are saved using section-based partial updates:Deep Merge Strategy
Settings use a custom deep merge for nested updates:Settings Service API
Get All Settings
Get Single Section
Update Section
Get Security Data
Revoke Sessions
Section Configuration
Settings sections are lazy-loaded for optimal performance:Permission Requirements
Some settings require specific permissions:| Setting | Required Permission |
|---|---|
| Edit any setting | editar_configuraciones or Admin role |
| View settings | All authenticated users |
Error Handling
Save Failures
When a save fails:- Optimistic changes are rolled back
- Error toast is displayed
- Previous state is restored
- User can retry the save
Load Failures
If settings fail to load:- Error message is logged to console
- Default values are used
- User can manually trigger reload
Best Practices
Settings Management Tips
- Test Theme Changes: Preview in different lighting conditions
- Document Custom Settings: Keep notes on non-default configurations
- Regular Backups: Export settings before major changes
- Session Management: Revoke sessions periodically for security
- Activity Monitoring: Review logs regularly for suspicious activity
Troubleshooting
Settings Not Saving
- Check network connection
- Verify you have
editar_configuracionespermission - Look for error toasts with specific messages
- Check browser console for API errors
- Try refreshing the page and reapplying changes
2FA Setup Issues
- Ensure time is synchronized on your device
- Try manual code entry instead of QR scan
- Use a compatible authenticator app
- Contact support if verification repeatedly fails
Language Not Changing
- Verify language pack is available
- Clear browser cache
- Check if translation files are loaded (console)
- Reload the page if change doesn’t apply immediately
Session Revocation Not Working
- Verify you’re not trying to revoke the current session
- Check if other sessions are actually active
- Wait a moment and refresh the sessions list
- Verify API endpoint is accessible
Related Pages
- User Management - Manage user accounts
- Permissions - Configure access control
- Locations - Manage geographic data