Skip to content

feat(calendar): add vdirsyncer and local vdir calendar support - #4034

Open
xela-zone wants to merge 1 commit into
noctalia-dev:mainfrom
xela-zone:feature/vdir-calendar-support
Open

feat(calendar): add vdirsyncer and local vdir calendar support #4034
xela-zone wants to merge 1 commit into
noctalia-dev:mainfrom
xela-zone:feature/vdir-calendar-support

Conversation

@xela-zone

Copy link
Copy Markdown

Summary

Adds support for local vdir and vdirsyncer calendar directories to Noctalia's calendar service:

  • vdir_reader module: Depth-bounded recursive collection discovery capable of resolving nested folder hierarchies (e.g. ~/. local/share/calendars/<account>/<collection>/).
  • Metadata parsing: Reads standard vdir metadata files (displayname, color, order) and X-WR-CALNAME properties with fallback to folder names.
  • Inotify event monitoring: Watches discovered collection directories for .ics file creations, modifications, and deletions with a 300ms debounce
    directly on the main poll loop.
  • Settings GUI: Added a Local (vdir) provider option and directory path picker/validator in Settings → Services → Calendar.
  • Unit tests: Added unit tests in tests/vdir_reader_test.cpp.

Motivation

I personally already have my caldav synced using vdirsync, to allow one syncing tool to work with multiple tools, such as khard or even someone using a local only calender app.

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Testing

  • Added unit tests in tests/vdir_reader_test.cpp covering:
    • Nested Collection Discovery: Recursive traversal across multi-level directory trees (e.g. <account>/<collection-uuid>/).
    • Direct Collection Discovery: Resolving accounts pointed directly at a single collection folder.
    • Directory Filtering: Ignoring hidden directories (e.g. .git/), temporary directories (.tmp), and non-directory files.
    • Metadata File Parsing: Correct extraction and trimming of displayname, color, and order files, plus collection sorting by order.
    • X-WR-CALNAME Fallback: Extracting calendar titles directly from .ics file headers when no displayname file is provided.
    • Event Loading & Mapping: Parsing .ics events from discovered collections with proper mapping of IDs, summaries, calendar names, and color
      assignments.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

image after creation / edit panel: image

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

written by gemini / antigravity, reviewed and lead by a human

- Add vdir_reader module with recursive depth-bounded collection discovery
- Support vdir metadata files (displayname, color, order) and X-WR-CALNAME fallback
- Add 'path' field to CalendarConfig::Account with validation for vdir/local accounts
- Wire inotify monitoring and debounced refresh on the main poll loop
- Add local (vdir) provider option in settings popup GUI
- Add unit tests in tests/vdir_reader_test.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant