aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/calendar/test_calctl.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-26 10:23:59 +0100
committerDanilo M. <danix@danix.xyz>2026-11-26 10:23:59 +0100
commitabd85b71acd21eb3c7d20b4d04c0d77511cc09c8 (patch)
tree65b061334be923f5f1df0b31169ca4345e556a22 /desktop/island/calendar/test_calctl.py
parent26956721dfb6c7f32153f283b1b07fd2eaf5b19b (diff)
downloadquickshell-abd85b71acd21eb3c7d20b4d04c0d77511cc09c8.tar.gz
quickshell-abd85b71acd21eb3c7d20b4d04c0d77511cc09c8.zip
feat(calendar): a dropped .ics opens the event editor, filled in
A lone .ics dropped on the island's sliver goes to the calendar rather than the assistant canvas: the panel opens on the event's month with the new-event form filled from the file, for review before Save. The bubble says where the drop will go while the drag is over it. calctl gains `read FILE`, which returns the file's master VEVENT in the same shape as `get`, with no UID so saving creates a new event in the default calendar. A rule or alarm the form cannot express reads `none`: `custom` would tell apply() to keep what is there, and a new event has nothing there to keep. The drop no longer needs the assistant to be present for .ics files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/calendar/test_calctl.py')
-rw-r--r--desktop/island/calendar/test_calctl.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/desktop/island/calendar/test_calctl.py b/desktop/island/calendar/test_calctl.py
index 91ad384..e6b3da2 100644
--- a/desktop/island/calendar/test_calctl.py
+++ b/desktop/island/calendar/test_calctl.py
@@ -290,5 +290,30 @@ assert "json" in run("new", "{not json", ok=False)
assert sorted(p.name for p in tmp.rglob("*.ics")) == before
no_temp()
+# read: an outside .ics as a new draft in the default calendar, nothing written.
+put(tmp / "invite.ics", """
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//test//EN
+BEGIN:VEVENT
+UID:invite-1
+DTSTAMP:20260101T000000Z
+DTSTART:20261203T140000Z
+DTEND:20261203T153000Z
+SUMMARY:Dentist
+LOCATION:Main St 1
+RRULE:FREQ=WEEKLY;BYDAY=TH
+END:VEVENT
+END:VCALENDAR
+""")
+before = sorted(p.name for p in tmp.rglob("*.ics"))
+r = run("read", str(tmp / "invite.ics"))
+assert (r["uid"], r["calendar"], r["title"], r["location"]) == ("", "home", "Dentist", "Main St 1"), r
+assert (r["start"], r["end"], r["allDay"], r["repeat"]) == ("2026-12-03T15:00", "2026-12-03T16:30", False, "none"), r
+assert sorted(p.name for p in tmp.rglob("*.ics")) == before
+put(tmp / "bad.ics", "hello")
+assert "not a calendar" in run("read", str(tmp / "bad.ics"), ok=False)
+assert "cannot read" in run("read", str(tmp / "missing.ics"), ok=False)
+
shutil.rmtree(tmp)
print("test_calctl: ok")