Add calendar invite actions to mail app with A/D/T keybindings

- Add calendar_invite.py with detect/find/respond functions for calendar invites
- Keybindings: A (accept), D (decline), T (tentative)
- Searches Graph API calendarView to find matching event by subject
- Responds via Graph API POST to event/{id}/accept|decline|tentativelyAccept
This commit is contained in:
Bendt
2025-12-19 16:51:40 -05:00
parent ab6e080bb4
commit d6e10e3dc5
2 changed files with 257 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ from .screens.SearchPanel import SearchPanel
from .actions.task import action_create_task
from .actions.open import action_open
from .actions.delete import delete_current
from .actions.calendar_invite import (
action_accept_invite,
action_decline_invite,
action_tentative_invite,
)
from src.services.taskwarrior import client as taskwarrior_client
from src.services.himalaya import client as himalaya_client
from src.utils.shared_config import get_theme_name
@@ -134,6 +139,9 @@ class EmailViewerApp(App):
Binding("escape", "clear_selection", "Clear selection"),
Binding("/", "search", "Search"),
Binding("u", "toggle_read", "Toggle read/unread"),
Binding("A", "accept_invite", "Accept invite"),
Binding("D", "decline_invite", "Decline invite"),
Binding("T", "tentative_invite", "Tentative"),
]
)
@@ -854,6 +862,18 @@ class EmailViewerApp(App):
def action_create_task(self) -> None:
action_create_task(self)
def action_accept_invite(self) -> None:
"""Accept the calendar invite from the current email."""
action_accept_invite(self)
def action_decline_invite(self) -> None:
"""Decline the calendar invite from the current email."""
action_decline_invite(self)
def action_tentative_invite(self) -> None:
"""Tentatively accept the calendar invite from the current email."""
action_tentative_invite(self)
def action_open_links(self) -> None:
"""Open the link panel showing links from the current message."""
content_container = self.query_one(ContentContainer)