Commit Graph
96 Commits
Author SHA1 Message Date
isaacandisaac 13a153aff2 WIP 2026-05-20 00:33:08 +08:00
isaacandisaac 4107263747 Postbox refactor waves 358-426
Squashed range bf01b4c..a66739c (70 commits) covering 69 waves of the
Postbox -> TelegramEngine consumer migration plus a few BUILD-dep
followups.

Notable additions to TelegramCore in this range:
- Engine typealiases: EngineRawPeerPresence, EngineRawValueBoxKey,
  EngineSimpleDictionary, EngineRawPeerView, EngineRawPostboxViewKey,
  EngineRawPreferencesView, EngineRawMessageHistoryView (+ entry/attrs/
  read-state), EngineMessageIdNamespaces, EngineHistoryViewInputAnchor,
  EngineRawUnreadMessageCountsItem, EngineRawMessageHistorySavedMessages
  IndexView, EngineRawChatInterfaceStateView, EngineRawOrderedItemList
  View, EngineRawMessageHistoryThreadIndexView, EngineRawCombinedRead
  StateView, EngineRawMessageHistoryThreadInfoView, EngineRawBasicPeer
  View, EngineRawCachedPeerDataView, EngineMessageHistoryThreadData,
  EngineViewUpdateType, EngineInitialMessageHistoryData,
  EnginePeerGroupId, EngineChatLocationInput, EngineHistoryViewInputTag.
- Engine data items: Peer.CachedData, ItemCollections.InstalledPackInfos,
  ItemCollections.InstalledPackIds.
- Engine facade: TelegramEngine.ItemCollections.allItems(namespace:).
- Free function: engineAreMediaArraysEqual forwarder.

Net effect: 65+ consumer modules drop "import Postbox"; 131 files
changed (+1386 / -1493). Build green at HEAD.
2026-05-07 07:36:30 +02:00
isaacisaacClaude Opus 4.7
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
isaacisaacClaude Opus 4.7
7ccb382f53 Postbox -> TelegramEngine waves 103-105 (squashed)
Wave 103 (original): ChatRecentActionsControllerNode.peer Peer ->
EnginePeer migration ABANDONED after pre-flight discovered a 75-site
ADD-bridge cascade through chatRecentActionsHistoryPreparedTransition
into Message.peers SimpleDictionary<PeerId, Peer> store sites.
Lessons captured in docs/superpowers/postbox-refactor-log.md "Wave 103
ABANDONED" section + ~/.claude/projects/-Users-isaac-build-telegram
-telegram-ios/memory/feedback_wave71_shadow_risk.md (4-layer pre-flight
checklist for stored-Peer-field migrations).

Wave 103 (retry, 92230b0691): drained 5 accountManager.mediaBox
.storeResourceData Shape-A sites against the wave-94 facade. 2 files /
3 Edit calls (1 single + 2 replace_all) / 1-iter / 29.5s build. Closes
the storeResourceData accountManager-side drain entirely.

Wave 104 (08fc3f721e): drained 3 of 8 accountManager.mediaBox.resourceData
Shape-A sites against the wave-32/wave-94 AccountManagerResources.data
(resource:) facade + 3 consumer-side .complete -> .isComplete renames
(EngineMediaResource.ResourceData field rename). 1 file / 6 Edit calls
/ 1-iter / 11.7s build. 5 of 8 candidates deferred behind Postbox-typed
-function-parameter barriers (fetchCachedScaled*Representation cascade,
combineLatest typed-tuple coupling). Established the "Postbox-typed
-function-parameter barrier registry" pattern.

Wave 105 (0c76724409): DeviceContactInfoSubject enum 3 case Peer?
payloads + 2 callback signatures + 1 computed property migrate to
EnginePeer?. 5 files / 17 edits / 1-iter / 203s build (foundational
AccountContext touch). Net wrap delta -8 (10 drops, 2 ADD bridges, 1
downcast->case-let). First wave-71-shadow-style migration after the
wave-103 abandonment forced a discipline reset; first-pass-clean via
thorough pre-flight inventory (~15 min).

Net session progress: -16 wraps across 4 wave attempts plus durable
scaffolding (feedback memory, barrier registry, 4-layer pre-flight
checklist).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 16:57:55 +04:00
isaacandisaac f5cb1391aa Merge commit '96b1432434205e2d09d7615bde1402d762ac2b8c' 2026-04-24 11:24:47 +04:00
isaacisaacClaude Opus 4.7
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
Ilya Laktyushin 96b1432434 Various improvements 2026-04-24 04:55:22 +02:00
Ilya Laktyushin f41630083a Various improvements 2026-04-24 03:16:14 +02:00
Ilya Laktyushin 352d9f24e8 Fix build 2026-04-16 00:03:09 +02:00
Ilya Laktyushin 8f1e024aef Various fixes 2026-04-15 23:12:53 +02:00
IsaacandIsaac 16c630b946 Refactoring 2026-04-03 15:50:39 +08:00
Ilya Laktyushin 8f8dca5795 Allow attach menu apps in paid message chats 2026-03-30 03:01:36 +02:00
IsaacandIsaac c9add89043 More ai button fixes 2026-03-27 22:33:54 +08:00
Ilya Laktyushin a1c4e02a06 Various fixes 2026-03-27 01:46:27 +01:00
Ilya Laktyushin 5ed2f0ad1e Various fixes 2026-03-23 00:17:18 +01:00
Ilya Laktyushin 8098f24f4e Various improvements 2026-03-22 16:41:22 +01:00
Ilya Laktyushin 66d08c0e1b Various improvements 2026-03-22 13:44:04 +01:00
Ilya Laktyushin ea4bcd9a46 Various improvements 2026-03-21 09:47:17 +01:00
Ilya Laktyushin 2a55559f82 Various fixes 2026-03-20 15:46:56 +01:00
Ilya Laktyushin c32f645f5e [WIP] Polls 2026-03-17 16:32:49 +01:00
Ilya Laktyushin 6519b5c84d [WIP] Polls 2026-03-17 11:12:58 +01:00
Ilya Laktyushin cbc5a49507 [WIP] Polls 2026-03-13 11:04:33 +01:00
Ilya Laktyushin b87a202329 Various fixes 2026-02-28 00:35:08 +04:00
Ilya Laktyushin 1d80861e09 Various improvements 2026-02-23 13:51:13 +04:00
Ilya Laktyushin 8def1683b9 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-02-21 13:45:36 +04:00
Ilya Laktyushin d9d1210c1d Various improvements 2026-02-19 21:53:26 +04:00
Ilya Laktyushin 2edce5ebf2 Alerts 2025-12-22 00:19:11 +04:00
Ilya Laktyushin 0915a42e64 Various improvements 2025-10-16 05:30:06 +04:00
Ilya Laktyushin 9a414b9f09 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2025-07-02 14:31:56 +02:00
Ilya Laktyushin 37cea84896 Update API 2025-07-02 14:30:55 +02:00
IsaacandIsaac adbc7bad61 Various improvements 2025-07-01 14:57:33 +02:00
Ilya Laktyushin c2a10931b6 Various improvements 2025-06-29 11:57:12 +02:00
Ilya Laktyushin 2ce6d8c66c Various fixes 2025-06-28 23:51:09 +02:00
IsaacandIsaac 10c28d982e Various improvements 2025-06-27 12:45:19 +02:00
Ilya Laktyushin 4d0d62075a Various improvements 2025-06-20 23:01:21 +02:00
Ilya Laktyushin 2f440b5453 Various improvements 2025-06-19 15:17:38 +02:00
Ilya Laktyushin c5223959b2 Various improvements 2025-06-19 01:26:50 +02:00
IsaacandIsaac 2c53fd2273 Update API 2025-06-13 02:15:04 +08:00
Ilya Laktyushin 41ae916106 Various improvements 2025-06-08 18:28:49 +02:00
IsaacandIsaac c984cb956b Monoforums 2025-05-27 00:56:39 +08:00
Ilya Laktyushin 40780242fe Support poll options count configuration 2025-05-22 21:54:12 +02:00
IsaacandIsaac 417908a179 Merge commit '6c337b0f8473092b0eb5b23bdbc69286c1f81ac4' 2025-05-22 02:29:25 +08:00
IsaacandIsaac 4c3ad04015 Refactor chat controller data management 2025-05-22 02:29:14 +08:00
Ilya Laktyushin 81e11d6d36 Various improvements 2025-05-20 22:30:48 +02:00
Ilya Laktyushin a8c7b217a4 Various improvements 2025-04-21 17:02:37 +04:00
IsaacandIsaac dcde323740 Conference 2025-04-11 17:16:36 +04:00
Ilya Laktyushin 5956d5142f Various improvements 2025-03-21 18:41:49 +04:00
Ilya Laktyushin fed338985d Various improvements 2025-03-14 13:35:44 +04:00
Ilya Laktyushin b378b7b282 Various fixes 2025-03-08 03:14:09 +04:00
Ilya Laktyushin e351bbfd42 Various fixes 2025-03-01 19:38:31 +04:00