-
Notifications
You must be signed in to change notification settings - Fork 0
Add settings modal to React example #8
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
Merged
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
- Create SettingsModal component with form validation - Add localStorage utilities for settings persistence - Implement SettingsContext for state management - Add first-visit detection to auto-open modal - Include navigation button to reopen settings - Display current settings in the UI - Add comprehensive CSS styling with dark mode support - Fix TypeScript configuration for Node.js types
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
- Add 'jest' to types array in tsconfig.json - Resolves CI test failures by providing Jest type definitions
- Add agent-server API key field to settings modal - Create ServerStatus component with real-time health checks - Implement server connectivity and LLM configuration validation - Add auto-refresh functionality for status monitoring - Update settings interface to include agentServerApiKey - Add comprehensive error handling and user guidance - Include CSS styling with light/dark mode support Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
- Improve logic in getServerStatus to properly handle different scenarios: - Not configured: when API key or model name is missing - Cannot test: when settings are configured but server is unreachable - Working/Error: when server is reachable and can test LLM configuration - Add workspace field to testLLMConfiguration API request to fix 422 error - Now shows 'Cannot test LLM configuration - server not reachable' instead of 'Not configured' when server is offline but settings are present Co-authored-by: openhands <openhands@all-hands.dev>
- Fix 422 error by adding required working_dir field to workspace object - This completes the API request structure for conversation creation Co-authored-by: openhands <openhands@all-hands.dev>
- Change from conversationData.conversation_id to conversationData.id - Add validation to ensure conversation ID exists before proceeding - This fixes the 'undefined' conversation ID issue in message posting Co-authored-by: openhands <openhands@all-hands.dev>
- Change message endpoint from /api/conversations/{id}/messages to /events
- Add conversation_id field to the request body as required by /events endpoint
- This aligns with the correct API specification for sending messages
Co-authored-by: openhands <openhands@all-hands.dev>
- Replace raw fetch calls with HttpClient from the SDK for health checks - Use RemoteConversation.create() for LLM configuration testing - Properly use SDK's sendMessage() method without run parameter - This provides better consistency, error handling, and tests the SDK itself - Maintains the same functionality while using the proper SDK APIs Benefits: - More maintainable code using our own SDK - Better error handling through SDK's HttpClient - Actually tests the SDK functionality in the health checks - Consistent with the SDK's design patterns Co-authored-by: openhands <openhands@all-hands.dev>
- Remove server status and current settings from homepage for cleaner UI - Add current configuration display to settings modal showing all settings - Add server status component inside settings modal with health checks - Increase modal width to accommodate additional content - Add proper styling for settings status section with light/dark mode support - Clean up unused CSS from App.css This provides a cleaner homepage while keeping all configuration-related information organized in one place within the settings modal. Co-authored-by: openhands <openhands@all-hands.dev>
- Remove 'LLM Configuration Issues?' troubleshooting section - Remove static 'Current Configuration' display in favor of input fields - Reduce modal width from 600px to 500px - Decrease padding, margins, and font sizes throughout - Make ServerStatus component more compact - Improve space efficiency while maintaining readability
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.
Summary
This PR adds a comprehensive settings modal to the React example application that allows users to configure their agent server URL, model name, and API key. The modal automatically opens on first visit and provides persistent storage of settings.
Features Added
🎯 Core Components
🚀 User Experience
🎨 Design & Styling
🔧 Technical Improvements
Implementation Details
Settings Modal Component
State Management
File Structure
Testing
The implementation has been tested with:
Screenshots
The modal provides a clean, professional interface for configuring OpenHands agent settings, making it easy for users to get started with the SDK.
Breaking Changes
None - this is a purely additive feature to the example application.
Related Issues
This addresses the need for a user-friendly way to configure agent settings in the React example, making it easier for developers to test and integrate the OpenHands TypeScript SDK.
@rbren can click here to continue refining the PR