Skip to content

Feature: Calendar visibility filtering for /agenda command (Whitelist/Blacklist) #5

Description

@gorlix

Context

Currently, the /agenda command fetches and displays events from all active calendars synced with Morgen. However, users might want to declutter their daily/weekly view by hiding specific calendars (e.g., secondary projects, holidays, or shared calendars) without disabling them entirely in the Morgen app.

Problem

There is no way to filter which calendars are shown in the bot's agenda, leading to a crowded and potentially confusing output for users with many active calendars.

Proposed Solution

Implement a configuration flow that allows users to manage calendar visibility directly from the bot. We need to evaluate and decide the best approach:

  1. Blacklist approach: Save the IDs of calendars the user explicitly wants to hide.
  2. Whitelist approach: Save the IDs of calendars the user explicitly wants to show.
    These preferences will be stored in the bot's local database. The /agenda command will then use this data to filter out unwanted events before displaying them.

Acceptance Criteria

  • Evaluate and decide between the blacklist or whitelist approach for managing visibility.
  • Create a UI/command flow (e.g., /calendars or an inline keyboard menu) to list all available calendars and allow the user to toggle their visibility.
  • Successfully save the visibility preferences (array of calendar IDs) in the local database.
  • Update the /agenda command logic to filter out events belonging to hidden calendars before sending the message.
  • Provide a success message to the user when their visibility settings are updated.

Technical Notes

  • Depending on the chosen approach, update the local DB schema to include a hidden_calendar_ids or visible_calendar_ids field (likely an array or a related table).
  • Ensure the filtering happens efficiently, either by requesting only specific calendars from the Morgen API (if supported) or by filtering the fetched results locally before displaying them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions