Skip to content

Conversation

@rileyseaburg
Copy link
Contributor

This pull request introduces enhancements to the drag-and-drop functionality in a form builder, improving user experience and error handling. Key updates include new styles for draggable elements, better error handling in sortable operations, and the initialization of sortable functionality for various components such as questions, question options, and sections.

Drag-and-Drop Enhancements:

  • New styles for draggable elements:

    • Added .sort-placeholder and .drag-handle styles to improve the visual appearance of sortable elements. These include dashed borders, background colors, and cursor changes for drag states. (app/assets/stylesheets/site.scss, app/assets/stylesheets/site.scssR373-R390)
  • Improved error handling for sortable operations:

    • Wrapped sortable initialization and update logic in try-catch blocks to handle potential errors gracefully.
    • Added specific error messages for missing data or failed AJAX requests, along with visual feedback (e.g., animating items back to their original position on failure). (app/views/components/forms/edit/_builder.html.erb, app/views/components/forms/edit/_builder.html.erbR262-R361)

Initialization of Sortable Components:

- Enhanced sortable initialization with error handling
- Added visual feedback for drag operations
- Fixed sort icons rendering issue
- Added proper placeholder styling
- Improved drag handle functionality
- Added XHR request failure recovery

Resolves form question ordering widget issues in Form Builder interface.
@rileyseaburg rileyseaburg merged commit f2fd389 into main May 23, 2025
8 checks passed
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.

2 participants