Commit Graph
261 Commits
Author SHA1 Message Date
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
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
isaacandisaac 9ed75ca048 Fix build 2026-04-21 15:08:45 +04:00
isaacisaacClaude Opus 4.7
53f023ea52 Postbox -> TelegramEngine wave 21: completedResourcePath facade + consumer sweep
Combined wave-19+wave-20 shape. Adds TelegramEngine.Resources.completedResourcePath(id:, pathExtension:)
facade and sweeps 29 consumer sites across 14 files in one atomic commit.

Shape A/B migrated. Shape C (5 sites with raw account: Account) and Shape D
(3 sites with local postbox: Postbox field) intentionally skipped — need
module-scoped init-signature rework rather than per-site sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 03:19:30 +04:00
Ilya Laktyushin 21adc7d061 Various improvements 2026-03-30 02:55:35 +02:00
Ilya Laktyushin dca6b5f145 Various improvements 2026-03-12 13:51:27 +01:00
Ilya Laktyushin 0fdb24253f Various fixes 2026-03-03 20:41:19 +04:00
Ilya Laktyushin ad0f639fb5 Various fixes 2026-03-02 18:26:12 +04:00
IsaacandIsaac 622ea906ef Merge commit 'e24d411efa3d2e3316e6b6cf58862675ed61e3d1' 2026-02-24 17:19:36 +01:00
IsaacandIsaac 71b2ff998f Fix 2026-02-24 17:19:30 +01:00
IsaacandIsaac ad30eb2bc5 Update 2026-02-24 14:00:41 +01:00
Ilya Laktyushin 2c4c9a9d9b [WIP] Live photos 2026-02-20 13:28:58 +04:00
Ilya Laktyushin d9d1210c1d Various improvements 2026-02-19 21:53:26 +04:00
Ilya Laktyushin 22945ebb31 Various improvements 2025-11-07 14:13:09 +04:00
Ilya Laktyushin bda836f032 Various improvements 2025-11-05 20:25:07 +04:00
Ilya Laktyushin 5877f2c20d Various improvements 2025-10-29 17:20:36 +04:00
Ilya Laktyushin 0915a42e64 Various improvements 2025-10-16 05:30:06 +04:00
IsaacandIsaac 114401f62b Various improvements 2025-08-22 15:31:31 +02:00
IsaacandIsaac bc49c5e788 Update 2025-07-22 17:24:33 +02:00
IsaacandIsaac 140efd6cfd [WIP] Monoforums 2025-05-10 18:02:55 +01:00
Ilya Laktyushin 7afa30f3d8 Various fixes 2025-05-06 03:43:48 +04:00
Ilya Laktyushin 9e0600edfa Various fixes 2025-04-25 18:13:30 +04:00
Ilya Laktyushin 2962851527 Various improvements 2025-04-22 21:06:46 +04:00
Ilya Laktyushin a8c7b217a4 Various improvements 2025-04-21 17:02:37 +04:00
Ilya Laktyushin 66d1aedcb0 Various fixes 2025-03-19 22:03:17 +04:00
Ilya Laktyushin 681b5c9d3a Various improvements 2025-01-28 19:59:32 +04:00
Ilya Laktyushin 10ac25e1cb Various improvements 2025-01-27 23:44:07 +04:00
Ilya Laktyushin d1eec8686f Various improvements 2025-01-23 01:37:20 +04:00
Ilya Laktyushin 103b244216 Various improvements 2025-01-22 20:33:42 +04:00
Ilya Laktyushin c0bfe87449 Various improvements 2025-01-22 13:24:13 +04:00
Ilya Laktyushin b0511f146e Various improvements 2025-01-10 05:15:00 +04:00
Ilya Laktyushin cdc82e4235 Update API 2025-01-06 16:00:43 +04:00
Ilya Laktyushin 5451053195 Various improvements 2024-12-22 17:16:14 +04:00
Ilya Laktyushin 1af9eb2806 Various fixes 2024-12-06 18:49:28 +04:00
Ilya Laktyushin eff6045b90 Various fixes 2024-12-01 14:38:33 +04:00
Ilya Laktyushin 6003931eec Various fixes 2024-11-30 15:47:37 +04:00
Ilya Laktyushin f81443e438 Various improvements 2024-11-29 21:58:17 +04:00
Ilya Laktyushin 06defbb3f6 Various fixes 2024-11-29 14:40:02 +04:00
Ilya Laktyushin 07436e4705 Various fixes 2024-11-29 13:12:12 +04:00
Ilya Laktyushin d2b5476293 [WIP] Story collage 2024-11-27 18:41:03 +04:00
Ilya Laktyushin 3d03fc94c6 Various improvements 2024-10-25 19:09:31 +04:00
Ilya Laktyushin 4f255424e5 Various fixes 2024-10-14 21:38:35 +04:00
Ilya Laktyushin d86112541f Various fixes 2024-08-02 18:25:02 +02:00
Ilya Laktyushin af3d440f5a Fix story link 2024-08-02 12:36:22 +02:00
Ilya Laktyushin cd810b940a Various fixes 2024-07-26 12:26:37 +02:00
Ilya Laktyushin 4414753d7f Various fixes 2024-07-25 21:44:05 +02:00
Ilya Laktyushin 14d36ceb0e Various fixes 2024-07-25 19:19:31 +02:00
Ilya Laktyushin b006c36c59 Various improvements 2024-07-24 10:28:56 +04:00
Ilya Laktyushin 1c7834ad57 Various improvements 2024-07-23 22:01:56 +04:00
Ilya Laktyushin 31ba87fb0f Various improvements 2024-07-22 20:43:52 +04:00