Commit graph

151 commits

Author SHA1 Message Date
isaac
0050cc7a08 Rich-message media in gallery/shared-media/preview pipelines via Message.effectiveMedia
Add Message/EngineMessage.effectiveMedia (= message.media when non-empty, else
richText.instantPage.allMedia()) and route the media-consuming sites through it
so a rich message's instant-page media participates in the same pipelines as
normal message.media: shared-media grids/file-rows, search media grid, gallery
open + item nodes + footer, the peer audio/voice playlist, secret-media preview,
resource-by-id resolution, recent downloads, downloaded-media store, delete-time
resource cleanup, cache-usage stats, the in-chat download manager, and the
context-menu / share actions (Save to Camera Roll, copy image, save audio/music
to files). For normal messages effectiveMedia == message.media, so each swap is
behavior-preserving; rich messages render their own bubble via
ChatMessageRichDataBubbleContentNode (not the text/file bubbles), so those paths
are deliberately untouched, as are the forward path (the attribute travels with
the forward) and the markdown-based rich-edit path. First-media scope for now.

See docs/instantpage-richtext.md for the full architecture + invariants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:46:56 +02:00
isaac
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
isaac
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
isaac
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
Isaac
4ae15b42a7 Postbox -> TelegramEngine wave 3: MediaBox fetch/status/data facades + SaveToCameraRoll
Adds three thin forwarding methods on TelegramEngine.Resources
(fetch, status, data) over MediaBox, then migrates SaveToCameraRoll's
three public functions to use them, drops import Postbox from the
module (source + Bazel dep), and updates all 23 call sites across 14
caller files atomically.

Bundled: spec + fix + plan + C1 facades + C2 SaveToCameraRoll rewrite
+ BUILD dep drop + CLAUDE.md outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:34 +02:00
Isaac
16c630b946 Refactoring 2026-04-03 15:50:39 +08:00
Isaac
2907ddbe46 Unseen polls 2026-03-27 18:30:01 +08:00
Ilya Laktyushin
b1a190f87a [WIP] Polls 2026-03-16 18:07:12 +01:00
Ilya Laktyushin
dff0a61d19 Various improvements 2025-07-19 12:51:42 +01:00
Ilya Laktyushin
dc0cf1d459 Fix build 2025-07-14 13:28:10 +01:00
Ilya Laktyushin
3b46e1d3d0 Various fixes 2025-06-26 14:09:26 +02:00
Ilya Laktyushin
23834d139b Various fixes 2025-05-22 15:23:28 +02:00
Isaac
f681453bd0 Update API 2025-05-17 00:34:35 +08:00
Isaac
09c49d47d9 [WIP] Monoforums 2025-05-16 21:03:00 +08:00
Ilya Laktyushin
e351bbfd42 Various fixes 2025-03-01 19:38:31 +04:00
Ilya Laktyushin
3f8152d0b1 Various fixes 2025-03-01 17:14:17 +04:00
Ilya Laktyushin
b2351194d4 Various fixes 2025-02-24 17:11:08 +04:00
Ilya Laktyushin
8d7f9bf372 Various improvements 2025-02-22 19:17:36 +04:00
Isaac
f17ead143a Various improvements 2025-02-18 14:43:23 +01:00
Isaac
c21ebb06b5 Finalize timestamp sharing 2025-01-24 21:03:39 +04:00
Isaac
40828e9037 [WIP] UI 2025-01-21 21:08:44 +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
6de753b14a Phone numbers improvements 2024-05-16 00:50:11 +04:00
Isaac
ca426d0f0b Fragment info 2024-03-08 18:43:18 +04:00
Ilya Laktyushin
16903cdffd Business intro screen 2024-02-16 15:29:55 -04:00
Isaac
51fcc024d6 Various improvements 2024-02-06 00:06:31 +04:00
Isaac
0cab0ca678 [WIP] Saved messages 2024-01-23 17:52:21 +01:00
Isaac
dc7541065d Tag saved message 2024-01-16 21:14:24 +04:00
Isaac
df1e522519 Update localization and hide new features 2024-01-14 22:13:41 +04:00
Isaac
eeba8a7db1 Privacy settings 2024-01-12 22:42:18 +04:00
Ilya Laktyushin
7d45c4c9d0 Various improvements 2023-12-16 15:57:24 +04:00
Ilya Laktyushin
ef28f034d8 Various improvements 2023-12-13 01:00:55 +04:00
Ilya Laktyushin
90f09a13e4 Various improvements 2023-11-22 03:24:33 +04:00
Ali
216b731562 Close external share when messages are deleted 2023-11-07 16:22:53 +04:00
Ali
21af13cfdb Re-implement external sharing to secret chats 2023-11-06 20:18:59 +04:00
Ali
a6e5098be0 Support the thread-quote special case 2023-10-25 17:59:55 +04:00
Ali
eae866c77e [WIP] Quotes 2023-10-07 00:33:12 +04:00
Ali
a5c62b1781 Fix sharing 2023-08-18 23:16:23 +04:00
Ali
77a5857a25 Sharing refactoring 2023-08-15 23:57:04 +04:00
Ali
eaaade13f2 Add experimental standalone share 2023-08-11 13:33:37 +04:00
Ali
f3ee06dd32 Stories 2023-07-07 02:03:11 +04:00
Ali
ebd414691c [WIP] Stories 2023-05-26 22:13:22 +04:00
Ali
4c72c3f75d FetchV2 improvements 2023-04-11 23:11:54 +04:00
Ilya Laktyushin
2adf8a010d Tune wallpaper pattern scale on iPad 2023-03-03 12:11:34 +04:00
Ilya Laktyushin
8733c482c7 Wallpaper pattern tiling in landscape 2023-02-28 22:26:01 +04:00
Ilya Laktyushin
7196bcf399 Fix saving for partially downloaded videos 2023-02-09 16:57:31 +04:00
Ali
b65d4c2243 UI improvements 2023-01-27 17:16:26 +01:00
Ali
d34302be47 Fix permissions in legacy groups 2023-01-27 14:37:49 +01:00
Ali
a21c98892b Fix share alert 2023-01-27 12:31:11 +01:00