@@ -64,6 +64,8 @@ type permissionDialogCmp struct {
64 positionRow int // Row position for dialog
64 positionRow int // Row position for dialog
65 positionCol int // Column position for dialog
65 positionCol int // Column position for dialog
67+ finalDialogHeight int
67 keyMap KeyMap
69 keyMap KeyMap
@@ -159,7 +161,7 @@ func (p *permissionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
159 cmds = append(cmds, cmd)
161 cmds = append(cmds, cmd)
161 case tea.MouseWheelMsg:
163 case tea.MouseWheelMsg:
162− if p.supportsDiffView() {
164+ if p.supportsDiffView() && p.isMouseOverDialog(msg.Mouse().X, msg.Mouse().Y) {
163 switch msg.Button {
165 switch msg.Button {
164 case tea.MouseWheelDown:
166 case tea.MouseWheelDown:
165 p.scrollDown()
167 p.scrollDown()
@@ -196,6 +198,21 @@ func (p *permissionDialogCmp) scrollRight() {
196 p.contentDirty = true
198 p.contentDirty = true
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 == "" {
208+ dialogX = p.positionCol
209+ dialogY = p.positionRow
210+ dialogWidth = p.width
211+ dialogHeight = p.finalDialogHeight
213+ return x >= dialogX && x < dialogX+dialogWidth && y >= dialogY && y < dialogY+dialogHeight
199func (p *permissionDialogCmp) selectCurrentOption() tea.Cmd {
216func (p *permissionDialogCmp) selectCurrentOption() tea.Cmd {
200 var action PermissionAction
217 var action PermissionAction
@@ -683,7 +700,7 @@ func (p *permissionDialogCmp) render() string {
684 content := lipgloss.JoinVertical(lipgloss.Top, strs...)
701 content := lipgloss.JoinVertical(lipgloss.Top, strs...)
686− return baseStyle.
703+ dialog := baseStyle.
687 Padding(0, 1).
704 Padding(0, 1).
688 Border(lipgloss.RoundedBorder()).
705 Border(lipgloss.RoundedBorder()).
689 BorderForeground(t.BorderFocus).
706 BorderForeground(t.BorderFocus).
@@ -691,6 +708,8 @@ func (p *permissionDialogCmp) render() string {
711+ p.finalDialogHeight = lipgloss.Height(dialog)
696func (p *permissionDialogCmp) View() string {
715func (p *permissionDialogCmp) View() string {