45 Commits
Author SHA1 Message Date
Ilya Laktyushin 3e6363abf9 Various improvements 2026-05-28 16:50:05 +02:00
Ilya Laktyushin 91eb779ae2 Merge commit 'c64653ed37ce9fe2bc74e260e9e960fcf3ab5dc1' 2026-05-14 12:45:26 +02:00
isaacandClaude 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
isaacandClaude Opus 4.7 2ac8a490b0 Postbox -> TelegramEngine waves 94-102 (squashed)
Adds AccountManagerResources facade in TelegramCore mirroring
TelegramEngine.Resources, drains the entire accountManager-side
mediaBox refactor across consumer modules, and validates the
Shape-C/D handle-migration pattern (account: Account ->
engine: TelegramEngine) on three classes.

Wave 94 (AccountManagerResources facade + 8 sites): new
AccountManagerResources class in TelegramCore with
storeResourceData, completedResourcePath (resource + id overloads),
status (with approximateSynchronousValue), moveResourceData,
fetch. Migrate EditThemeController (5 storeResourceData + 2
completedResourcePath) and WebBrowserSettingsController (1
storeResourceData).

Wave 95 (10 sites): WallpaperUtils.swift sweep, 5 distinct
storeResourceData patterns, replace_all on the two repeated ones.

Wave 96 (7 sites): theme controller triple — TPC (1 store + 2
moveResourceData), TPCN (1 status + 1 fetch + closure type
MediaResourceStatus -> EngineMediaResource.FetchStatus + rename
account local to engine), TAC (1 completedResourcePath + 1 store).

Wave 97 (9 sites): WallpaperGalleryController.swift, 4
completedResourcePath + 5 storeResourceData via replace_all.

Wave 98 (2 files): WallpaperGallery status-type cascade
Promise<MediaResourceStatus> -> Promise<EngineMediaResource.FetchStatus>
across WallpaperGalleryItem.swift + WallpaperGalleryController.swift.
Drops cosmetic `_asStatus()` unwrap.

Wave 99 (2 facade extensions + 7 sites): adds
AccountManagerResources.data() and approximateSynchronousValue
to engine.resources.status(). Migrates OpenResolvedUrl (data +
storeResourceData with .complete -> .isComplete cascade),
SettingsThemeWallpaperNode (paired engine + accountManager
status), WallpaperUploadManager, OpenChatMessage,
LiveChatReactionStreamView.

Wave 100 (Shape-C/D, free function): legacyWebSearchItem
account: Account -> engine: TelegramEngine. 4 files.

Wave 101 (Shape-C/D, small class): VerticalListContextResults
ChatInputPanelItem stored field migration. 2 files. Drops
`|> map(EngineMediaResource.FetchStatus.init)` redundancy.

Wave 102 (Shape-C/D, medium class with weak-context retention):
SharedMediaPlayer account: Account -> engine: TelegramEngine.
Engine field is intentionally a strong handle since the class
stores context as `weak var`. 2 files.

After this squash the accountManager-side mediaBox refactor is
essentially complete; only Postbox-protocol-blocked
cachedResourceRepresentation triple remains as the foundational
deferred item.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 02:46:44 +04:00
isaacandClaude Opus 4.7 4879d89a92 Postbox -> TelegramEngine wave 22: storeResourceData facade + consumer sweep
Same shape as wave 21. Adds TelegramEngine.Resources.storeResourceData(id:, data:, synchronous:)
and sweeps 46 context.account.postbox.mediaBox.storeResourceData sites across 17 files.

The range-store overload and accountManager.mediaBox sites are explicitly out of scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 03:51:11 +04:00
isaacandClaude 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
IsaacandClaude Opus 4.7 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
Ilya Laktyushin 8f1e024aef Various fixes 2026-04-15 23:12:53 +02:00
Isaac 16c630b946 Refactoring 2026-04-03 15:50:39 +08:00
Isaac 9a4327116d Refactor 2026-03-10 00:38:36 +01:00
Ilya Laktyushin b87a202329 Various fixes 2026-02-28 00:35:08 +04:00
Ilya Laktyushin 0d12dd29ad Various improvements 2026-01-25 22:17:49 +04:00
Isaac 4a13c3830a Glass 2025-12-26 20:29:30 +08:00
Isaac 903ecdc8f6 Glass 2025-12-13 03:08:56 +08:00
Isaac dca1f06e91 Update 2025-12-06 01:42:16 +08:00
Isaac 1ee7268488 Glass 2025-12-06 01:28:06 +08:00
Isaac 0055396d4d Update 2025-11-26 23:05:30 +08:00
Ilya Laktyushin 35c9a5d279 Various improvements 2025-10-20 00:46:26 +04:00
Ilya Laktyushin 0915a42e64 Various improvements 2025-10-16 05:30:06 +04:00
Isaac a23deded22 Cleanup 2025-06-28 19:48:34 +02:00
Isaac 6c4070eb52 Serialization update 2025-02-14 19:11:58 +04:00
Ilya Laktyushin 5451053195 Various improvements 2024-12-22 17:16:14 +04:00
Isaac 6c06c0e805 Merge commit '6b528aa70f228b80dcb1f72961a878f23284d0fb' into star-ref-api 2024-11-28 16:13:21 +04:00
Ilya Laktyushin d2b5476293 [WIP] Story collage 2024-11-27 18:41:03 +04:00
Isaac 931e34e1bd Temp 2024-11-27 17:37:21 +04:00
Ilya Laktyushin 0f597d457e Web app improvements 2024-08-25 16:15:35 +04:00
Ilya Laktyushin f5092b8d8d Web app improvements 2024-07-02 21:03:22 +04:00
Ilya Laktyushin 613bba57c2 Web app improvements 2024-07-02 08:47:03 +04:00
Isaac 378b7e8ed5 Message preview improvements 2024-05-17 17:10:19 +04:00
Isaac 8736981248 Message effects improvements 2024-05-13 20:14:15 +04:00
Ilya Laktyushin e7df32ca3d Various fixes 2024-04-30 17:10:36 +04:00
Ilya Laktyushin cf49acb4aa Various fixes 2024-04-29 17:45:32 +04:00
Isaac 1f4297e0db Merge commit '914dbc46f6d538de2c8831ca860dfd45f2d78f84' 2024-04-23 12:57:52 +04:00
Isaac 8e043a3a7d Various improvements 2024-04-23 12:57:38 +04:00
Ilya Laktyushin 914dbc46f6 Recent actions improvements 2024-04-23 12:01:28 +04:00
Isaac eed644e895 Improve poll creation 2024-04-19 13:18:04 +04:00
Ilya Laktyushin cb7560a34e [WIP] Birthdays 2024-03-22 12:08:27 +04:00
Ilya Laktyushin 8bcc38c24e Video message recording improvements 2024-01-15 02:26:12 +04:00
Ilya Laktyushin bb9ce8dedb Update localization 2023-12-21 01:01:07 +04:00
Ilya Laktyushin 8659a5d6ea Various fixes 2023-12-20 21:26:03 +04:00
Ilya Laktyushin 90a1e9b688 Various fixes 2023-12-20 17:44:12 +04:00
Ilya Laktyushin e6ba681c03 Various fixes 2023-12-20 11:58:03 +04:00
Ilya Laktyushin 0d2bdf5132 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2023-12-19 22:55:22 +04:00
Ilya Laktyushin 3ca419048c Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2023-12-19 20:56:31 +04:00
Ilya Laktyushin 8f38831261 Various improvements 2023-12-19 14:15:09 +04:00