@@ -64,6 +64,8 @@ type permissionDialogCmp struct {
6464 positionRow int // Row position for dialog
6565 positionCol int // Column position for dialog
6666
67+ finalDialogHeight int
68+
6769 keyMap KeyMap
6870}
6971
@@ -159,7 +161,7 @@ func (p *permissionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
159161 cmds = append(cmds, cmd)
160162 }
161163 case tea.MouseWheelMsg:
162− if p.supportsDiffView() {
164+ if p.supportsDiffView() && p.isMouseOverDialog(msg.Mouse().X, msg.Mouse().Y) {
163165 switch msg.Button {
164166 case tea.MouseWheelDown:
165167 p.scrollDown()
@@ -196,6 +198,21 @@ func (p *permissionDialogCmp) scrollRight() {
196198 p.contentDirty = true
197199}
198200
201+// isMouseOverDialog checks if the given mouse coordinates are within the dialog bounds.
202+// Returns true if the mouse is over the dialog area, false otherwise.
203+func (p *permissionDialogCmp) isMouseOverDialog(x, y int) bool {
204+ if p.permission.ID == "" {
205+ return false
206+ }
207+ var (
208+ dialogX = p.positionCol
209+ dialogY = p.positionRow
210+ dialogWidth = p.width
211+ dialogHeight = p.finalDialogHeight
212+ )
213+ return x >= dialogX && x < dialogX+dialogWidth && y >= dialogY && y < dialogY+dialogHeight
214+}
215+
199216func (p *permissionDialogCmp) selectCurrentOption() tea.Cmd {
200217 var action PermissionAction
201218
@@ -683,7 +700,7 @@ func (p *permissionDialogCmp) render() string {
683700 }
684701 content := lipgloss.JoinVertical(lipgloss.Top, strs...)
685702
686− return baseStyle.
703+ dialog := baseStyle.
687704 Padding(0, 1).
688705 Border(lipgloss.RoundedBorder()).
689706 BorderForeground(t.BorderFocus).
@@ -691,6 +708,8 @@ func (p *permissionDialogCmp) render() string {
691708 Render(
692709 content,
693710 )
711+ p.finalDialogHeight = lipgloss.Height(dialog)
712+ return dialog
694713}
695714
696715func (p *permissionDialogCmp) View() string {