This document describes the enhancements made to the new-contact page (src/app/new-contact/page.tsx) to improve the user experience for amateur radio operators.
Added comprehensive validation with visual feedback for critical fields:
- Callsign Validation: Validates amateur radio callsign format using regex pattern
^[A-Z0-9]{1,3}[0-9][A-Z0-9]{0,3}[A-Z]$ - Grid Locator Validation: Validates Maidenhead grid locator format (4 or 6 character format)
- Frequency Validation:
- Checks frequency range (0.1 to 300000 MHz)
- Validates that frequency is within amateur radio bands
- Provides clear error messages for out-of-band frequencies
Visual Feedback: Invalid fields show red borders and error messages with alert icons.
Automatically sets appropriate RST values based on the selected mode:
- CW Mode: Sets RST to "599" (standard CW report)
- Voice Modes (SSB, FM, AM): Sets RST to "59" (standard voice report)
- Digital Modes (FT8, FT4, PSK31, etc.): Sets RST to "-10" (signal-to-noise ratio)
This follows amateur radio best practices and reduces manual input errors.
Improved visual organization with logical field grouping:
- Contact Information: Callsign, frequency, mode, band
- Date & Time: DateTime field with live logging functionality
- Signal Reports: RST sent/received with mode-specific hints
- Station Information: Name, QTH, grid locator
Each section has clear headers with visual separators for better readability.
Added keyboard shortcuts for efficient logging:
- Ctrl+Enter: Save contact (quick submit)
- Ctrl+L: Focus callsign field (quick start new contact)
- Ctrl+Q: Trigger QRZ lookup (quick callsign lookup)
These shortcuts are displayed in a help section at the bottom of the form.
Improved error handling and user feedback:
- Real-time validation prevents submission of invalid data
- Clear error messages with specific guidance
- Visual indicators for validation state
- Prevention of form submission with validation errors
- Better ARIA labeling for screen readers
- Clear visual hierarchy with proper heading structure
- Keyboard navigation support
- High contrast error indicators
- Responsive design for mobile amateur radio logging
const validateCallsign = (callsign: string): string | null
const validateGridLocator = (grid: string): string | null
const validateFrequency = (frequency: string): string | nullValidation occurs on field change using the validateField function, updating the validationErrors state for immediate feedback.
The handleSelectChange function includes logic to automatically adjust RST values when the mode changes, following amateur radio conventions.
Implemented using a global keydown event listener that handles key combinations and focuses appropriate form elements.
- All existing contact management tests pass
- New enhancement-specific tests validate responsive design and code compilation
- Build process validates TypeScript compilation and linting
The enhanced contact page maintains full backward compatibility while adding new features. All existing functionality continues to work as expected.
- Reduced Logging Errors: Real-time validation prevents common amateur radio data entry mistakes
- Faster Logging: Keyboard shortcuts and auto-fill features speed up contact entry
- Better Organization: Logical field grouping matches typical amateur radio logging workflow
- Mobile-Friendly: Enhanced responsive design supports field day and portable operations
- Standards Compliance: Validation ensures data follows amateur radio conventions
- Contest logging fields (exchange, contest name)
- Duplicate contact detection and warnings
- Integration with propagation prediction data
- Quick logging templates for different operating modes
- Integration with real-time DX cluster data