Skip to content

Improve diff viewer window resizing and sidecar transitions#3520

Merged
Kvadratni merged 2 commits intoblock:feature/diff-viewer-sidecarfrom
aharvard:feature/diff-viewer-sidecar
Jul 18, 2025
Merged

Improve diff viewer window resizing and sidecar transitions#3520
Kvadratni merged 2 commits intoblock:feature/diff-viewer-sidecarfrom
aharvard:feature/diff-viewer-sidecar

Conversation

@aharvard
Copy link
Collaborator

Overview

This PR addresses window resizing issues in the diff viewer sidecar functionality and lays groundwork for improved transitions.

Changes Made

  • Fixed window resizing toggle behavior: The useWindowManager hook now properly handles both expansion and collapse states when toggling the diff viewer
  • Improved wide window handling: Windows that are already wide enough (>2200px) now properly show the sidecar without unnecessary resizing
  • Enhanced state management: Fixed edge cases where the window state could become inconsistent during toggle operations

Issues Addressed

  • ✅ Window growing too wide when clicking "View Diff" button repeatedly
  • ✅ Sidecar not closing properly when clicking "View Diff" again
  • ✅ Window not returning to original size when sidecar is closed
  • ✅ Proper handling of windows that are already wide enough

Future Improvements Planned

  • Smoother transitions: Planning to refine the timing so the chat area doesn't become awkwardly wide before the sidecar appears
  • Slide-in animation: Working on making the sidecar slide in smoothly from the right side for a more polished user experience

Testing

  • Tested window expansion/collapse toggle functionality
  • Verified behavior on both narrow and wide windows
  • Confirmed sidecar shows/hides correctly
  • Tested edge cases with rapid clicking

Technical Details

The main changes are in:

  • src/hooks/useWindowManager.ts: Fixed toggle logic to handle both expand and collapse states
  • src/components/SidecarLayout.tsx: Updated to properly call window collapse when hiding views
  • src/components/GooseMessage.tsx: Enhanced to check sidecar state and toggle appropriately
  • src/components/CheckpointActions.tsx: Added sidecar integration for consistent behavior

This provides a solid foundation for the upcoming transition improvements and slide-in animations.

@aharvard
Copy link
Collaborator Author

two things are still bothering me

  1. the chat message thread grows when the window resizes. I think its width should remain as-is.
  2. the sidecar does not slide in from the right

not blockers, but I'm gonna try to address those before my EOD

@Kvadratni Kvadratni merged commit ba8b08b into block:feature/diff-viewer-sidecar Jul 18, 2025
2 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