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
3e6363abf9
Various improvements
2026-05-28 16:50:05 +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
493f3103b3
Postbox -> TelegramEngine waves 37-43 + wave 44 design/plan (squashed)
...
Squashes 20 commits — the implementation and outcome commits of
waves 37 through 43 plus wave 44's spec and implementation-plan
docs — into a single commit. Per-wave lessons remain recorded in
docs/superpowers/postbox-refactor-log.md. The unrelated "Add swift
svg" commit is preserved separately outside this squash.
Wave 37 — peerTokenTitle: peer Peer → EnginePeer (1 file)
Wave 38 — canSendMessagesToPeer: peer Peer → EnginePeer (12 files)
Wave 39 — AccountContext.makePeerInfoController: peer Peer → EnginePeer (52 files)
Wave 40 — makeChatQrCodeScreen + makeChatRecentActionsController bundle (8 files)
Wave 41 — RenderedChannelParticipant.peer: Peer → EnginePeer (28 files)
Wave 42 — PeerInfoScreenData.peer: Peer? → EnginePeer? (17 files)
Wave 43 — PeerInfoScreen 6 helpers: peer Peer? → EnginePeer? (12 files)
Wave 44 — RenderedChannelParticipant.peers design doc + implementation plan
(impl and outcome land in subsequent commits, not part of squash)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 23:19:43 +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
4ae15b42a7
Postbox -> TelegramEngine wave 3: MediaBox fetch/status/data facades + SaveToCameraRoll
...
Adds three thin forwarding methods on TelegramEngine.Resources
(fetch, status, data) over MediaBox, then migrates SaveToCameraRoll's
three public functions to use them, drops import Postbox from the
module (source + Bazel dep), and updates all 23 call sites across 14
caller files atomically.
Bundled: spec + fix + plan + C1 facades + C2 SaveToCameraRoll rewrite
+ BUILD dep drop + CLAUDE.md outcome.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:34 +02:00
Ilya Laktyushin
5c814c503e
Live photo saving
2026-04-07 19:16:22 +02:00
Ilya Laktyushin
7ea47b8105
Various fixes
2026-03-30 17:23:39 +02:00
Ilya Laktyushin
b3d4c97da4
Various improvements
2026-03-30 05:09:10 +02:00
Ilya Laktyushin
ca3eacda45
Various improvements
2026-03-30 04:37:05 +02:00
Ilya Laktyushin
ceceec2e94
Various fixes
2026-03-28 23:42:30 +01:00
Ilya Laktyushin
6df559ff97
Various fixes
2026-03-28 20:47:35 +01:00
Ilya Laktyushin
66d08c0e1b
Various improvements
2026-03-22 13:44:04 +01:00
Isaac
72fbe5d7a7
Various improvements
2026-03-13 14:54:44 +01:00
Ilya Laktyushin
dca6b5f145
Various improvements
2026-03-12 13:51:27 +01:00
Ilya Laktyushin
94923cc353
Reapply "Update API"
...
This reverts commit 0411cfc18c .
2026-03-11 18:51:44 +01:00
Ilya Laktyushin
0411cfc18c
Revert "Update API"
...
This reverts commit 6c1376169c .
2026-03-11 18:04:50 +01:00
Ilya Laktyushin
6c1376169c
Update API
2026-03-11 14:37:23 +01:00
Isaac
e4e5142a96
Various improvements
2026-03-10 17:50:37 +01:00
Ilya Laktyushin
2c4c9a9d9b
[WIP] Live photos
2026-02-20 13:28:58 +04:00
Isaac
fe8d847408
Gallery fixes
2026-02-13 18:09:56 +04:00
Isaac
157a7a978d
Glass
2026-02-13 17:08:48 +04:00
Isaac
45b1306274
Various improvements
2026-02-06 15:18:17 +04:00
Isaac
9c4e390f0d
Various improvements
2026-01-30 18:50:18 +08:00
Isaac
8422b48216
Glass gallery
2026-01-27 21:04:08 +08:00
Isaac
6ad2622b30
Various updates
2026-01-24 00:35:42 +08:00
Isaac
4f04dc0bb7
Glass
2026-01-20 21:35:04 +08:00
Isaac
2db08cde89
Glass
2026-01-13 19:21:49 +04:00
Isaac
ebcd0557e5
Temp
2025-09-12 10:54:22 +02:00
Ilya Laktyushin
91036bcdc2
Force external for video ads
2025-08-13 18:07:18 +04:00
Ilya Laktyushin
7076cc93a5
Various improvements
2025-06-29 20:35:33 +02:00
Ilya Laktyushin
be6890d189
Various improvements
2025-06-29 20:27:53 +02:00
Ilya Laktyushin
0a56b5bfa7
Various improvements
2025-06-20 00:16:21 +02:00
Ilya Laktyushin
2f440b5453
Various improvements
2025-06-19 15:17:38 +02:00
Ilya Laktyushin
f59abe1689
Various improvements
2025-06-10 22:11:07 +02:00
Ilya Laktyushin
9edf52ed36
Cleanup
2025-06-08 19:16:02 +02:00
Ilya Laktyushin
3fd4154ddd
Merge branch 'todo'
2025-06-08 18:33:02 +02:00
Ilya Laktyushin
41ae916106
Various improvements
2025-06-08 18:28:49 +02:00
Isaac
69feac4d97
Various improvements
2025-06-03 23:07:46 +08:00
Ilya Laktyushin
e5762bd9c8
Various fixes
2025-05-18 04:35:56 +04:00
Ilya Laktyushin
2454a7a876
Various improvements
2025-03-18 14:39:58 +04:00
Isaac
16768ffb10
Prevent media gallery from opening multiple times
2025-02-28 14:52:13 +01:00
Isaac
da48b145e9
Various improvements
2025-02-21 16:17:15 +01:00
Isaac
f17ead143a
Various improvements
2025-02-18 14:43:23 +01:00
Isaac
b5b720e4c0
Add kilsswitches
2025-01-29 23:02:11 +04:00
Isaac
3728be84cb
Video improvements
2025-01-28 20:51:04 +04:00
Isaac
c21ebb06b5
Finalize timestamp sharing
2025-01-24 21:03:39 +04:00
Isaac
8527ac0928
Pre-release
2025-01-21 22:07:43 +04:00
Isaac
40828e9037
[WIP] UI
2025-01-21 21:08:44 +04:00