Skip to content

fix(desktop): remove double-click to lock file behavior in changes sidebar - #938

Merged
Kitenite merged 1 commit into
mainfrom
fix-894
Jan 25, 2026
Merged

Kitenite merged 1 commit into
mainfrom
fix-894

Conversation

@Kitenite

@Kitenite Kitenite commented Jan 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Remove the unintuitive "click twice to lock" behavior that caused diff panels to open in new panes instead of replacing existing ones
  • Files in the changes sidebar now always replace the current preview pane

Test plan

  • Click on a file in the changes sidebar to open it
  • Click on a different file - verify it replaces the current diff panel instead of opening a new one
  • Repeat clicking different files - verify the diff panel is always replaced, never duplicated

Closes #894

Summary by CodeRabbit

  • Refactor
    • Simplified file opening behavior: removed double-click functionality and automatic pinning of files when reopened. Files now open with single-click only.

✏️ Tip: You can customize this high-level summary in your review settings.

…debar

Remove the unintuitive "click twice to lock" behavior that caused diff
panels to open in new panes instead of replacing existing ones. Files
in the changes sidebar now always replace the current preview pane.

Closes #894
@coderabbitai

coderabbitai Bot commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR eliminates double-click and pinned file functionality from the Changes panel. The onFileOpenPinned callback and related double-click handlers are removed across all UI components, reducing file interaction to single-click opening only. The file viewer pane reuse logic is simplified: when clicking a file that matches an existing unpinned preview pane, the pane is now refocused without being promoted to a pinned state, preventing duplicate diff panel windows.

Changes

Cohort / File(s) Summary
Changes Panel Components
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/ChangesView.tsx, ChangesView/components/CommitItem/CommitItem.tsx, ChangesView/components/FileItem/FileItem.tsx, ChangesView/components/FileList/FileList.tsx, ChangesView/components/FileList/FileListGrouped.tsx, ChangesView/components/FileList/FileListTree.tsx
Removed onFileDoubleClick/onFileOpenPinned callback props and all related double-click handlers from the entire Changes view component tree; single-click file selection is now the only file interaction pattern
Sidebar State Management
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/index.tsx
Removed handleFileOpenPinnedPane and handleFileOpenPinned callbacks; eliminated isPinned metadata tracking and file content invalidation; simplified ChangesView integration to use only onFileOpen
File Viewer Pane Logic
apps/desktop/src/renderer/stores/tabs/store.ts
Modified addFileViewerPane to preserve unpinned preview pane state when clicking a file matching an existing preview; removed auto-promotion to pinned state on repeated file selection

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 No more double-clicks, no more pinned files in sight,
Single-click simplicity shines so bright!
Panes won't duplicate, won't split apart,
Clean and focused—a rabbit's work of art. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: removing double-click behavior in the changes sidebar that prevented proper file replacement.
Description check ✅ Passed The description provides a clear summary and test plan, but does not follow the template structure with sections like Type of Change, Screenshots, and Additional Notes.
Linked Issues check ✅ Passed The code changes directly address issue #894 by removing the double-click/lock behavior that caused duplicate diff panels, ensuring files always replace the current preview pane.
Out of Scope Changes check ✅ Passed All changes are directly related to removing double-click file-locking behavior and related pinned-pane logic across the Changes sidebar component hierarchy.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@Kitenite
Kitenite merged commit b3f06b4 into main Jan 25, 2026
5 checks passed
@Kitenite
Kitenite deleted the fix-894 branch January 25, 2026 07:40
@github-actions

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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.

[bug] the diff panel sometime opens twice

1 participant