Update Dec. 5th#121
Merged
Deodat-Lawson merged 12 commits intostablefrom Dec 14, 2025
Merged
Conversation
This PR significantly improves the accessibility of the chat interface by adding comprehensive ARIA labels, implementing keyboard shortcuts, and enhancing screen reader support. ## Changes ### ARIA Labels & Screen Reader Support **Chat Container** - Added `role="region"` and `aria-label` to main chat interface - Added `role="log"` with `aria-live="polite"` to message container for dynamic message announcements - Added `role="status"` with `aria-live="polite"` to loading indicator **Interactive Elements** - Added `aria-label` to all buttons (upvote, downvote, tools, send) - Added `aria-hidden="true"` to decorative icons - Added `type="button"` to prevent form submission on action buttons - Added `role="group"` with `aria-label` to message action buttons - Added `role="menu"` and `role="menuitem"` to tools dropdown - Added `aria-expanded` and `aria-haspopup` to tools toggle button **Form & Input** - Added `aria-label` to form and textarea - Added `aria-multiline="true"` to textarea - Added `role="alert"` with `aria-live="assertive"` to error messages - Enhanced placeholder text with keyboard shortcut hints ### Keyboard Navigation **Escape Key** - Press `Escape` to close the tools menu when open - Press `Escape` to clear the input field when tools menu is closed - Auto-focuses textarea after clearing **Enter Key** - Existing: Send message with `Enter` (Shift+Enter for new line) - Now properly documented in UI with tooltip ### UX Improvements - Fixed textarea overflow by changing from `overflow: hidden` to `overflow-y: auto` - Enhanced tooltips with keyboard shortcut information - Improved placeholder text to include "(Press Escape to clear)" - Better visual feedback for screen reader users ## Testing Tested with: - ✅ VoiceOver (macOS) - All interactive elements properly announced - ✅ Keyboard-only navigation - All features accessible without mouse - ✅ NVDA screen reader simulation - Proper role and state announcements - ✅ Chrome DevTools Accessibility Inspector - No violations detected - ✅ Manual keyboard testing - Escape and Enter shortcuts working correctly ## Accessibility Standards This PR follows WCAG 2.1 Level AA guidelines: - **1.3.1 Info and Relationships**: Proper semantic structure with ARIA - **2.1.1 Keyboard**: Full keyboard accessibility - **4.1.2 Name, Role, Value**: All UI components properly labeled ## Impact These improvements make the chat interface: - Fully navigable with keyboard only - Compatible with screen readers - More discoverable for all users (keyboard shortcuts in UI) - Compliant with modern accessibility standards No breaking changes - purely additive accessibility enhancements.
Implemented a comprehensive rate limiting system to protect against API abuse and control costs for expensive AI operations. Features: - Token bucket algorithm for smooth rate limiting - In-memory store with automatic cleanup - Standard rate limit headers (X-RateLimit-*) - Multiple rate limit presets (standard, strict, permissive, burst) - IP-based rate limiting with support for various proxy headers - Custom key generators and skip functions - Comprehensive test coverage Applied rate limiting to: - /api/AIAssistant (20 req/15min) - AI chat with embeddings - /api/uploadDocument (20 req/15min) - Document upload with OCR - /api/predictive-document-analysis (20 req/15min) - AI analysis Benefits: - Protects against API cost overruns - Prevents abuse and DoS attacks - Professional API design with standard headers - Easy to extend with Redis for distributed systems Technical implementation: - src/lib/rate-limiter.ts: Core rate limiting logic - src/lib/rate-limit-middleware.ts: Next.js middleware helpers - Comprehensive unit tests for both modules - Clean integration with existing API routes
…a-into-multiple-files Split Drizzle schema into modular files
…ents Enhance accessibility with ARIA labels and keyboard navigation
Add API rate limiting for expensive operations
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
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.
No description provided.