Skip to content

Auto-flip compare panel orientation based on panel width#5253

Open
sergeibbb wants to merge 1 commit into
mainfrom
feature/5171-mode-below-on-narrow
Open

Auto-flip compare panel orientation based on panel width#5253
sergeibbb wants to merge 1 commit into
mainfrom
feature/5171-mode-below-on-narrow

Conversation

@sergeibbb
Copy link
Copy Markdown
Member

Summary

  • Defaults the compare panel pinned orientation based on available width — vertical (below) when narrow (<600px), horizontal (beside) when wide
  • Auto-flips orientation when the panel is resized across the 600px threshold via a ResizeObserver
  • Alt-click on the sheet button still forces the opposite orientation; manual flip in the pinned panel header still works

Closes #5171

Test plan

  • Open the graph, select two commits to compare, click Move Below (default at typical widths) — panel pins vertically
  • Hold Alt — button changes to Move Beside; click to pin horizontally
  • Resize the details panel across the 600px boundary — orientation auto-flips
  • Manually flip orientation via the pinned panel header button — works as before
  • Resize back across threshold — orientation adapts again

sergeibbb added a commit that referenced this pull request May 19, 2026
Uses a ResizeObserver to prefer horizontal layout when the panel is wide
enough (≥600px) and vertical when narrow, automatically updating the
pinned compare panel orientation on resize.
(#5171, #5253)
@sergeibbb sergeibbb force-pushed the feature/5171-mode-below-on-narrow branch from d385e46 to f1e7590 Compare May 19, 2026 14:42
Uses a ResizeObserver to prefer horizontal layout when the panel is wide
enough (≥600px) and vertical when narrow, automatically updating the
pinned compare panel orientation on resize.
(#5171, #5253)
@sergeibbb sergeibbb force-pushed the feature/5171-mode-below-on-narrow branch from f1e7590 to 9ae3c6b Compare May 19, 2026 15:01
@sergeibbb sergeibbb marked this pull request as ready for review May 19, 2026 15:06
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 19, 2026

🤖 Augment PR Summary

Summary: Makes the Graph compare sheet�pinned panel promotion responsive by choosing a default orientation based on available panel width.

Changes:

  • Adds a PanelOrientation type + 600px threshold and tracks a preferred orientation in component state
  • Uses a ResizeObserver to update the preferred orientation when the details panel is resized
  • Updates the compare sheet action chip label/tooltip to reflect preferred vs Alt-flipped orientation
  • Promotes the compare sheet to a pinned panel using the preferred (or Alt-flipped) orientation
  • Centralizes orientation toggling via a flipOrientation helper

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/webviews/apps/plus/graph/components/gl-graph-details-panel.ts
Comment thread src/webviews/apps/plus/graph/components/gl-graph-details-panel.ts
@sergeibbb sergeibbb requested review from d13 and eamodio May 19, 2026 15:32
@sergeibbb sergeibbb added this to the 18.0 milestone May 19, 2026
@sergeibbb sergeibbb mentioned this pull request May 19, 2026
3 tasks
@gitkraken-services
Copy link
Copy Markdown

gitkraken-services Bot commented May 19, 2026

Processing Error

PR #5253 encountered an unexpected error during processing.

Error: fatal: shallow file has changed since we read it


Generated by Merge Mate at 2026-06-06 06:42:54 UTC

@d13 d13 modified the milestones: 18.0, 18.1 May 27, 2026
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.

Commit Details: Compare mode

3 participants