Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

Calendar: an event's URL can be added and changed, and shows as a link on read-only events

Yashwanth Kamireddi10c5cedf829d
diff --git a/.uiverify/calendar-instant.mjs b/.uiverify/calendar-instant.mjs
index f102436..e859474 100644
--- a/.uiverify/calendar-instant.mjs
+++ b/.uiverify/calendar-instant.mjs
@@ -50,6 +50,15 @@ ok(sent?.draft?.url === "https://meet.example/dentist",
const zoned = await page.evaluate(() => window.__saves.at(-1)?.draft?.timezone);
ok(zoned === "Asia/Kolkata", `an edit keeps the event's own time zone [${zoned}]`);
+// The link can be set from the event itself. (The stub hands back the old title on re-read.)
+await page.locator(".cx-block", { hasText: "Dentist" }).first().click();
+await page.waitForTimeout(250);
+await page.getByLabel("URL").fill("https://example.com/new");
+await page.locator('input[placeholder="New Event"]').first().press("Enter");
+await page.waitForTimeout(1800);
+const linked = await page.evaluate(() => window.__saves.at(-1)?.draft?.url);
+ok(linked === "https://example.com/new", `a URL typed into the event is saved [${linked}]`);
+
// A delete takes the event off the calendar at once.
await page.locator(".cx-block", { hasText: "Design review" }).first().click();
await page.waitForTimeout(250);
diff --git a/src/screens/calendar/CalendarView.tsx b/src/screens/calendar/CalendarView.tsx
index c689c0c..88ab450 100644
--- a/src/screens/calendar/CalendarView.tsx
+++ b/src/screens/calendar/CalendarView.tsx
@@ -346,7 +346,7 @@ export function CalendarView() {
allDay: d.allDay,
timezone: d.allDay ? ZONE : (d.timezone ?? ZONE),
notes: d.notes.trim() || null,
- url: d.url,
+ url: d.url?.trim() || null,
});
}, (rows) => {
// Shown where it now sits at once; a new one is drawn by its draft until Apple names it.
@@ -1582,6 +1582,9 @@ function EventPopover({
{draft.location && <p className="cx-info-line">{draft.location}</p>}
<p className="cx-info-line">{when}</p>
<p className="cx-info-cal"><span className="cx-info-dot" aria-hidden="true" />{calendar?.title}</p>
+ {draft.url && (
+ <a className="cx-info-url" href={draft.url} target="_blank" rel="noreferrer">{draft.url}</a>
+ )}
{draft.notes && <p className="cx-info-notes">{draft.notes}</p>}
</form>
);
@@ -1668,6 +1671,15 @@ function EventPopover({
/>
</div>
</div>
+ <input
+ className="cx-pop-line"
+ type="url"
+ value={draft.url ?? ""}
+ placeholder="Add URL"
+ aria-label="URL"
+ readOnly={!editable}
+ onChange={(e) => set({ url: e.target.value || null })}
+ />
<textarea
className="cx-pop-notes"
value={draft.notes}
diff --git a/src/styles/calendar.css b/src/styles/calendar.css
index e2efc30..2da2d8a 100644
--- a/src/styles/calendar.css
+++ b/src/styles/calendar.css
@@ -734,3 +734,5 @@
.cx-pane-reminder .cx-pane-title { font-weight: 400; }
/* Without room for both, the timeline keeps the window. */
@container cx-page (max-width: 900px) { .cx-pane { display: none; } }
+
+.cx-info-url { margin-top: 6px; font-size: var(--t-13); color: var(--sys-blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }