Telegram-iOS/submodules/TelegramStringFormatting/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
..
Birthday.swift Various improvements 2025-01-27 23:44:07 +04:00
ContactInfoStrings.swift
CurrencyFormat.swift Update API 2025-08-25 17:23:25 +04:00
DataSizeFormat.swift
DateFormat.swift Update API 2026-02-10 12:58:04 +04:00
DeviceType.swift
Geo.swift Various fixes 2023-10-24 15:13:42 +04:00
GiftFormat.swift Gift format 2025-08-08 15:23:59 +04:00
InstantPagePreviewText.swift Implement textDate autoformatter for InstantPage V2 rich bubbles 2026-06-04 13:45:48 +02:00
Locale.swift
MessageContentKind.swift Fix crash 2026-05-28 19:31:09 +02:00
NumberFormat.swift
PeerDisplayName.swift Bug fixes 2026-02-06 17:14:35 +04:00
PeerNotificationSoundStrings.swift Various improvements 2025-03-07 17:52:50 +01:00
PresenceStrings.swift Various fixes 2026-03-03 20:26:45 +04:00
ServiceMessageStrings.swift Various improvements 2026-05-28 16:50:05 +02:00
StringForDuration.swift
TonFormat.swift Various improvements 2026-01-25 22:17:49 +04:00
WeatherFormat.swift Various fixes 2024-08-04 20:35:09 +02:00