mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
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>
|
||
|---|---|---|
| .. | ||
| InstantImageGalleryItem.swift | ||
| InstantPageAnchorItem.swift | ||
| InstantPageAnchorPath.swift | ||
| InstantPageArticleItem.swift | ||
| InstantPageArticleNode.swift | ||
| InstantPageAudioItem.swift | ||
| InstantPageAudioNode.swift | ||
| InstantPageChecklistMarkerItem.swift | ||
| InstantPageContentNode.swift | ||
| InstantPageController.swift | ||
| InstantPageControllerNode.swift | ||
| InstantPageDetailsItem.swift | ||
| InstantPageDetailsNode.swift | ||
| InstantPageExternalMediaResource.swift | ||
| InstantPageFeedbackItem.swift | ||
| InstantPageFeedbackNode.swift | ||
| InstantPageFormulaItem.swift | ||
| InstantPageGalleryController.swift | ||
| InstantPageGalleryFooterContentNode.swift | ||
| InstantPageImageItem.swift | ||
| InstantPageImageNode.swift | ||
| InstantPageItem.swift | ||
| InstantPageLayout.swift | ||
| InstantPageLayoutSpacings.swift | ||
| InstantPageLinkSelectionView.swift | ||
| InstantPageMath.swift | ||
| InstantPageMedia.swift | ||
| InstantPageMediaOpen.swift | ||
| InstantPageMediaPlaylist.swift | ||
| InstantPageMultiTextAdapter.swift | ||
| InstantPageNavigationBar.swift | ||
| InstantPageNode.swift | ||
| InstantPagePeerReferenceItem.swift | ||
| InstantPagePeerReferenceNode.swift | ||
| InstantPagePlayableVideoItem.swift | ||
| InstantPagePlayableVideoNode.swift | ||
| InstantPageReferenceController.swift | ||
| InstantPageReferenceControllerNode.swift | ||
| InstantPageRenderer.swift | ||
| InstantPageScrollableNode.swift | ||
| InstantPageSettingsBacklightItemNode.swift | ||
| InstantPageSettingsButtonItemNode.swift | ||
| InstantPageSettingsFontFamilyItemNode.swift | ||
| InstantPageSettingsFontSizeItemNode.swift | ||
| InstantPageSettingsItemNode.swift | ||
| InstantPageSettingsItemTheme.swift | ||
| InstantPageSettingsNode.swift | ||
| InstantPageSettingsSwitchItemNode.swift | ||
| InstantPageSettingsThemeItemNode.swift | ||
| InstantPageShapeItem.swift | ||
| InstantPageSlideshowItem.swift | ||
| InstantPageSlideshowItemNode.swift | ||
| InstantPageStoredState.swift | ||
| InstantPageSubContentNode.swift | ||
| InstantPageTableItem.swift | ||
| InstantPageTextItem.swift | ||
| InstantPageTextSelectionNode.swift | ||
| InstantPageTextStyleStack.swift | ||
| InstantPageTheme.swift | ||
| InstantPageTile.swift | ||
| InstantPageTileNode.swift | ||
| InstantPageV2AudioContentNode.swift | ||
| InstantPageV2InlineImageView.swift | ||
| InstantPageV2Layout.swift | ||
| InstantPageV2MediaViews.swift | ||
| InstantPageV2RevealCost.swift | ||
| InstantPageV2SlideshowView.swift | ||
| InstantPageWebEmbedItem.swift | ||
| InstantPageWebEmbedNode.swift | ||