这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@balanceiskey
Copy link
Contributor

@balanceiskey balanceiskey commented Sep 2, 2025

What problem(s) was I solving?

Fixed two critical UI issues with the ResponseEditor component:

  1. TipTap editor crashes would break the entire session interface, requiring a page reload
  2. Send button had visual dead space when disabled and lacked smooth transitions when toggling states

Related issues:

  • ENG-2044: Slap error boundary on TipTap - better logging/rendering in UI

What user-facing changes did I ship?

Error Handling

  • TipTap editor now gracefully handles errors instead of crashing the entire interface
  • Shows "Editor unavailable" message with error details when the editor fails
  • Users can still view sessions even if the editor encounters issues
  • Error details are logged for debugging

Send Button Improvements

  • Removed dead space when button is disabled (keyboard shortcut now completely hidden)
  • Added smooth width animation (200ms transition) when button state changes
  • Button smoothly expands/contracts as keyboard shortcut appears/disappears
  • Cleaner, more polished interface with no wasted space

How I implemented it

Error Boundary Component (ResponseEditorErrorBoundary.tsx)

  • Created React class component implementing Error Boundary pattern
  • Catches errors from TipTap editor and prevents propagation
  • Logs errors to console for debugging
  • Displays user-friendly fallback UI with error message
  • Uses AlertCircle icon to indicate editor unavailability

ResponseInput Integration

  • Wrapped ResponseEditor with ResponseEditorErrorBoundary component
  • Maintains all existing functionality while adding error protection
  • No changes to editor behavior when functioning normally

Send Button Animation Fix

  • Changed from invisible class (preserves space) to conditional rendering
  • Added transition-all duration-200 for smooth width animations
  • Keyboard shortcut (⌘+Enter or Ctrl+Enter) only renders when button is enabled
  • Button width smoothly animates between enabled/disabled states

How to verify it

  • I have ensured make check test passes

Manual Testing

  1. Test Error Boundary:

    • Trigger an error in the TipTap editor (e.g., corrupt localStorage data)
    • Verify "Editor unavailable" message appears instead of white screen
    • Check that error details are logged to console
    • Confirm rest of session interface remains functional
  2. Test Send Button Animation:

    • Type text in ResponseEditor to enable Send button
    • Verify keyboard shortcut smoothly appears with animation
    • Clear text to disable button
    • Confirm keyboard shortcut smoothly disappears without leaving empty space
    • Check button width transitions are smooth (200ms duration)
  3. General Regression Testing:

    • Verify normal editor functionality works as before
    • Test sending messages with keyboard shortcut
    • Confirm all existing features still work

Description for the changelog

Added error boundary protection for TipTap ResponseEditor to prevent crashes and improved Send button UX with smooth animations and proper space management when disabled.

Added ResponseEditorErrorBoundary component to gracefully handle TipTap editor errors
and prevent crashes. The error boundary displays a simple error message when the
editor encounters an issue.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 5cfdf8b in 1 minute and 19 seconds. Click for details.
  • Reviewed 125 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditorErrorBoundary.tsx:47
  • Draft comment:
    Missing trailing newline at the end of the file. Consider adding a final newline to adhere to code style conventions.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditorErrorBoundary.tsx:29
  • Draft comment:
    Consider adding an ARIA role (e.g. role='alert') on the fallback container for improved accessibility.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseInput.tsx:183
  • Draft comment:
    Wrapping ResponseEditor in the error boundary may affect ref forwarding. Verify that tiptapRef is correctly receiving the editor instance, or consider using forwardRef in the error boundary if needed.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditorErrorBoundary.tsx:29
  • Draft comment:
    Consider adding a retry or reset option in the error fallback UI to allow users to attempt reloading the editor.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_SVPDY5cRnp0GGHsB

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@balanceiskey balanceiskey merged commit 92da74b into humanlayer:main Sep 3, 2025
5 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