Commit graph

422 commits

Author SHA1 Message Date
isaac
0050cc7a08 Rich-message media in gallery/shared-media/preview pipelines via Message.effectiveMedia
Add Message/EngineMessage.effectiveMedia (= message.media when non-empty, else
richText.instantPage.allMedia()) and route the media-consuming sites through it
so a rich message's instant-page media participates in the same pipelines as
normal message.media: shared-media grids/file-rows, search media grid, gallery
open + item nodes + footer, the peer audio/voice playlist, secret-media preview,
resource-by-id resolution, recent downloads, downloaded-media store, delete-time
resource cleanup, cache-usage stats, the in-chat download manager, and the
context-menu / share actions (Save to Camera Roll, copy image, save audio/music
to files). For normal messages effectiveMedia == message.media, so each swap is
behavior-preserving; rich messages render their own bubble via
ChatMessageRichDataBubbleContentNode (not the text/file bubbles), so those paths
are deliberately untouched, as are the forward path (the attribute travels with
the forward) and the markdown-based rich-edit path. First-media scope for now.

See docs/instantpage-richtext.md for the full architecture + invariants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:46:56 +02:00
Ilya Laktyushin
91eb779ae2 Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
isaac
69bfc65da7 Postbox refactor waves 138–276: 168-commit squash
Consolidates 137 wave commits + 31 supporting commits (CLAUDE.md bump,
typealias additions, AnyObject→EngineMedia restoration) into one squashed
commit. Migrates dozens of consumer-side public APIs, struct fields,
protocol methods, and enum payloads from Postbox protocols/structs to
TelegramEngine engine wrappers and typealiases. Drops `import Postbox`
from many files. Adds new TelegramCore typealiases and one
TelegramEngineUnauthorized facade.

Notable changes by category:

**TelegramCore typealias additions** (rule 2 — narrow utility typealiases):
- EngineChatListIndex, EngineTempBoxFile, EngineItemCollectionItemIndex,
  EngineItemCollectionViewEntryIndex, EngineValueBoxEncryptionParameters,
  EngineMessageAndThreadId, EnginePeerStoryStats, EngineMessageHistoryAnchorIndex,
  EngineChatListTotalUnreadStateCategory, EngineChatListTotalUnreadStateStats,
  EnginePeerSummaryCounterTags, EngineChatListTotalUnreadState,
  EngineItemCacheEntryId, EngineHashFunctions,
  EngineCachedMediaResourceRepresentationResult,
  EngineMediaResourceDataFetchResult, EngineMediaResourceDataFetchError,
  EngineMediaResourceStatus, EngineCachedPeerData

**TelegramCore engine extensions/forwarders**:
- EngineMessage.engineMedia, EngineMessage.enginePeers,
  EngineMessage.adAttribute, EngineMessage.effectivelyIncoming
- engineFileSize forwarder
- TelegramEngine.Resources.clearCachedMediaResources(mediaResourceIds: Set<EngineMediaResource.Id>)
- TelegramEngine.Resources.fetchStatus(id:resourceSize:)
- TelegramEngineUnauthorized.UnauthorizedResources facade with storeResourceData

**Public API/struct migrations to engine types**:
- ChatAvailableMessageActions.banAuthor/banAuthors → EnginePeer?/[EnginePeer]
- WebSessionsContextState.peers → [EnginePeer.Id: EnginePeer]
- CacheUsageStats.peers → [EnginePeer.Id: EnginePeer]
- PeerCommand.peer → EnginePeer
- PeerInfoControllerMode.calls(messages:) → [EngineMessage]
- CallControllerNodeProtocol.updatePeer → EnginePeer params
- ChatHistoryListNode.messageInCurrentHistoryView (and 4 variants) → EngineMessage?
- ChatHistorySearchContainerNode.messageForGallery → EngineMessage?
- PeerInfoPaneNode.findLoadedMessage / ensureMessageIsVisible /
  transitionNodeForGallery → engine-typed
- GalleryHiddenMediaTarget.getTransitionInfo /
  GalleryHiddenMediaManager.findTarget → engine-typed
- ChatPanelInterfaceInteraction.presentReactionDeletionOptions /
  presentBan*MessageOptions → EnginePeer
- DrawingMessageRenderer.messages → [EngineMessage]
- ChatVideoGalleryItemScrubberView.setFetchStatusSignal →
  EngineMediaResource.FetchStatus
- ChannelDiscussionGroupActionSheetItem.peer, VoiceChatPeerEntry.peer,
  VoiceChatFullscreenParticipantItem.peer, MediaStreamComponent.chatPeer,
  MediaStreamVideoComponent.callPeer, ChatMessageContactBubbleContentNode.contactPeer,
  ChatMessageForwardInfoNode.peer, ChatMessageCommentFooterContentNode.replyPeers,
  ChatReportPeerTitlePanelNode.peer, ChatMessageActionUrlAuthController.bot,
  PeerMediaCollectionInterfaceState.peer, ChatMessageCallBubbleContentNode.peopleAvatars,
  ChatLoadingNode.renderedPeer (→ EngineRenderedPeer) — all to engine types

**Wave-71-shadow stored-field migrations** (Postbox Peer/Message → Engine wrapper):
- LegacyCallControllerNode.peer
- CallStatusBarNode.currentPeer

**Dead-code / dead-field removals**:
- CallController.peer, CallControllerNodeV2.account,
  ContactMultiselectionController PeerNameIndex fields,
  preparedChatListNodeViewTransition account: Account param,
  FetchResource.swift entirely (unused function)

**Module-level Postbox import drops**: 30+ files including TelegramRootController,
EditStories, GiftViewScreen, AnimatedStickerUtils, FetchPhotoLibraryImageResource,
PeerInfoGiftsPaneNode, PeerInfoPaneContainerNode, PresentAddMembers,
PeerInfoProfileItems, ChatControllerAdminBanUsers, PresentationData typealiases,
DefaultDayPresentationTheme, ChatListViewTransition, GalleryHiddenMediaManager,
RecentSessionsController, GifContext, AuthorizationSequenceController,
PeerInfoHeaderEditingContentNode, PeerInfoHeaderNode,
PeerAllowedReactionListController, CallControllerNodeV2, and 6 PeerInfo pane files.

**AnyObject restoration**: rule 8 added (never substitute Postbox protocols
with Any/AnyObject) — undid previous AnyObject substitutions in waves 141/143
back to EngineMedia.

Doc maintenance: CLAUDE.md updated to reflect new typealiases and forwarders.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 00:44:27 +02:00
isaac
fdb2f369ec Rich bubble: scrollToAnchor + getAnchorRect
Adds a base getAnchorRect on ChatMessageBubbleContentNode, the rich-bubble
override (including titleHeight in details recursion), bubble-item
forwarding to content nodes, ChatControllerInteraction.scrollToMessageIdWithAnchor,
and a scrollToAnchor that lands the anchor at the top of the content area /
its line. Threads anchor/scroll params through ChatController and related
call sites.
2026-05-02 00:36:34 +02:00
isaac
7ef7f16727 Improve animations 2026-04-30 12:56:55 +04:00
Ilya Laktyushin
d25010c1cb Various fixes 2026-04-29 12:46:08 +02:00
Ilya Laktyushin
c4e1049396 Various fixes 2026-04-27 01:36:16 +02:00
isaac
68a95f53f2 Various improvements 2026-04-24 23:21:05 +04:00
isaac
8408e0ae19 Postbox -> TelegramEngine waves 27-36
Consumer-sweep, facade-addition, and Peer→EnginePeer migrations:

- Wave 27: preferencesView consumer sweep
- Wave 28: resourceData consumer sweep
- Wave 29: resourceStatus consumer sweep
- Wave 30: _asStatus() bridge cleanup
- Wave 31: unused-import sweep re-run
- Wave 32: resourceStatus residue sweep
- Wave 33: loadedPeerWithId consumer sweep
- Wave 34: FoundPeer.peer Peer -> EnginePeer
- Wave 35: SendAsPeer.peer Peer -> EnginePeer
- Wave 36: ContactListPeer.peer Peer -> EnginePeer

Also includes per-wave specs, implementation plans, outcome logs, and
a CLAUDE.md wave-counter update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:24:13 +04:00
isaac
524c29cbe3 Various improvements 2026-04-22 00:32:34 +04:00
Isaac
8edaa79eda Merge commit '23c4d94748' 2026-04-19 23:54:22 +02:00
Isaac
791bb62148 Display/ListView: snap-scroll to pinned item + synchronous history transactions
Adds an experimentalSnapScrollToPinnedItem path that resnaps scroll to
the first pinToEdgeWithInset item after inset/visible-size updates and
on empty itemNodes. Promotes ListViewItem to AnyObject and adds a
pinToEdgeWithInset protocol requirement with a default of false.

Also runs chat history transactions synchronously when updating scroll
around correlated messages, and tightens beganInteractiveDragging weak-
self handling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:18 +02:00
Ilya Laktyushin
d88a29b378 Various improvements 2026-04-18 08:41:08 +02:00
Ilya Laktyushin
0df319742a Update API 2026-04-16 01:18:22 +02:00
Ilya Laktyushin
265b502f76 Various fixes 2026-03-28 15:55:50 +01:00
Isaac
911ebd07ab Update 2026-03-27 19:23:09 +08:00
Isaac
2907ddbe46 Unseen polls 2026-03-27 18:30:01 +08:00
Ilya Laktyushin
77cc01f0d9 Various fixes 2026-03-26 13:58:50 +01:00
Isaac
bc7858ad2b AI editing 2026-03-20 18:23:45 +01:00
Ilya Laktyushin
b1a190f87a [WIP] Polls 2026-03-16 18:07:12 +01:00
Ilya Laktyushin
3a311f75bd Update API 2026-03-16 13:37:36 +01:00
Isaac
efb828e61b Metrics 2026-03-10 11:54:23 +01:00
Isaac
9a4327116d Refactor 2026-03-10 00:38:36 +01:00
Ilya Laktyushin
e3c84fce71 Various fixes 2026-02-27 14:34:18 +04:00
Isaac
002df956d2 Bug fixes 2026-02-06 17:14:35 +04:00
Isaac
45b1306274 Various improvements 2026-02-06 15:18:17 +04:00
Isaac
1bb139ff32 Various improvements 2026-02-03 20:17:44 +08:00
Isaac
3a1d85784e Various improvements 2026-01-06 21:20:16 +08:00
Isaac
586f5039f1 Merge commit '974a2f6caa'
# Conflicts:
#	submodules/TelegramUI/Components/GlobalControlPanelsContext/Sources/GlobalControlPanelsContext.swift
#	submodules/TelegramUI/Components/LiquidLens/Sources/LiquidLensView.swift
#	submodules/TelegramUI/Components/TranslateHeaderPanelComponent/Sources/ChatTranslationPanelNode.swift
#	submodules/TelegramUI/Sources/ChatControllerNode.swift
2025-12-26 20:34:31 +08:00
Isaac
4a13c3830a Glass 2025-12-26 20:29:30 +08:00
Ilya Laktyushin
974a2f6caa Various improvements 2025-12-26 13:34:23 +04:00
Isaac
0c3530d8a8 Glass 2025-12-10 00:16:36 +08:00
Ilya Laktyushin
6bc1fe1939 Various improvements 2025-12-01 19:54:58 +04:00
Isaac
54d2b58eb3 Updates 2025-09-30 21:52:21 +08:00
Isaac
04765e0c36 Update 2025-09-17 11:18:26 +04:00
Isaac
ebcd0557e5 Temp 2025-09-12 10:54:22 +02:00
Isaac
1d06c3f058 Bot forums v2 2025-09-05 15:25:50 +02:00
Ilya Laktyushin
a7924e7b6f Various improvements 2025-08-28 02:14:32 +04:00
Ilya Laktyushin
effaa875a6 Various improvements 2025-08-27 23:47:26 +04:00
Isaac
73ffed012f Merge commit 'bdc6b8f628' 2025-08-25 20:10:01 +02:00
Ilya Laktyushin
498ce24a09 Various fixes 2025-08-25 02:16:37 +04:00
Ilya Laktyushin
a60a437206 Various improvements 2025-08-22 21:46:07 +04:00
Isaac
290d955b59 Merge commit '75c773e694' 2025-08-22 15:31:35 +02:00
Isaac
114401f62b Various improvements 2025-08-22 15:31:31 +02:00
Ilya Laktyushin
ed2b41a1a1 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2025-08-21 09:08:54 +04:00
Ilya Laktyushin
0bac271cdb [WIP] Saved music 2025-08-21 09:08:35 +04:00
Isaac
ee749050f0 Bot forums 2025-08-19 17:24:33 +02:00
Isaac
826c48a4dc Bot updates 2025-08-15 13:35:06 +02:00
Isaac
905a46e6cc Update API 2025-08-11 16:54:32 +02:00
Isaac
b625243040 Various improvements 2025-07-29 15:48:11 +02:00