Ilya Laktyushin
91eb779ae2
Merge commit ' c64653ed37'
2026-05-14 12:45:26 +02:00
Ilya Laktyushin
7a7333edab
Various improvements
2026-05-05 14:57:06 +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
Ilya Laktyushin
ffd82647ee
Various fixes
2026-05-01 15:29:18 +02:00
Ilya Laktyushin
d212968040
Update API
2026-04-28 20:35:06 +02:00
isaac
f5cb1391aa
Merge commit ' 96b1432434'
2026-04-24 11:24:47 +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
Ilya Laktyushin
f41630083a
Various improvements
2026-04-24 03:16:14 +02:00
Isaac
7b2b74e79b
Postbox -> TelegramEngine wave 6: unused import Postbox batch sweep
...
First build-verified unused-import sweep: speculatively dropped
import Postbox from 782 consumer files (plain ^import Postbox$ lines,
excluding TelegramCore/Postbox/TelegramApi paths), iterated 18 full
project builds with --continueOnError, restored the import on every
file that failed to compile. 183 drops survived; 189 consumer modules
newly Postbox-free.
Bundled: spec + plan + C1 atomic batch drop + C2 CLAUDE.md outcome and
permanent methodology guidance under Wave-selection. The methodology
subsection captures the reusable playbook (--continueOnError is
essential, dependency graphs are deep so expect many iterations,
pattern-based preemptive restores accelerate convergence, and
CLAUDE.md's engine typealias cheat sheet arrows are migration targets
rather than typealiases in TelegramCore).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:46:13 +02:00
Isaac
f84e94f507
MediaResource → EngineMediaResource refactor: wave 2
...
Drive raw `MediaResource` out of the `TelegramEngine` public facade for
photo-upload APIs, and complete a first batch of consumer-side
migrations. Behavior-preserving. The `_internal_*` Postbox-facing
functions are untouched — only the facade signatures change, bridging
inside via `_asResource()` / `EngineMediaResource(_:)`.
TelegramEngine facades migrated (signatures now take EngineMediaResource):
- TelegramEngine.Peers.uploadedPeerPhoto / uploadedPeerVideo
- TelegramEngine.Peers.updatePeerPhoto (closure param too)
- TelegramEngine.AccountData.updateAccountPhoto / updateFallbackPhoto
- TelegramEngine.Contacts.updateContactPhoto
- TelegramEngine.Auth.uploadedPeerVideo
Consumer-side changes:
- MapResourceToAvatarSizes utility: signature is now
(engine: TelegramEngine, resource: EngineMediaResource, ...). Uses
engine.resources.data(id:) internally. The submodule drops
`import Postbox` and the Bazel dep.
- AuthorizationUI: avatar-video signal retyped from
Signal<TelegramMediaResource?> to Signal<EngineMediaResource?>.
- 27 `mapResourceToAvatarSizes(postbox:...)` call sites across 5
TelegramUI/TelegramCallsUI files migrated to the new form.
Deferred:
- SaveToCameraRoll (planned Task 8) abandoned — module has three
public functions taking `postbox: Postbox` (umbrella-type leak,
banned by rule 2) and requires a full module-migration wave, not a
type swap. Reason recorded in the wave-2 plan doc.
- Other TelegramEngine facades still leaking MediaResource
(TelegramEngineStickers.uploadSticker; UploadSecureIdFile.* —
additionally leaks Postbox) flagged for a future wave.
Docs:
- CLAUDE.md: new rule 7 (TelegramCore never imports UIKit/Display,
shared with Telegram-Mac), and a new "MediaResource →
EngineMediaResource consumer migration" section describing the
wrap/unwrap helpers and the modify-in-place facade-bridging
pattern.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 09:07:54 +02:00
Isaac
d575824ab4
Various improvements
2026-04-10 14:30:23 +02:00
Isaac
34477605b1
Various improvements
2026-03-31 20:24:24 +08:00
Isaac
dec912f2db
Update
2026-02-15 22:50:18 +04:00
Isaac
038a6e928c
Update
2026-02-14 23:20:28 +04:00
Ilya Laktyushin
96bb624b2d
Merge branch 'formatted-date-api'
2026-02-06 14:25:09 +04:00
Isaac
facd51e0f5
Fix buttons
2026-02-03 21:05:05 +08:00
Ilya Laktyushin
bbad57434f
Various fixes
2026-02-02 15:54:43 +04:00
Isaac
2db08cde89
Glass
2026-01-13 19:21:49 +04:00
Isaac
87187bd414
Fixes
2026-01-02 23:11:51 +08:00
Ilya Laktyushin
2bba31bcdf
Alerts
2025-12-22 23:28:04 +04:00
Isaac
1969b1b280
Merge commit ' 6db5077642' into experimental-3
2025-12-05 14:35:56 +08:00
Isaac
3b02aeae9d
Update localization
2025-12-02 22:15:52 +08:00
Isaac
42f10b4fed
Merge branch 'master' into glass-26
2025-12-02 17:30:38 +08:00
Isaac
8f1c9019be
Passkeys
2025-12-02 01:43:04 +08:00
Isaac
0055396d4d
Update
2025-11-26 23:05:30 +08:00
Isaac
95ecb88025
Passkeys
2025-11-19 00:07:50 +08:00
Ilya Laktyushin
6f5cd84019
Various improvements
2025-11-04 14:43:17 +04:00
Ilya Laktyushin
4432581c77
Various improvements
2025-10-31 18:13:30 +04:00
Ilya Laktyushin
76757b5f3d
Login email setup
2025-10-31 00:07:28 +04:00
Ilya Laktyushin
85092482f3
Various improvements
2025-10-17 17:01:25 +04:00
Ilya Laktyushin
0915a42e64
Various improvements
2025-10-16 05:30:06 +04:00
Ilya Laktyushin
fb7b93fbdc
Various improvements
2025-09-22 07:45:25 +04:00
Isaac
842711de04
Auth debug email
2025-09-12 10:55:11 +02:00
Isaac
e69f383a40
Auth payment help
2025-09-01 20:04:09 +02:00
Isaac
8e7e5fefb1
Various improvements
2025-09-01 18:43:34 +02:00
Ilya Laktyushin
ea2c1e24af
Various fixes
2025-08-25 03:43:22 +04:00
Ilya Laktyushin
e7c698d5f1
Various fixes
2025-08-23 21:40:21 +04:00
Ilya Laktyushin
2c07764a31
Fix purchase manager
2025-08-21 20:27:34 +04:00
Ilya Laktyushin
8abcfbd895
Various fixes
2025-08-21 16:01:12 +04:00
Ilya Laktyushin
9146a42cfa
Various improvements
2025-08-08 19:23:59 +04:00
Isaac
a23deded22
Cleanup
2025-06-28 19:48:34 +02:00
Ilya Laktyushin
c5223959b2
Various improvements
2025-06-19 01:26:50 +02:00
Ilya Laktyushin
4180b348f1
Various improvements
2025-05-22 06:12:04 +02:00
Ilya Laktyushin
81e11d6d36
Various improvements
2025-05-20 22:30:48 +02:00
Ilya Laktyushin
a8b02015ce
Various improvements
2025-03-24 05:27:50 +04:00
Ilya Laktyushin
bafbe20063
Various improvements
2025-03-11 18:48:35 +04:00
Ilya Laktyushin
80cd8f7b32
Various improvements
2025-03-11 06:49:43 +04:00
Ilya Laktyushin
2ecbaf4507
Various improvements
2025-03-10 15:32:15 +04:00
Ilya Laktyushin
cdd987e627
Various fixes
2025-03-07 21:56:17 +04:00