Commit Graph
1576 Commits
Author SHA1 Message Date
isaacisaacClaude Opus 4.7
d1aa0db537 Postbox -> TelegramEngine waves 46-93 (squashed)
Squash of 63 commits spanning waves 46-93 (plus interspersed docs commits)
of the gradual Postbox->TelegramEngine consumer-side migration.

Scope: 139 files changed, 2123 insertions(+), 452 deletions(-).

## Themes by wave-block

**Waves 46-58 — Peer field migrations + facade additions**
Foundational EnginePeer convenience init additions (PeerReference, RenderedPeer,
SelectivePrivacyPeer). Multiple `peer: Peer` field migrations across PeerInfo,
ChatList, and SettingsUI components.

**Waves 59-73 — peer field cascade + EnginePeer wrap drops**
Series of single- to two-file peer-field migrations; consumer-side wrap
removal (`EnginePeer(peer)` -> direct EnginePeer use); `as? TelegramUser`
cast conversion to `case let .user(...)` enum match. Wave 64: RenderedPeer
convenience init. Wave 68: SelectivePrivacyPeer convenience init.

**Waves 74-83 — controller-Node bridge cleanup + small migrations**
Wave-71 shadow-pattern cleanup at controller->Node bridges. Migrations of
ChatRecentActionsController.peer (74), PeerInfoMember (75), MentionChatInputPanelItem
(76), PassportUI SecureIdAuthController (77), AccountWithInfo + ShareController
(78), peerInputActivitiesPromise (79), InactiveChannel (80), BlockedPeers (81),
openHashtag resolveSignal (82), NotificationExceptionsList (83).

**Waves 84-90 — TelegramEngine.Resources facade migrations**
Per-method Shape-A/B sweeps converting `<ctx>.account.postbox.mediaBox.X(...)`
to `<ctx>.engine.resources.X(...)`. Wave 90 was a single-commit big sweep:
40 fetchedMediaResource sites in 25 files migrated to engine.resources.fetch
facade in one atomic pass with first-pass-clean build.

Methods covered: storeResourceData, completedResourcePath, cancelInteractiveResourceFetch,
resourceRangesStatus, resourceStatus, fetch (fetchedMediaResource).

**Waves 91-92 — additional type migrations**
Wave 91: ItemListWebsiteItem.peer + RecentSessionsController enum-case payload
+ openWebSession callback Peer? -> EnginePeer?.
Wave 92: ChatListController StateHolder.EntryContext status type
MediaResourceStatus -> EngineMediaResource.FetchStatus.

**Wave 93 — speculative `import Postbox` drop sweep**
Drop import from 7 wave-touched files where it became unused; restore in 5
files where bare PeerId/Message/MediaId/StoryId references escaped the
pre-flight regex. Includes one MediaId(...) -> EngineMedia.Id(...) swap in
InAppPurchaseManager to unlock its import drop.

## Build state

Final state at squash: clean Telegram/Telegram build at debug_sim_arm64.

## Persistent-state notes

- Pre-existing WIP unchanged across the squashed range:
  - build-system/bazel-rules/sourcekit-bazel-bsp submodule marker
  - Untracked: build-system/tulsi/, submodules/TgVoip/, third-party/libx264/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 20:48:15 +04:00
isaacisaacClaude Opus 4.7
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
isaacandisaac f5cb1391aa Merge commit '96b1432434205e2d09d7615bde1402d762ac2b8c' 2026-04-24 11:24:47 +04:00
isaacandisaac 97f8c53814 Various improvements 2026-04-24 11:24:14 +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 e3bf0cd30c Various fixes 2026-04-23 01:26:13 +02:00
Ilya Laktyushin dbd40fe7d3 Various improvements 2026-04-22 23:03:51 +02:00
isaacisaacClaude Opus 4.7
fa68639b25 Postbox -> TelegramEngine wave 26: resourceRangesStatus + removeCachedResources facades + sweep
Adds two TelegramEngine.Resources facades and migrates 4 Shape-A sites across 3 consumer files.
Also imports RangeSet in TelegramEngineResources.swift to disambiguate the RangeSet type from
Swift stdlib's iOS-18-only type.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 04:18:03 +04:00
isaacisaacClaude Opus 4.7
b20cd3502b Postbox -> TelegramEngine waves 11-14: stateManager collapse + BUILD-dep sweep
Wave 11: ActionSheetPeerItem de-Postboxed. Revisits wave-1 abandonment.
`postbox: Postbox, network: Network` init params collapse to
`stateManager: AccountStateManager`; avatar setPeer call routes via
`item.stateManager.postbox` / `.network`. Module never names Postbox.
Sole caller (ShareController.swift:1146) migrated in place.

Wave 12: HorizontalPeerItem de-Postboxed (same pattern). Ripples the
collapse up into ChatListSearchRecentPeersNode's public init
(`postbox:/network:` -> `stateManager:`). That module still imports
Postbox for PostboxViewKey/UnreadMessageCountsView internals but its
public surface simplifies. 3 external caller sites migrated.

Wave 13: AttachmentTextInputPanelNode minor cleanup. Module was already
Postbox-free at source level (wave 6) but carried a dead BUILD dep and
had 2 raw `peerId?.namespace == Namespaces.Peer.SecretChat` checks.
Both now use existing `PeerId.isSecretChat` extension in TelegramCore.

Wave 14: BUILD-dep sweep mirroring wave 6's source sweep. 98 modules
had `//submodules/Postbox:Postbox` (or `//submodules/Postbox`) BUILD
deps despite no source file importing Postbox since wave 6. Single
iteration, zero restores -- Bazel Swift requires source-level `import`
for symbol resolution, so redundant BUILD deps are pure metadata.

Net: 110 files, +116/-149. Build verified green (debug_sim_arm64).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 20:26:58 +02:00
IsaacIsaacClaude Opus 4.7
b2ba4b5878 Postbox -> TelegramEngine wave 7: last TelegramEngine.* facade leaks
Closes the seven remaining raw-Postbox leaks in TelegramEngine public
facades surfaced by a post-wave-6 scouting pass (all non-permanently-
blocked candidates).

Facades migrated in place (6 rewrites + 1 deletion; all _internal_*
implementations unchanged per the "internal Postbox-facing stays raw"
rule):

  Messages:
    downloadMessage                          Signal<Message?>           -> Signal<EngineMessage?>
    topPeerActiveLiveLocationMessages        Signal<(Peer?, [Message])> -> Signal<(EnginePeer?, [EngineMessage])>
    getSynchronizeAutosaveItemOperations     deleted (dead facade; sole caller uses _internal_ directly)

  Peers:
    updatedRemotePeer                        Signal<Peer>  -> Signal<EnginePeer>
                                             (PeerReference param kept; no EnginePeer.Reference alias today)

  Resources:
    renderStorageUsageStatsMessages          [EngineMessage.Id: Message]  -> [EngineMessage.Id: EngineMessage]
    clearStorage(peerId: ...)                [Message]                     -> [EngineMessage]
    clearStorage(peerIds: ...)               [Message]                     -> [EngineMessage]
    clearStorage(messages:)                  [Message]                     -> [EngineMessage]
                                             (no external callers; migrated for overload-set consistency)

Consumer call-site updates (5 files):
  - ChatListSearchListPaneNode       drop redundant .flatMap(EngineMessage.init) wrap
  - LocationViewControllerNode       drop redundant .map(EngineMessage.init) wrap
  - LiveLocationSummaryManager       drop redundant EnginePeer(...) / EngineMessage(...) ctors
  - StorageUsageScreen               bridge [Message] <-> [EngineMessage] at the 4 facade-call points
                                     (internal [MessageId: Message] / [Message] storage kept;
                                      full-consumer-module migration is out of scope)

Discovery: grep of TelegramEngine/*/TelegramEngine*.swift public signatures
for `: Postbox|: Account|: MediaBox|: MediaResource|: Peer\b|: Message\b|
-> Signal<.*(Peer|Message)` turned up these seven candidates and no others.
After this wave, the full TelegramEngine.* facade surface is engine-typed
modulo the four permanently-blocked TelegramMediaResource-conforming
classes recorded in CLAUDE.md (ICloudFileResource, InstantPageExternal-
MediaResource, VideoLibraryMediaResource, YoutubeEmbedStoryboardMedia-
Resource).

No modules became Postbox-free in this wave. Plan: docs/superpowers/
plans/2026-04-20-postbox-to-telegramengine-wave-7.md.

Full project build verified green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 00:25:28 +02:00
Ilya Laktyushin d88a29b378 Various improvements 2026-04-18 08:41:08 +02:00
Ilya Laktyushin 532a3ae3e1 Various fixes 2026-04-16 21:45:26 +02:00
Ilya Laktyushin 8f1e024aef Various fixes 2026-04-15 23:12:53 +02:00
IsaacandIsaac d89a4a79cf Various improvements 2026-04-07 16:48:11 +02:00
IsaacandIsaac f3e1795b68 Temp 2026-04-07 08:11:27 +02:00
IsaacandIsaac 648430e37d Various improvements 2026-04-03 22:15:42 +08:00
IsaacandIsaac 16c630b946 Refactoring 2026-04-03 15:50:39 +08:00
IsaacandIsaac e8510c1a8a Fix search filter display 2026-03-31 23:05:28 +08:00
IsaacandIsaac 796826b0ad Various improvements 2026-03-31 22:42:02 +08:00
IsaacandIsaac 34477605b1 Various improvements 2026-03-31 20:24:24 +08:00
IsaacandIsaac d11a967936 Merge commit 'fd68aed7665cdd25242a79a061ac61c42547b834' 2026-03-27 19:24:49 +08:00
IsaacandIsaac 2907ddbe46 Unseen polls 2026-03-27 18:30:01 +08:00
Ilya Laktyushin ed55943a44 Various improvements 2026-03-27 01:13:38 +01:00
Ilya Laktyushin 77cc01f0d9 Various fixes 2026-03-26 13:58:50 +01:00
Ilya Laktyushin e11c9899e6 Various fixes 2026-03-23 15:03:50 +01:00
Ilya Laktyushin 6fd65e6d26 Various improvements 2026-03-22 16:53:55 +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 6519b5c84d [WIP] Polls 2026-03-17 11:12:58 +01:00
Ilya Laktyushin b1a190f87a [WIP] Polls 2026-03-16 18:07:12 +01:00
Ilya Laktyushin 3a311f75bd Update API 2026-03-16 13:37:36 +01:00
Ilya Laktyushin cbc5a49507 [WIP] Polls 2026-03-13 11:04:33 +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
IsaacandIsaac e4e5142a96 Various improvements 2026-03-10 17:50:37 +01:00
IsaacandIsaac 9a4327116d Refactor 2026-03-10 00:38:36 +01:00
Ilya Laktyushin 713f557e64 Update API 2026-03-09 14:32:10 +01:00
Ilya Laktyushin d5ccfe2812 Various fixes 2026-03-06 10:48:10 +04:00
Ilya Laktyushin e12e096919 Various fixes 2026-02-27 00:53:51 +04:00
Ilya Laktyushin aec6a54b5d Update localization 2026-02-24 19:12:54 +04:00
Ilya Laktyushin 5d50aa34af Various improvements 2026-02-23 21:25:25 +04:00
Ilya Laktyushin 4203d70414 Various improvements 2026-02-23 18:45:47 +04: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
IsaacandIsaac 26cc304ca0 Fix bg 2026-02-17 10:19:02 +04:00
IsaacandIsaac 8b56eb602e Merge commit '9616ea2ad9d4772595e6b5072254898e5061dd96' 2026-02-13 17:08:52 +04:00
Ilya Laktyushin 9616ea2ad9 Update API 2026-02-13 14:09:36 +04:00