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>
|
||
|---|---|---|
| .. | ||
| AccessoryPanelNode | ||
| ChatAgeRestrictionAlertController | ||
| ChatAvatarNavigationNode | ||
| ChatBotInfoItem | ||
| ChatButtonKeyboardInputNode | ||
| ChatChannelSubscriberInputPanelNode | ||
| ChatContextResultPeekContent | ||
| ChatEmptyNode | ||
| ChatHistoryEntry | ||
| ChatHistorySearchContainerNode | ||
| ChatInlineSearchResultsListComponent | ||
| ChatInputAccessoryPanel | ||
| ChatInputAutocompletePanel | ||
| ChatInputContextPanelNode | ||
| ChatInputMessageAccessoryPanel | ||
| ChatInputPanelNode | ||
| ChatInputTextNode | ||
| ChatInstantVideoMessageDurationNode | ||
| ChatLoadingNode | ||
| ChatMediaInputStickerGridItem | ||
| ChatMessageActionBubbleContentNode | ||
| ChatMessageActionButtonsNode | ||
| ChatMessageAnimatedStickerItemNode | ||
| ChatMessageAttachedContentButtonNode | ||
| ChatMessageAttachedContentNode | ||
| ChatMessageBirthdateSuggestionContentNode | ||
| ChatMessageBubbleContentNode | ||
| ChatMessageBubbleItemNode | ||
| ChatMessageCallBubbleContentNode | ||
| ChatMessageCommentFooterContentNode | ||
| ChatMessageContactBubbleContentNode | ||
| ChatMessageDateAndStatusNode | ||
| ChatMessageDeliveryFailedNode | ||
| ChatMessageDisableCopyProtectionBubbleContentNode | ||
| ChatMessageEventLogPreviousDescriptionContentNode | ||
| ChatMessageEventLogPreviousLinkContentNode | ||
| ChatMessageEventLogPreviousMessageContentNode | ||
| ChatMessageFactCheckBubbleContentNode | ||
| ChatMessageFileBubbleContentNode | ||
| ChatMessageForwardInfoNode | ||
| ChatMessageGameBubbleContentNode | ||
| ChatMessageGiftBubbleContentNode | ||
| ChatMessageGiftOfferBubbleContentNode | ||
| ChatMessageGiveawayBubbleContentNode | ||
| ChatMessageInstantVideoBubbleContentNode | ||
| ChatMessageInstantVideoItemNode | ||
| ChatMessageInteractiveFileNode | ||
| ChatMessageInteractiveInstantVideoNode | ||
| ChatMessageInteractiveMediaNode | ||
| ChatMessageInvoiceBubbleContentNode | ||
| ChatMessageItem | ||
| ChatMessageItemCommon | ||
| ChatMessageItemImpl | ||
| ChatMessageItemView | ||
| ChatMessageJoinedChannelBubbleContentNode | ||
| ChatMessageMapBubbleContentNode | ||
| ChatMessageMediaBubbleContentNode | ||
| ChatMessageNotificationItem | ||
| ChatMessagePaymentAlertController | ||
| ChatMessagePollBubbleContentNode | ||
| ChatMessageProfilePhotoSuggestionContentNode | ||
| ChatMessageReactionsFooterContentNode | ||
| ChatMessageReplyInfoNode | ||
| ChatMessageRestrictedBubbleContentNode | ||
| ChatMessageRichDataBubbleContentNode | ||
| ChatMessageSelectionInputPanelNode | ||
| ChatMessageSelectionNode | ||
| ChatMessageShareButton | ||
| ChatMessageStarsMediaInfoNode | ||
| ChatMessageStickerItemNode | ||
| ChatMessageStoryMentionContentNode | ||
| ChatMessageSuggestedPostInfoNode | ||
| ChatMessageSwipeToReplyNode | ||
| ChatMessageTextBubbleContentNode | ||
| ChatMessageThreadInfoNode | ||
| ChatMessageTodoBubbleContentNode | ||
| ChatMessageTransitionNode | ||
| ChatMessageUnlockMediaNode | ||
| ChatMessageUnsupportedBubbleContentNode | ||
| ChatMessageWallpaperBubbleContentNode | ||
| ChatMessageWebpageBubbleContentNode | ||
| ChatNavigationButton | ||
| ChatNewThreadInfoItem | ||
| ChatOverscrollControl | ||
| ChatPanelsComponent | ||
| ChatQrCodeScreen | ||
| ChatRankInfoScreen | ||
| ChatRecentActionsController | ||
| ChatRecordingPreviewInputPanelNode | ||
| ChatRecordingViewOnceButtonNode | ||
| ChatSearchNavigationContentNode | ||
| ChatSendAsContextMenu | ||
| ChatSendAudioMessageContextPreview | ||
| ChatSendStarsScreen | ||
| ChatShareMessageTagView | ||
| ChatSideTopicsPanel | ||
| ChatSwipeToReplyRecognizer | ||
| ChatTextInputActionButtonsNode | ||
| ChatTextInputAudioRecordingCancelIndicator | ||
| ChatTextInputAudioRecordingTimeNode | ||
| ChatTextInputPanelNode | ||
| ChatTextInputSlowmodePlaceholderNode | ||
| ChatUserInfoItem | ||
| EditableTokenListNode | ||
| FactCheckAlertController | ||
| ForwardAccessoryPanelNode | ||
| InstantVideoRadialStatusNode | ||
| ManagedDiceAnimationNode | ||
| MergedAvatarsNode | ||
| MessageHaptics | ||
| MessageInlineBlockBackgroundView | ||
| MessageQuoteComponent | ||
| PollBubbleTimerNode | ||
| QuickShareScreen | ||
| ReplyAccessoryPanelNode | ||
| SavedTagNameAlertController | ||
| ShimmeringLinkNode | ||
| SuggestPostAccessoryPanelNode | ||
| TopMessageReactions | ||