MinimapView hitTest ignores isHidden, intercepts clicks when minimap is hidden
還沒有人認領這個 Issue。
評估
研究方向
從原始碼編輯器中的 MinimapView.hitTest(_:) 及其 mouseDown(with:) override 開始。將 SourceEditorConfiguration 設定為 showMinimap: false 進行重現,然後確認在 minimap 原有 frame 中的點擊能到達下方的文字檢視區,且正常的 minimap 互動不受影響。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- Swift
- 星號
- 720
- 分支
- 162
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CodeEditApp/CodeEditSourceEditor 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 32/100
-
bug
難度 3/5 1-2 天 新手友好度 45/100
查看 CodeEditApp/CodeEditSourceEditor 的全部 Issue
相似的 Issue
-
pending-maintainer-response pending-triage
難度 2/5 1-3 小時 新手友好度 75/100
-
area:build bug good first issue P2
難度 2/5 1-3 小時 新手友好度 75/100
uttrflow/uttrflow-swift#1412 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
enhancement
難度 1/5 1 小時以內 新手友好度 80/100
-
T-Defect
難度 2/5 1-3 小時 新手友好度 75/100
element-hq/element-x-ios#6191 ·