Commit graph

183 commits

Author SHA1 Message Date
Ilya Laktyushin
3e6363abf9 Various improvements 2026-05-28 16:50:05 +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
86d1456552 Postbox -> TelegramEngine waves 107-137 (squashed)
31 waves of consumer-side migration from `import Postbox` to TelegramEngine
typealiases. Net: 173 import drops + 39 BUILD-dep drops + 1 new typealias
(`EngineStoryId = StoryId`, wave 113).

Wave shapes used:
- Orphan-import sweeps (107, 108, 128): drop `import Postbox` from files
  whose only Postbox-symbol reference was the import line itself, then
  resolve build failures. Methodology requires token-level (`grep -oE`)
  filtering, not line-level, to avoid masking real Postbox usage on lines
  that also contain `Namespaces.X` references.
- Identifier-swap mini-waves (109-127, 129-134, 136-137): rename
  Postbox-typealiased identifiers to engine equivalents
  (PeerId -> EnginePeer.Id, MessageId -> EngineMessage.Id,
  MediaId -> EngineMedia.Id, MessageIndex -> EngineMessage.Index,
  StoryId -> EngineStoryId, ItemCollectionId -> EngineItemCollectionId,
  PreferencesEntry -> EnginePreferencesEntry,
  FetchResourceSourceType/Error -> EngineFetchResourceSourceType/Error,
  MemoryBuffer -> EngineMemoryBuffer, MessageTags -> EngineMessage.Tags,
  MessageAttribute -> EngineMessage.Attribute,
  TempBox -> EngineTempBox).
- Asset-string FP-only orphans (124).
- Typealias addition + drain (113): added `EngineStoryId` typealias to
  TelegramCore, then drained 3+11 consumer sites.

Hard blockers identified during these waves (must restore `import Postbox`
when present): MediaResource[A-Za-z]* (any suffix -- the literal
`MediaResource` matches don't catch MediaResourceData/MediaResourceId/etc.),
Postbox/MediaBox/MediaResource raw types, PostboxCoding/PostboxEncoder/
PostboxDecoder, TempBoxFile, ValueBoxKey, PostboxView, combinedView,
HashFunctions, postboxLog, openPostbox, declareEncodable, PeerView,
MessageHistoryView, MessageHistoryThreadData, CachedPeerData, RenderedPeer,
SelectivePrivacyPeer, SimpleDictionary, ItemCollectionInfosView,
ItemCollectionItem, ItemCollectionItemIndex, ItemCollectionViewEntryIndex,
ChatListIndex, ChatListEntrySummaryComponents, CodableEntry,
MessageHistoryThread, MessageHistoryAnchorIndex,
MessageHistoryEntryLocation, PeerStoryStats, PeerNameIndex,
PeerSummaryCounterTags, ChatListTotalUnreadStateCategory/Stats,
arePeersEqual. Protocol-shape blockers: bare `Peer`/`Message`/`Media`
in function signatures, generic args, enum-case payloads, or dict value
types (e.g., `[PeerId: Peer]`, `case messages([Message])`,
`Signal<(Peer?, ...), NoError>`).

`replace_all PeerId -> EnginePeer.Id` is dangerous: mangles compound
names like `failedPeerId`, `ContactListPeerId`, `nextRemoteMediaId`,
`replyToMessageId`. Pre-flight grep `\b[a-z][a-zA-Z]*PeerId\b` and only
replace_all if 0 matches.

Also removes unneeded design/plan docs from a separate (link-highlighting)
feature branch:
- docs/superpowers/plans/2026-05-02-link-highlighting-modern-path-fixes.md
- docs/superpowers/specs/2026-05-02-link-highlighting-modern-path-fixes-design.md

Squashed commits: 6d82c2980d..e6de5d53a3 (59 commits, including
per-wave content commits and per-wave CLAUDE.md bumps).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 10:28:50 +02: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
Ilya Laktyushin
21adc7d061 Various improvements 2026-03-30 02:55:35 +02:00
Ilya Laktyushin
f160fb99d9 Various improvements 2026-03-29 16:23:09 +02:00
Ilya Laktyushin
d0e26af8b1 Various fixes 2026-03-22 18:05:56 +01:00
Ilya Laktyushin
ea4bcd9a46 Various improvements 2026-03-21 09:47:17 +01:00
Ilya Laktyushin
96bb624b2d Merge branch 'formatted-date-api' 2026-02-06 14:25:09 +04:00
Isaac
2db08cde89 Glass 2026-01-13 19:21:49 +04:00
Isaac
4a13c3830a Glass 2025-12-26 20:29:30 +08:00
Ilya Laktyushin
6a09d2e4e6 Various improvements 2025-12-03 17:59:09 +04:00
Ilya Laktyushin
5046aab8ff Update API 2025-12-02 12:36:05 +04:00
Ilya Laktyushin
a443df81dd Various improvements 2025-11-15 02:12:21 +04:00
Ilya Laktyushin
f91fbff773 Various fixes 2025-11-14 12:47:55 +04:00
Ilya Laktyushin
5e17b321f8 Various improvements 2025-11-13 22:06:24 +04:00
Ilya Laktyushin
e9a3e599a1 Various improvements 2025-11-13 15:16:41 +04:00
Ilya Laktyushin
e680691988 Update API 2025-11-12 22:06:23 +04:00
Ilya Laktyushin
bdcc80e649 Various improvements 2025-11-12 18:20:38 +04:00
Ilya Laktyushin
412e02ef00 Gift auctions 2025-11-12 04:46:02 +04:00
Ilya Laktyushin
e7c698d5f1 Various fixes 2025-08-23 21:40:21 +04:00
Ilya Laktyushin
a60a437206 Various improvements 2025-08-22 21:46:07 +04:00
Ilya Laktyushin
0bac271cdb [WIP] Saved music 2025-08-21 09:08:35 +04:00
Ilya Laktyushin
88405d99ec Various improvements 2025-06-13 18:19:01 +02:00
Isaac
d486f529a3 Various improvements 2025-06-06 20:20:42 +08:00
Isaac
f1d0f694f5 [WIP] Monoforums 2025-05-21 00:23:48 +08:00
Isaac
109fa6b537 [Temp] 2025-05-20 17:25:39 +08:00
Isaac
4bbea1f0d0 Conference improvements 2025-04-18 17:56:24 +04:00
Isaac
ebdd7b37ed Fix call panel 2025-04-17 22:01:19 +04:00
Isaac
aaf52d4282 Conference calls 2025-03-30 02:06:50 +04:00
Isaac
3e74304640 [WIP] Conference calls 2025-02-06 21:12:05 +04:00
Isaac
8103b08ec0 Update localization 2024-11-15 00:52:38 +04:00
Isaac
3797f3af4f Video improvements 2024-11-08 16:26:01 +01:00
Isaac
de6836fa5d Various improvements 2024-11-05 15:33:17 +01:00
Ilya Laktyushin
6109477015 Various improvements 2024-08-11 00:14:00 +02:00
Ilya Laktyushin
39598deb04 Add reply action in gallery 2024-07-03 21:43:18 +04:00
Ilya Laktyushin
acf905a098 Various improvements 2024-04-20 19:37:16 +04:00
Isaac
efae3b90a7 Support Xcode 15.3 2024-04-02 19:16:00 +04:00
Isaac
27c5ca7474 Various improvements 2024-01-29 22:23:50 +01:00
Isaac
d4f7440703 Saved message improvements 2024-01-29 21:23:19 +01:00
Isaac
5e4a9cff28 [WIP] Saved tags 2024-01-10 00:45:01 +04:00
Ilya Laktyushin
f11c070862 [WIP] View-once audio messages 2023-12-29 04:50:22 +04:00
Ali
af8474aca5 [WIP] Quotes and link previews 2023-10-18 01:11:23 +04:00
Ali
77a5857a25 Sharing refactoring 2023-08-15 23:57:04 +04:00
Ilya Laktyushin
be6541cf4a Various fixes 2023-06-30 21:03:49 +02:00
Ilya Laktyushin
8ac9121c5e Stories improvements 2023-06-27 20:53:24 +02:00
Ali
34e8c54bb0 Stories 2023-06-20 12:26:09 +03:00
Ali
39b395c2fa Stories 2023-06-19 23:59:38 +03:00
Ali
6a548e11a6 Refactoring [skip ci] 2023-04-19 23:47:38 +04:00
Ali
6e3cc4a6e9 Refactoring 2023-04-17 20:21:14 +04:00