feat(sharing): label shared personal calendars by owner + drop group title prefix

Two group/sharing display fixes, both server-side so every client benefits:

1. A personal calendar shared WITH a user showed only its raw name
   ("Persönlich"), indistinguishable from the user's own. The merge read now
   relabels a shared *personal* calendar under the owner's display name (so
   Guido's "Persönlich" reads as "Guido" for recipients) and adds read_only:true
   when the share isn't read_write. Group calendars are excluded — they keep
   their own name and stay writable for members.

2. The combined group view prefixed every foreign event with the owner's first
   name ("Guido: …"). Each member already has a distinct display_color, so the
   prefix was redundant. _decorate_title now returns the raw title; display_title
   stays non-empty so clients' legacy prefix fallback never triggers. The change
   takes effect on already-installed clients with no app update.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-04 18:42:26 +02:00
parent 444772c959
commit e3844294ae
2 changed files with 32 additions and 11 deletions

View File

@@ -317,17 +317,12 @@ def _first_name(name: Optional[str]) -> str:
def _decorate_title(title: str, *, is_group: bool, creator: Optional[dict],
owner: Optional[dict], me_id: int) -> str:
"""Server-side display title for the combined view so every client (web,
iOS, Android) renders identically: another member's / creator's first name
is prefixed. No icon glyph is embedded — group icons are semantic keys the
clients render as native vector icons, and group-calendar events are
distinguished by their (group) colour. The raw `title` stays for editing."""
if is_group:
if creator and creator.get("id") is not None and creator.get("id") != me_id:
return f"{_first_name(creator.get('display_name'))}: {title}"
return title
if owner and owner.get("id") is not None and owner.get("id") != me_id:
return f"{_first_name(owner.get('display_name'))}: {title}"
"""Server-side display title for the combined view. The former owner/creator
first-name prefix ("Guido: …") was dropped: each member already has a
distinct colour, so the prefix was redundant noise. We still return a
non-empty `display_title` (== raw title) so the clients' legacy fallback —
which rebuilds a prefix when `display_title` is empty — never kicks in.
`display_color` continues to carry the per-person colour."""
return title