Commit graph

30414 commits

Author SHA1 Message Date
isaac
b1aab0839c LinkHighlightingNode: ceil instead of floor for stair-step radii
drawRectsImageContent's modern path computed nextRadius and
prevRadius as min(outerRadius, floor(|Δx| * 0.5)). When |Δx| < 2
the floor produces 0 and the addArc call becomes a no-op,
leaving an unsmoothed corner at the stair-step. Replace floor
with ceil so any non-zero edge mismatch rounds up to at least
1 px. Exact-equality cases (Δx == 0) are unaffected — they take
the else branch with a straight addLine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:46:38 +02:00
isaac
d1c5d66bd3 LinkHighlightingNode: fix X-edge snap unreachable after midY snap
In drawRectsImageContent's modern path the snap loop runs midY
trimming first, leaving rects[i].maxY == rects[i+1].minY for
adjacent line rects. The X-edge snap guard then evaluated
rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i+1]) — but
positive dy shrinks the rect, so after the trim the guarded
rectangle no longer intersects its neighbor (CGRect.intersects
requires positive-area overlap). Flip dy to -1.0 so the temp
rect grows and touching neighbors satisfy the guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:44:05 +02:00
isaac
6e318f314e Add implementation plan: modern path link-highlighting fixes (#3, #7)
Plan covers two single-line edits in LinkHighlightingNode.swift's
modern branch (X-snap dy direction; floor → ceil for stair-step
fillet radii), each landed as its own commit, with a final
full-project build for validation since this repo has no tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:37:29 +02:00
isaac
42498cd06c Add design spec: modern path link-highlighting fixes (#3, #7)
Document the analysis and intended fixes for two bugs in
LinkHighlightingNode's modern path branch: the X-edge snap is
unreachable after the midY snap (positive dy in insetBy shrinks
rect[i] so it can't intersect the touching neighbor), and the
floor() in nextRadius/prevRadius can produce zero-radius arcs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:32:04 +02:00
Mikhail Filimonov
5b56675b06 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
# Conflicts:
#	submodules/MetalEngine/Sources/MetalEngine.swift
2026-05-02 10:10:18 +01:00
Mikhail Filimonov
5b8e5e0f95 metal transaction 2026-05-02 10:07:13 +01:00
isaac
a1b37776a8 Merge commit '533a179131' 2026-05-02 10:58:57 +02:00
isaac
d5823cd5c7 Merge commit 'ffd82647ee' 2026-05-02 10:58:51 +02:00
isaac
da5a92c1be InstantPage tables: stroke all borders in one path
drawInTile previously stroked each cell's full perimeter, double-drawing
every interior gridline; visible now that the rich-data chat bubble uses
tableBorderColor at 0.25 alpha. Stroking each segment in its own
strokePath call would also have left ~1pt² overdraw at every interior
4-cell junction (where a horizontal divider crosses a vertical one) and
at every T-junction with the outer rounded rect — each strokePath
rasterizes independently and composites against the previous result.

Build a single CGMutablePath containing each cell's interior top/left
segment (skipping cells on the table's top/left boundary) plus the outer
rounded perimeter rect, and call strokePath once. CGContextStrokePath
fills the union of all stroke geometries as a single fill op, so each
pixel is painted exactly once regardless of how many segments overlap.

Empty cells (text == nil) are no longer skipped wholesale: their fill
and text remain gated on text != nil (preserves today's no-fill-for-
empty behavior), but their interior divider segments still get appended
so divider continuity is preserved around them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 10:58:18 +02:00
isaac
ae37006ee4 Cleanup 2026-05-02 00:52:37 +02:00
isaac
6561adff94 Update tgcalls 2026-05-02 00:40:06 +02:00
isaac
972cdf0658 Rich bubble: text selection in context-preview mode
Adds drag-handle text selection driven by TextSelectionNode. Exposes
attributedString and selection helpers on InstantPage text items, and
introduces a multi-text adapter aggregating items as a TextNodeProtocol.
Gates selection actions on reply-options and fixes highlight z-order.
2026-05-02 00:36:35 +02:00
isaac
fdb2f369ec Rich bubble: scrollToAnchor + getAnchorRect
Adds a base getAnchorRect on ChatMessageBubbleContentNode, the rich-bubble
override (including titleHeight in details recursion), bubble-item
forwarding to content nodes, ChatControllerInteraction.scrollToMessageIdWithAnchor,
and a scrollToAnchor that lands the anchor at the top of the content area /
its line. Threads anchor/scroll params through ChatController and related
call sites.
2026-05-02 00:36:34 +02:00
isaac
f29af03cd7 InstantPage: underline rendering
Render underline runs in layoutTextItemWithString and position them below
the baseline rather than above the text.
2026-05-02 00:36:34 +02:00
isaac
528807a24b Spec: InstantPage table borders, stop drawing shared edges twice
Documents a two-pass refactor for InstantPageTableItem.drawInTile that
draws each interior divider exactly once (top+left of each cell that
isn't on the table boundary) plus a single rounded-rect outer-perimeter
stroke. Needed now that tableBorderColor is being made semi-transparent
(0.25 alpha) by the rich-data chat bubble; current per-cell whole-bounds
strokes overdraw shared edges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 00:36:33 +02:00
isaac
d02019f985 Rich bubble: instant-page link handling
Adds ChatControllerInteraction dependency, link-progress state, URL tap
detection, press-highlight separation from in-flight URL shimmer, media-tap
routing through openMessage with explicit IV media subject, and gallery↔bubble
transition with hidden-media coordination. Stops re-appending to
currentLayoutItemsWithNodes across re-layouts. Drops a leftover MetalEngine
debug print as well.
2026-05-02 00:36:33 +02:00
isaac
999aac6eb3 ListView: cap pin-to-edge item visible portion at half area
When a pinToEdgeWithInset item is taller than half of the visible
area (visibleSize.height - insets.top - insets.bottom), cap its
visible portion at halfArea. The remaining height extends past
visibleSize - insets.bottom into the bottom-inset region (occluded
by overlay UI like the chat input panel).

A new private helper `pinToEdgeBottomExtension(forPinnedHeight:)`
returns max(0, pinnedHeight - halfArea). Three sites consume it:
- calculatePinToEdgeTopInset caps the pinned item's contribution
  to totalAboveAndPinned via `pinnedHeight - extension`.
- replayOperations isPinToEdgeTarget anchors the pinned item's
  apparent maxY at visibleSize - insets.bottom + extension.
- isStrictlyScrolledToPinToEdgeItem matches the new anchor.

Both isPinToEdgeTarget and isStrictlyScrolledToPinToEdgeItem fire
when either calculatePinToEdgeTopInset() > 0 OR extension > 0, so
the cap also applies when items above the pinned item overflow
the visible area (in which case calculatePinToEdgeTopInset returns
0 but extension is still positive).

When the pinned item fits within halfArea, extension == 0 and
behavior is identical to before this change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 00:36:33 +02:00
isaac
f25d0776c7 Visual improvements 2026-05-02 00:36:33 +02:00
isaac
ce5e3f4911 ReferenceImpl: reactive audio-SSRC discovery via per-receiver frame transformer
Includes spec and plan.
2026-05-02 00:36:33 +02:00
isaac
c256a9eb17 Add plan: ListView pin-to-edge half-area cap
Implementation plan for the spec from
docs/superpowers/specs/2026-05-01-listview-pin-to-edge-half-cap-design.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 00:36:32 +02:00
isaac
4c3437b575 Add spec: instant-page link handling in rich-data bubble
Wire URL tap detection, link-highlight feedback, and item-callback
routing in ChatMessageRichDataBubbleContentNode, with stubbed
intra-page anchor handling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 00:36:32 +02:00
isaac
4406fc6239 Spec: ListView pin-to-edge half-area cap
Cover clipping behavior and bottom-inset overflow.
2026-05-02 00:36:32 +02:00
Ilya Laktyushin
ffd82647ee Various fixes 2026-05-01 15:29:18 +02:00
Ilya Laktyushin
533a179131 Auth payment improvements 2026-05-01 15:28:26 +02:00
Ilya Laktyushin
2481687329 Add auth product 2026-05-01 15:08:48 +02:00
isaac
2edd2ffea7 Update instructions and fix build 2026-05-01 00:49:47 +02:00
Ilya Laktyushin
43b0124790 Fix poll countries limit 2026-05-01 00:09:52 +02:00
isaac
ebe43c72c6 Merge commit '8dc06f48ce'
# Conflicts:
#	submodules/TgVoipWebrtc/tgcalls
2026-04-30 22:24:28 +02:00
isaac
c63d2b115c Update submodules 2026-04-30 22:22:56 +02:00
Isaac
8dc06f48ce Merge commit '5b013073bf'
# Conflicts:
#	CLAUDE.md
#	MODULE.bazel.lock
#	submodules/TgVoipWebrtc/tgcalls
#	third-party/td/build-td-bazel.sh
#	third-party/webrtc/webrtc
2026-04-30 22:20:45 +02:00
Isaac
203727d4fb Extract tgcalls helpers into tgcalls 2026-04-30 22:13:55 +02:00
Isaac
5962a563e4 feat: tgcalls CLI test tool with group SFU, video, and adaptation
Squashed buildout of the tgcalls testbench:

- CLI test tool with --mode p2p/reflector/group/group-churn,
  cross-version interop (--version, --version2), and quiet/summary output
- Linux toolchain + Docker multi-stage build, AWS Fargate mass test harness,
  local parallel mass test harness with signaling loss simulation
- SCTP writable gate, retransmission timer tuning, role-based handshake
- InstanceV2CompatImpl (PeerConnection backend with V2Impl signaling) and
  SignalingTranslator for v14.0.0 interop
- In-process Go/Pion SFU (ICE+DTLS+SRTP+SCTP per participant) with audio
  RTP forwarding, ActiveAudio/VideoSsrcs data channel broadcast, RTCP
  feedback path, and CGo c-archive integration
- GroupInstanceReferenceImpl (PeerConnection group-call) and mixed-impl
  group mode (--reference-participants), with SDP munging for simulcast
- H264 simulcast group video (FakeVideoTrackSource pattern generator,
  FakeVideoSink frame counting, --video flag, two-pass channel setup,
  reactive video setup from ActiveVideoSsrcs)
- Group churn stress mode (--mode group-churn, --churn-cycles)
- SFU stream-quality adaptation: BandwidthEstimator, LayerSelector
  state machine, RtxRingBuffer, simulcast SSRC rewrite
- Transport-cc feedback generation, NetworkSimulator (delay/jitter/loss/
  token-bucket bandwidth), --network-scenario step-down-up
- CLAUDE.md updates throughout

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 18:28:43 +02:00
isaac
6758c94e33 Reapply "Update tgcalls"
This reverts commit 4e81b79254.
2026-04-30 17:31:21 +02:00
Ilya Laktyushin
9b8abdb5ee Fix 2026-04-30 16:51:22 +02:00
Ilya Laktyushin
5b013073bf Fix 2026-04-30 16:50:01 +02:00
Ilya Laktyushin
0664197b53 Poll improvements 2026-04-30 15:43:05 +02:00
Ilya Laktyushin
4ca7d4231b Poll improvements 2026-04-30 15:42:18 +02:00
Ilya Laktyushin
e8baaa5a22 Poll improvements 2026-04-30 15:36:13 +02:00
Ilya Laktyushin
9c3cab27e1 Fix time-limited poll closing 2026-04-30 13:14:56 +02:00
Ilya Laktyushin
fce36108da Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-04-30 13:14:18 +02:00
Ilya Laktyushin
5a2d6658e7 Fix time-limited poll closing 2026-04-30 13:12:46 +02:00
isaac
4e81b79254 Revert "Update tgcalls"
This reverts commit 5588a3996b.
2026-04-30 14:53:16 +04:00
isaac
5588a3996b Update tgcalls 2026-04-30 14:49:43 +04:00
isaac
207c971358 Merge commit '330fed199d' 2026-04-30 14:43:45 +04:00
isaac
266b1c5941 Fix ListViewProtocol 2026-04-30 14:43:41 +04:00
Ilya Laktyushin
29ecff3728 Various fixes 2026-04-30 12:43:12 +02:00
Ilya Laktyushin
330fed199d Improve quick share toast 2026-04-30 12:39:54 +02:00
Ilya Laktyushin
15f6811a5f Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-04-30 12:15:44 +02:00
Ilya Laktyushin
b222387923 Make origin check optional 2026-04-30 12:14:39 +02:00
isaac
7ef7f16727 Improve animations 2026-04-30 12:56:55 +04:00