Skip to content

Improve sidebar resize handle drag target and visual indicators - #7454

Merged
AmethystLiang merged 1 commit into
mainfrom
fix-side-bar-resizing-size
Jul 5, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix-side-bar-resizing-size

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

Improves the sidebar resize handle drag target alignment and its visual feedback:

  • Widens the hit target from w-1 to w-3 and offsets it with -right-1.5 so it straddles the sidebar seam, making it much easier to hover and grab.
  • Separates the hover/drag target container from the visible line (which is now a w-px line that highlights on hover/active resizing).
  • Fixes a visual gap next to the resize seam by adjusting the WebKit scrollbar thumb border width in main.css.

Screenshots

  • TODO: Add screenshots or screen recording of the updated resizing hover behavior.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test (Updated unit tests in sidebar-resize-handle.test.ts to assert on updated class names)
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

AI Review Report

Conducted an AI-assisted review of the UI and component layout changes:

  • Evaluated layout impacts of positioning the absolute resize handle offset (-right-1.5); verified it sits neatly on the border without layout shifting.
  • Cross-platform validation: Drag/hover interactions and cursor attributes (cursor-col-resize) are native browser styles that work identically on macOS, Windows, and Linux.

Security Audit

Verified that no backend code, command executions, IPC endpoints, or sensitive dependencies are altered. Changes are limited to CSS classes and rendering components.

Notes

No platform-specific risks identified; scrollbar tweaks are webkit-specific, ensuring high-fidelity rendering within Electron.

- Widen the resize handle hit target to 12px (straddling the edge) to
  make it easier to grab, centering a thin 1px visual guide line.
- Highlight the divider line on hover and active states, and shade
  the handle background during active dragging.
- Adjust the sidebar webkit scrollbar border to prevent a transparent
  gap from appearing next to the drag handle.
- Update unit tests to match the new styling and sizing classes.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change widens the worktree sidebar resize handle's hit target and separates it into a container with an inner 1px divider line, adding hover/active ring styling driven by an isResizing state from useSidebarResize. The scrollbar thumb border was adjusted to remove a right-side inset that previously created a visible seam near the resize handle. The corresponding unit test was updated to assert the new width and positioning classes.

Changes

Area Change
main.css Removed right-side border from scrollbar thumb; updated comment
sidebar/index.tsx Replaced resize handle class with new container/divider classes; wired isResizing; restructured JSX with nested divider div
sidebar-resize-handle.test.ts Updated assertions for new width (w-3) and position (-right-1.5) classes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SidebarComponent
  participant useSidebarResize
  User->>SidebarComponent: hover/drag resize handle
  SidebarComponent->>useSidebarResize: onResizeStart
  useSidebarResize-->>SidebarComponent: isResizing state
  SidebarComponent->>SidebarComponent: apply active classes to handle/divider
Loading

Related Issues: None specified.

Related PRs: None specified.

Suggested labels: frontend, ui, sidebar

Suggested reviewers: None specified.

Poem
A rabbit tugs the sidebar's edge,
Now wider is the grabbing ledge.
A thin line hides within the frame,
No seam to break the scrollbar's aim.
Hop, hop — the border tests still pass,
Smooth as a well-trimmed patch of grass. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main UI change to the sidebar resize handle and its visual feedback.
Description check ✅ Passed All required sections are present and mostly filled; the Screenshots section still needs an actual screenshot or a clear no-visual-change note.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/index.tsx (1)

134-137: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Keep the resize handle outside the clipped sidebar surface.
overflow-hidden on the sidebar root trims the -right-1.5 w-3 handle to the in-bounds half, so the expanded grab area past the seam never becomes clickable. Move the clipping to an inner wrapper or let the outer sidebar overflow visibly.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1d668b80-ff24-432d-bdfe-90962dad50d8

📥 Commits

Reviewing files that changed from the base of the PR and between 72a2380 and 4a1ee89.

📒 Files selected for processing (3)
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/sidebar/index.tsx
  • src/renderer/src/components/sidebar/sidebar-resize-handle.test.ts

@AmethystLiang
AmethystLiang merged commit df1df52 into main Jul 5, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…lyai#7454)

- Widen the resize handle hit target to 12px (straddling the edge) to
  make it easier to grab, centering a thin 1px visual guide line.
- Highlight the divider line on hover and active states, and shade
  the handle background during active dragging.
- Adjust the sidebar webkit scrollbar border to prevent a transparent
  gap from appearing next to the drag handle.
- Update unit tests to match the new styling and sizing classes.
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