MinimapView hitTest ignores isHidden, intercepts clicks when minimap is hidden
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu tại MinimapView.hitTest(_:) và phần override mouseDown(with:) trong trình soạn thảo mã nguồn. Tái hiện với SourceEditorConfiguration được đặt thành showMinimap: false, sau đó xác minh rằng các lần nhấp trong frame trước đây của minimap đi tới text view bên dưới và tương tác bình thường với minimap vẫn không bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When showMinimap is set to false in SourceEditorConfiguration, the MinimapView is hidden via isHidden = true. However, clicks on the right ~140px of the editor are still intercepted by the hidden minimap, preventing cursor placement in that area.
Root Cause
MinimapView.hitTest(_:) overrides NSView.hitTest but does not check isHidden:
override public func hitTest(_ point: NSPoint) -> NSView? {
guard let point = superview?.convert(point, to: self) else { return nil }
// ...
}
Combined with the empty mouseDown override:
override public func mouseDown(with event: NSEvent) { }
This means the hidden minimap silently swallows all click events in its frame area.
Steps to Reproduce
- Create a
SourceEditorwithperipherals: .init(showMinimap: false) - Open any text file
- Try to click on the right portion of the editor (where the minimap would normally be)
- The cursor does not move — the click is eaten by the hidden minimap
Expected Behavior
When showMinimap: false, clicks should pass through to the underlying text view.
Suggested Fix
Add an isHidden guard at the top of hitTest:
override public func hitTest(_ point: NSPoint) -> NSView? {
guard !isHidden else { return nil }
guard let point = superview?.convert(point, to: self) else { return nil }
// ...
}
Environment
- CodeEditSourceEditor v0.15.2
- macOS 15.5, Apple Silicon
- Ngôn ngữ chính
- Swift
- Star
- 720
- Fork
- 162
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeEditApp/CodeEditSourceEditor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của CodeEditApp/CodeEditSourceEditor
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
type: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
googleapis/google-cloud-swift#971 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Move wallpaper setting Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
manaflow-ai/cmux#13417 ·