Telegram-iOS/submodules/TelegramCore/Sources
isaac a731f8bdc0 Implement textDate autoformatter for InstantPage V2 rich bubbles
Render RichText.textDate (API constructor textDate(flags, text, date)) as a
locale/timezone-correct, relative-aware, tappable date inside V2 rich-message
bubbles, reusing the existing stringForEntityFormattedDate autoformatter.

- Model: add RichText.textDate(text📅format:) with Postbox coding,
  FlatBuffers schema (RichText.fbs; flatc regenerates), Equatable and plainText;
  parse flags->DateTimeFormat? at the API boundary (flags==0 => nil, matching
  the messageEntityFormattedDate convention) with a symmetric apiRichText()
  round-trip. The new case is handled in every exhaustive RichText switch
  (SyncCore, ApiUtils, InstantPageTextItem, InstantPageAnchorPath,
  InstantPagePreviewText, BrowserReadability, BrowserMarkdown).
- Render: attributedStringForRichText gains an optional formatDate closure;
  the V2 layout builds it from the message's strings/dateTimeFormat and threads
  it to every text-building call site, formatting the timestamp and tagging the
  run with TelegramTextAttributes.Date.
- Tappable: the Date attribute is added to linkSelectionRects hit-testing and
  mapped in the rich bubble's entityTapContent to the existing .date tap action
  (opens the date context menu).
- Live update: the V2 layout accumulates a page-wide formattedDateUpdatePeriod
  (>=10s) for relative dates; the rich bubble schedules a refresh timer on it,
  recreating it only when the period changes. The currentPageLayout cache is
  bypassed for relative-date pages so the timer-driven relayout actually
  re-formats the date.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:45:48 +02:00
..
Account Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-05-29 09:24:16 +02:00
AccountManager Postbox -> TelegramEngine waves 94-102 (squashed) 2026-04-26 02:46:44 +04:00
ApiUtils Implement textDate autoformatter for InstantPage V2 rich bubbles 2026-06-04 13:45:48 +02:00
MacOS Refactor constructor use sites for types 480-499 to struct pattern 2026-01-18 23:47:18 +08:00
Network InstantPage V2: audio/music rendering, playback, and file-bubble styling 2026-06-02 17:44:45 +02:00
PendingMessages WIP 2026-05-20 00:33:08 +08:00
SecretChats constTimeIsEqual 2026-02-13 18:13:26 +04:00
Settings Various fixes 2026-05-29 16:46:38 +02:00
State Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-05-29 09:24:16 +02:00
Statistics Update API 2026-04-16 01:18:22 +02:00
SyncCore Implement textDate autoformatter for InstantPage V2 rich bubbles 2026-06-04 13:45:48 +02:00
TelegramEngine Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-05-29 10:01:53 +02:00
Utils WIP 2026-05-20 00:33:08 +08:00
Authorization.swift Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
ForumChannels.swift Postbox -> TelegramEngine wave 16a: move EngineMessageHistoryThread to TelegramCore 2026-04-20 21:26:32 +02:00
LoadedPeer.swift Refactor constructor use sites for types 460-479 to struct pattern 2026-01-18 23:36:22 +08:00
LoadedPeerFromMessage.swift Refactor constructor use sites for types 480-499 to struct pattern 2026-01-18 23:47:18 +08:00
SplitTest.swift Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
Suggestions.swift Temp 2025-12-02 19:30:48 +08:00
Themes.swift Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
UpdatePeers.swift Update API 2026-05-24 00:24:21 +04:00
Wallpapers.swift Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
WebpagePreview.swift Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00