Skip to content

Show the forward picker's Send button right after Select - #450

Open
null00x wants to merge 1 commit into
TelegramMessenger:masterfrom
null00x:fix/picker-send-button-layout
Open

null00x wants to merge 1 commit into
TelegramMessenger:masterfrom
null00x:fix/picker-send-button-layout

Conversation

@null00x

@null00x null00x commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Key change

In the forward picker, right-click a chat > Select. The comment bar now shows the emoji button and the Send button inside the picker at once, and Send can be clicked. Before, Send was laid out just past the picker's right edge. Only the emoji button showed, in Send's usual place, so a click there opened the emoji panel, and Send itself couldn't be clicked until something else laid the picker out again, for example opening a forum's topics.

The same picker serves Reply in Another Chat and sharing an inline bot result, so Select there is fixed too.

Reason

ShareModalView.updateLayout (ShareModalController.swift) placed the bar's buttons container at size.width - actionsContainerView.frame.width, the width from the previous pass, and only then gave it the new width.

These pickers open in single-pick mode, where Send is hidden and the container is only as wide as the emoji button and its 20 pt gap. Select turns on multiple selection, notify shows Send, and the next layout pass placed the wider container from the narrow width. The container ran past the right edge by Send's width plus its gap, and Send, at emojiButton.frame.maxX + 20 inside it, started exactly at the picker's right edge. A click there lands outside the picker view, so it never reaches Send.

The fix computes the width first and uses it for both the origin and the size, so the buttons start where the comment field ends.

Screenshot/video result (before/after)

Before

The picker's comment bar right after Select on Saved Messages. Only the emoji button shows (x 630–660 pt), in Send's usual place. Send was laid out at x 680–705 pt, starting at the picker's right edge, and a click at its centre landed on the ModalBackground behind the picker.

The whole picker at the same moment, with Saved Messages ticked. Gray boxes cover chats outside the test.

After

Same steps. The emoji button (x 585–615 pt) and Send (x 635–660 pt) are both inside the picker, and a click at Send's centre reaches it.

The whole picker at the same moment.

Confirmation

Tested on macOS 26.6.2 (25G83) in a Debug build (13.2.0, 283467), signed in to a test environment account. Both builds were current master 38309ec9 with the same local lab and isolation edits, none of them in the code this PR changes. The After build had all 5 fixes of this run together; the other 4, each sent as its own PR, are: the checkmark success popup with the text popup's glass (ProgressModal.swift); no Open In Window on the My Notes row of Saved Messages (ChatListRowItem.swift); Reply to Option on the right-clicked option while a quiz explanation is shown (ChatPollItem.swift); only the topic's pins counted in a forum topic's pinned list (ChatController.swift). None of them changes the files this PR changes. The scripted test ran one pass per build.

Steps, as a scripted test:

  1. Post a message in e2e supergroup.
  2. Message menu > Forward. In the picker, right-click Saved Messages > Select.
  3. Read the Send button's frame against the picker's edges, and whether a click at its centre reaches it.
  4. Close the picker without sending. The test checks that no messages.forwardMessages request went out and deletes the message it posted.
Case Expected Before After
Send right after Select (picker at x 320–680 pt) Inside the picker x 680–705 pt, starts at the right edge, outside x 635–660 pt, inside
Click at Send's centre Reaches Send Lands on ModalBackground Reaches Send
Closing the picker Nothing forwarded 0 messages.forwardMessages requests 0 requests

A local test script runs the picker view's layout code, its init, the hasCaptionView and hasSendView setters, textWidth and the two lines of notify from source, on real AppKit views with stubs for the rest, and reads each share object's multipleSelection and blockCaptionView from source. It has 1608 checks; current master fails 456 of them. It covers:

  • Forward, Reply in Another Chat and inline-result share: one layout pass right after Select, Send hidden and shown again, the picker resized in the same pass, and several toggles before one pass;
  • link, message, story and contact shares, which open with Send shown;
  • the callback pickers that never show the comment bar;
  • three send and emoji icon sizes and two picker widths;
  • for each: the bar ends at the right edge and the bottom, both buttons are centred in it, a click at Send's centre reaches Send, and the comment field ends where the buttons start.

15 mutants of the fix (the old width for the origin or the size, the gaps, Send hidden or not, the bar's position and height, Send's position, the hasSendView setter, the notify line) all fail it.

Limitations:

Right after Select in the forward picker, the comment bar placed its
buttons from their old width, so Send was laid out just past the picker's
right edge and couldn't be clicked until the next layout.

Now the bar's width is computed first and used for both its position and
its size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant