Skip to content

Let a calendar be given a colour from Settings - #125

Closed
inumineq wants to merge 1 commit into
huacnlee:mainfrom
inumineq:pr-calendar-colours
Closed

inumineq wants to merge 1 commit into
huacnlee:mainfrom
inumineq:pr-calendar-colours

Conversation

@inumineq

@inumineq inumineq commented Sep 7, 2026

Copy link
Copy Markdown

CalendarController.setSourceColor has no caller. git grep setSourceColor -- '*.qml' on main returns the definition and nothing else — the same shape as setSourceEnabled in the calendar-filter PR alongside this one. Every calendar is already drawn in the colour its colorKey names, Sources.setColor persists one, and Palette resolves the seven slots against the active theme. Nothing asks.

So the colour a calendar wears is whatever Palette.defaultKey hashed out of its id. That is fine until two calendars land on the same slot, which with seven slots is not rare, and then they are drawn identically in the same week with nothing to separate them. There is currently no answer to that at all.

Settings is the right home for it rather than the calendar header. It owns a calendar's whole life — its password, whether it exists — and a colour is set once and then left. Which calendars are drawn is the question asked several times a day, and that one belongs over the grid it changes.

Two small decisions in the row. The palette is listed as the colours themselves rather than as their names, because a name is not what you are choosing between when four calendars are stacked in a week — you are picking the one that is not the other three. And the slot in use wears a ring rather than only being brighter: a theme can put two slots close together, and "which of these seven am I on" is the only question this row exists to answer, so it is not left to a 0.6 opacity difference.

The list is now what the app offers rather than what is on disk. A discovered Google calendar is written the first time it is toggled or coloured, so a list of the already-persisted could never reach a newly signed-in account's calendars — which is precisely the set that still has hashed colours and most needs this. availableSources is what colorKeyFor already reads, so the page and the grid now agree on what exists.

Verification

make validate green on 329c49a: 367 QML tests, node/shell/python suites, qmllint clean, omarchy plugin validate . clean, git diff --check clean.

Two new cases in tests/qml/tst_calendar_settings.qml, and the controller stub gained the availableSources and setSourceColor the real one has. Watched both fail against the unfixed code: test_each_offered_calendar_can_be_coloured fails on the swatch not existing, and test_the_current_colour_is_marked throws reading current of null.

The first of those covers the discovered-calendar case specifically — the stub's second calendar is a Google one with nothing persisted for it — so the "offered, not stored" half of the change is asserted rather than just described.

Hand test: not done, and this is the gap in this PR, as with the others in this series. No screenshot is attached, because what exists is an offscreen render and that is not what CONTRIBUTING asks for. This one wants a real eye more than most: seven swatches in a row is a size-and-spacing decision, and whether the ring reads as "chosen" at 14px is exactly the kind of thing an offscreen run cannot tell you. Not marked ready until someone has driven it in a light theme and a dark one.

Note this touches components/CalendarSettings.qml, which the calendar-filter PR also changes (it scopes that page's calendarSaved handler to saves it started). Whichever lands second will want a small rebase there; the two changes are independent in intent.

Release Notes

  • A calendar's colour can be chosen in Settings. Every calendar the app offers now lists the theme's palette, including calendars discovered from a newly connected Google account, so two calendars no longer have to share a colour by accident.

`CalendarController.setSourceColor` has no caller. Every calendar is already
drawn in the colour its `colorKey` names, `Sources.setColor` persists one, and
`Palette` resolves the seven slots against the active theme — but nothing asks
for a colour, so the one a calendar gets is whatever `defaultColorKey` hashed
out of its id. Two calendars can land on the same slot and be drawn the same
colour in the same week, with no way to separate them.

Settings is the right place for it. It owns a calendar's whole life — its
password, whether it exists — and a colour is set once and then left, unlike
which calendars are drawn, which is asked several times a day and belongs over
the grid it changes.

The row lists the palette as the colours themselves rather than their names: a
name is not what you are choosing between when four calendars are stacked in a
week. The one in use wears a ring rather than only being brighter, because a
theme can put two slots close together and "which of these seven am I on" is
the only question the row exists to answer.

The list is now what the app offers rather than what is on disk. A discovered
Google calendar is written the first time it is toggled or coloured, so a list
of the already-persisted could never reach a newly signed-in account's
calendars — which is exactly the set that still has hashed colours.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
huacnlee added a commit that referenced this pull request Sep 15, 2026
Calendar settings can discover the individual calendars attached to
signed-in Microsoft and iCloud mailboxes, including names and read-only
state. Each calendar can be enabled, disabled or assigned an existing
theme color. Existing manual iCloud sources are adopted by URL, with
saved visibility and colors preserved. The palette opens only after its
color button is activated and closes after selection.

This PR includes the repaired bases #181 (provider recovery guidance)
and #182 (Microsoft connection check). Their changes remain in the
comparison against `main` until merged. #180 is independently
compatible. See the squash integration note below before merging the
series.

The backend owns discovery and credentials. Microsoft pagination stays
on the Graph calendars resource; calendar IDs are encoded as one path
segment. iCloud discovery accepts only Apple's HTTPS CalDAV and numbered
partition hosts, with bounded redirects, response sizes, calendar counts
and an overall deadline. The interface receives bounded metadata, never
passwords or tokens.

Both new methods belong to the same unreleased API-5 step above
published API 4. Cargo, manifest and the backend pin retain upstream's
0.10.3 version; release numbering is left to the release workflow.
Discovery controls and requests for discovered calendars require API 5.
An older backend cannot silently interpret a selected Microsoft calendar
as the default calendar. Existing default-calendar access remains
supported: an empty `calendarId` retains the original default endpoint.
URL adoption preserves case-sensitive paths, and account-summary refresh
preserves the discovered default calendar's name.

The compact theme-color chooser adapts the interaction first submitted
in #125 to the current provider-discovery rows; credit for that earlier
proposal remains with its author.

## Verification (2026-09-15)

- Head `ccfa75f` integrates upstream `3460ac8` (0.10.3/API 4) and
repaired #181/#182. Full `make validate` passes, including 915
main-suite QML cases, HTTP 6/6, sidebar 64/64, standalone composition,
lint and plugin validation.
- Standalone Rust tests pass with
`standalone,integration-test-credentials`; the production binary was
rebuilt without the test fixture feature. All seven Linux CTest targets
pass. An isolated real-host smoke test completes API-5 handshake and
shutdown against the actual standalone backend.
- Full local API-5 contract: 26 exercised/178 advertised methods;
standalone: 25/170. Published 0.10.3's actual SHA256-verified x86_64
API-4 backend passes the released view (23/176), and released-contract
equality passes.
- Discovery now uses upstream's platform `writeConfig` path and native
credential implementation. New persistence tests prove successful writes
replace the list only after completion; failures preserve the list and
clear busy state; neither branch writes credentials. Both tests fail
with the removed process-based writer and pass with the new callback
path. CalendarController:19/19.
- The standalone app initially could not instantiate CalendarSettings
because its ToggleSwitch adapter lacked the display-only/cursor
properties used by this PR. The adapter now supports those properties
and one mouse/Tab/Space input owner, with a semantic-color cursor ring.
The real standalone composition regression passes after failing before
repair.
- `make test-app-qml` now forwards the resolved Qt runner to CMake and
fails when CTest selects no tests; a dry-run regression covers this
validation fix.
- API-4 refuses all eight discovered-calendar read/write combinations
without RPC, while preserving legacy default-calendar access; API-5
enables supported operations. Existing default-ID, case-sensitive
adoption, calendar-name and safe-error regressions remain passing.
- All18 Rust calendar tests pass, including production-policy HTTPS
tests against a loopback TLS peer with synthetic credentials:
foreign/ambiguous iCloud redirects and Microsoft next links cause no
forbidden connection or request; valid same-resource/Apple partition
continuation works. No real mailbox or credentials were used.
- Fresh independent review found no actionable defects. Security: PASS
for the reviewed integration's credential-destination, metadata and
persistence boundaries. Native platform release certification remains
NOT VERIFIED until native credential/platform jobs execute for this
revision; local Linux results are not macOS/Windows evidence or
live-provider certification.

## UI evidence and readiness

The retained captures date from `81fcce8`; the plugin discovery
presentation is retained. The new standalone host required adapter
changes described above; these retained captures are not fresh
standalone screenshots. It corrects when existing discovery-recovery
text is selected, not the displayed wording or controls. Twenty-four
captures exercise the production CalendarSettings component with
installed Omarchy controls in Quickshell 0.3.1 on Wayland: Catppuccin
and Catppuccin Latte palettes, 1180×900 and 760×720 logical viewports at
1.6× display scale. Matching before/idle pairs use upstream `6f91932`;
additional after captures show discovery loading, results, failure and
the open color palette. Mouse events activate discovery and the color
button; synthetic service/controller data supplies accounts and results.
These are component captures, not a live-provider or full-shell session.

The visible differences are account-specific discovery/refresh controls,
the automatically available Microsoft calendar, per-source
visibility/color controls, account/read-only labels and bounded status
text. Existing manual calendar setup and the unified-view option remain.
Discovery result states have no before equivalent.

The current comparison images below are uploaded GitHub attachments. UI
evidence: retained plugin flow captures; BLOCK for the new standalone
host's on-screen before/after comparison, not established by offscreen
tests.

A separate on-screen check used the real Omarchy host shell and
registered envelope widget, the production App/settings/components and
CalendarController, and an isolated HOME with synthetic accounts and
backend/auth replies. The panel was opened from the envelope; Ctrl+, and
Escape navigation, mouse activation, Tab/Enter/Space activation,
connection results, calendar discovery/refresh, visibility and color
persistence were exercised. Catppuccin and Catppuccin Latte were checked
at 1180×900 and the smallest supported width (760×720). Only the
isolated shell theme changed. This verifies the affected UI in its real
host, not live OAuth/provider compatibility; fixture-only unrelated
account-summary/mock warnings remain outside this scoped UI verdict.

The host-shell check found that discovery, color and visibility controls
were mouse-only. The new controls now opt into the shared Button
keyboard behavior; the visibility button retains the shared ToggleSwitch
graphic and has checkbox accessibility semantics. Tab/Enter/Space
regressions fail against the old components and pass after repair. No
new shortcuts or production key handlers were added.

Ready for maintainer review; hosted checks still need upstream
fork-workflow authorization. No approval, upstream merge or backend
publication has been performed.

The following are the original submission's after screenshots, retained
for context; they are not a matching before/after pair.

**After — calendar list, palette closed, account addresses redacted**

<img width="1640" height="959" alt="OmaMail calendar settings with fully
redacted account addresses"
src="https://github.com/user-attachments/assets/0d8e27c0-33c4-4ae9-ab3e-7ad210ddc28f"
/>

**After — palette opened, account addresses redacted**

<img width="1700" height="925" alt="OmaMail calendar color picker with
fully redacted account addresses"
src="https://github.com/user-attachments/assets/a092214f-d7a0-49b6-8196-499bd2d8461c"
/>

## Current comparison captures

<details>
<summary>Dark — Catppuccin / wide — before, after, and result
states</summary>

**Before — upstream 6f91932**

<img width="760" alt="calendar-catppuccin-wide-before-final"
src="https://github.com/user-attachments/assets/fd868b7e-cfd7-47d2-9dc8-db03171f05f3"
/>

**After — 81fcce8, idle**

<img width="760" alt="calendar-catppuccin-wide-idle-final"
src="https://github.com/user-attachments/assets/bbaad786-875c-4a60-9e6e-e3b8fc718546"
/>

**After — busy**

<img width="760" alt="calendar-catppuccin-wide-busy-final"
src="https://github.com/user-attachments/assets/97f2c27d-b6e4-494e-8762-78da2c5e2ef6"
/>

**After — success**

<img width="760" alt="calendar-catppuccin-wide-success-final"
src="https://github.com/user-attachments/assets/dc1f1d73-4ba3-4650-a46f-9b7ab868baa4"
/>

**After — error**

<img width="760" alt="calendar-catppuccin-wide-error-final"
src="https://github.com/user-attachments/assets/9b91320b-5fe9-40f6-bb46-ed8da872cce3"
/>

**After — palette**

<img width="760" alt="calendar-catppuccin-wide-palette-final"
src="https://github.com/user-attachments/assets/4c0bb251-b4eb-42bf-818d-6d987c008666"
/>

</details>

<details>
<summary>Dark — Catppuccin / compact — before, after, and result
states</summary>

**Before — upstream 6f91932**

<img width="760" alt="calendar-catppuccin-compact-before-final"
src="https://github.com/user-attachments/assets/2f8cb645-a9f0-4f1e-9253-ba5e4036dbd5"
/>

**After — 81fcce8, idle**

<img width="760" alt="calendar-catppuccin-compact-idle-final"
src="https://github.com/user-attachments/assets/34836444-fccd-4d2d-b0f0-887da953f900"
/>

**After — busy**

<img width="760" alt="calendar-catppuccin-compact-busy-final"
src="https://github.com/user-attachments/assets/110facfe-2375-4059-aadd-528c0143f9e0"
/>

**After — success**

<img width="760" alt="calendar-catppuccin-compact-success-final"
src="https://github.com/user-attachments/assets/b5f1d828-e037-4796-91b6-e5c2fb090502"
/>

**After — error**

<img width="760" alt="calendar-catppuccin-compact-error-final"
src="https://github.com/user-attachments/assets/d3a5f192-c2b2-4937-9021-e4790243cea9"
/>

**After — palette**

<img width="760" alt="calendar-catppuccin-compact-palette-final"
src="https://github.com/user-attachments/assets/6f72a3cc-9431-48ce-b701-d291a0747690"
/>

</details>

<details>
<summary>Light — Catppuccin Latte / wide — before, after, and result
states</summary>

**Before — upstream 6f91932**

<img width="760" alt="calendar-catppuccin-latte-wide-before-final"
src="https://github.com/user-attachments/assets/28367bc8-05e9-4ed2-8fd6-1660547a95ca"
/>

**After — 81fcce8, idle**

<img width="760" alt="calendar-catppuccin-latte-wide-idle-final"
src="https://github.com/user-attachments/assets/0169825d-18b1-4234-bccd-05fb8ccbc630"
/>

**After — busy**

<img width="760" alt="calendar-catppuccin-latte-wide-busy-final"
src="https://github.com/user-attachments/assets/cf14f3c4-81bc-4af6-9a26-6da1d24fe433"
/>

**After — success**

<img width="760" alt="calendar-catppuccin-latte-wide-success-final"
src="https://github.com/user-attachments/assets/325e4b10-9696-4254-ad0a-849df121bae3"
/>

**After — error**

<img width="760" alt="calendar-catppuccin-latte-wide-error-final"
src="https://github.com/user-attachments/assets/2c80d3ba-d795-4d56-9cfb-9bc158c07b53"
/>

**After — palette**

<img width="760" alt="calendar-catppuccin-latte-wide-palette-final"
src="https://github.com/user-attachments/assets/e3a1730b-4ff8-4e6d-b026-57252c1e2a2a"
/>

</details>

<details>
<summary>Light — Catppuccin Latte / compact — before, after, and result
states</summary>

**Before — upstream 6f91932**

<img width="760" alt="calendar-catppuccin-latte-compact-before-final"
src="https://github.com/user-attachments/assets/f0de9689-da6c-451e-abbe-2a3dc0a48d86"
/>

**After — 81fcce8, idle**

<img width="760" alt="calendar-catppuccin-latte-compact-idle-final"
src="https://github.com/user-attachments/assets/4991da6b-e146-4bc5-94a8-17a9d1495169"
/>

**After — busy**

<img width="760" alt="calendar-catppuccin-latte-compact-busy-final"
src="https://github.com/user-attachments/assets/bc08d14b-1093-4b80-8b4f-f842e6df47fb"
/>

**After — success**

<img width="760" alt="calendar-catppuccin-latte-compact-success-final"
src="https://github.com/user-attachments/assets/8c59a4d0-2438-4b73-b9cb-16c31c662a54"
/>

**After — error**

<img width="760" alt="calendar-catppuccin-latte-compact-error-final"
src="https://github.com/user-attachments/assets/9e2e2125-e264-4419-8ba5-8c95147d24a4"
/>

**After — palette**

<img width="760" alt="calendar-catppuccin-latte-compact-palette-final"
src="https://github.com/user-attachments/assets/392ebb9b-b7cd-4220-9b00-5a659f71df93"
/>

</details>


## Squash integration note

Verified against upstream `3460ac8`: #180 → #181 → #182 squash cleanly.
#183 includes #181/#182 ancestry; after those bases are squash-merged,
four conflicts recur in `backend-api.json`, `ui/Service.qml`,
`ui/tests/qml/tst_calendar_controller.qml`, and
`ui/tests/qml/tst_service_backend_path.qml`.

The resolution is prepared and verified locally. Applying only #183's
remaining changes to the simulated squashed base produces tree
`5b7e3ae2f7b19db0c915acdc49b66d8f4002784c`, exactly matching the clean
ancestry-preserving combination of all four PRs. The combined tree
passes JavaScript, QML (918 main cases plus HTTP6/sidebar64), both lint
targets, standalone composition, plugin validation and API5 contract
checks; Rust/Cargo and native host files are identical to the fully
validated #183 source.

After the first three PRs' CI/reviews and squash merges, this branch
must still be synchronized with the actual resulting main before merging
#183. A simulation cannot pre-approve unseen future main commits. No
upstream merge, force-push, release or check bypass has been performed.

## On-screen host-shell examples

These supplementary captures use synthetic accounts and replies, as
described above. Matching before/after component comparisons remain in
the four sections above.

<details>
<summary>shell dark compact</summary>

<img width="760" alt="shell-dark-compact"
src="https://github.com/user-attachments/assets/07b3366d-6226-41da-85f6-b587b27bc242"
/>

</details>

<details>
<summary>shell dark wide</summary>

<img width="760" alt="shell-dark-wide"
src="https://github.com/user-attachments/assets/d62fa1b4-7e82-473e-aad5-ac100e55dc23"
/>

</details>

<details>
<summary>shell light compact</summary>

<img width="760" alt="shell-light-compact"
src="https://github.com/user-attachments/assets/49463e2f-6aef-48d1-86e9-c65b42029101"
/>

</details>

<details>
<summary>shell light wide</summary>

<img width="760" alt="shell-light-wide"
src="https://github.com/user-attachments/assets/bd3c2fd8-4306-4df6-91c2-868f9b176c42"
/>

</details>

## Release Notes

- Microsoft and iCloud mailboxes can discover, select, color and read
individual calendars without manually entering provider addresses when
the backend supports account-calendar discovery.
- Default Microsoft calendar access and discovered calendar names are
preserved; iCloud URL matching keeps distinct case-sensitive calendar
paths separate.

---------

Co-authored-by: Christian Dandachi <dandiccf@gmail.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@huacnlee huacnlee closed this Nov 1, 2026
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.

2 participants