Skip to content
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

Add update-ui tool with synchronous UI action handling #9

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

wesen
Copy link
Contributor

@wesen wesen commented Feb 27, 2025

This PR introduces a synchronous UI update system that waits for user actions
before completing requests, making it easier to build interactive applications.

Key changes:

  • Refactored UI handling into a dedicated UIHandler struct for better
    organization
  • Added a wait registry to track pending UI requests using channels
  • Implemented request ID tracking between UI updates and user actions
  • Added automatic UI reset after a completed request
  • Added a click-submit detection mechanism with configurable delay (200ms)
  • Enhanced error handling with detailed error responses
  • Updated JavaScript to track and pass request IDs with actions
  • Added documentation on the form submission model and best practices
  • Fixed heredoc string handling in shell scripts to prevent expansion errors

UI system improvements:

  • Made IDs optional for title, text, and list components
  • Improved validation for list items
  • Added request timeout handling (default 120 seconds)
  • Added background cleanup for orphaned requests
  • Enhanced logging for better debugging
  • Added resolved status in action responses

@wesen wesen merged commit 0e48a4a into go-go-golems:main Feb 27, 2025
2 checks passed
@wesen wesen deleted the task/add-ui-server-update-ui branch February 27, 2025 21:17
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.

1 participant