Skip to content

Fix share sheet position for "Share challenge URL" on iPad - #3837

Merged
veloce merged 1 commit into
lichess-org:mainfrom
nurullahturkoglu:fix/ipad-share-challenge-3711
Oct 15, 2026
Merged

veloce merged 1 commit into
lichess-org:mainfrom
nurullahturkoglu:fix/ipad-share-challenge-3711

Conversation

@nurullahturkoglu

@nurullahturkoglu nurullahturkoglu commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3711

On iPad, tapping "Share challenge URL" opened the share sheet at the top of the screen instead of around the button. The issue was that launchShareDialog was using the loading screen's context, so sharePositionOrigin ended up covering almost the whole screen. Wrapping the button in a Builder fixed this by passing the button's own context, so the share sheet now opens in the right place.

I also added a widget test to check that share_plus receives the button's actual position. The test fails without the fix.

Tested on the iPad Pro 13-inch (M4) simulator with iOS 26.0, against lichess.dev.

Before:
https://github.com/user-attachments/assets/79f41c1a-5989-4372-b7ab-a93a634d7912

After:
https://github.com/user-attachments/assets/dce5ecd4-710d-49af-bcba-d71bda622280

Other screens also pass a screen-level context to launchShareDialog. I kept this PR to the challenge screen.

AI disclosure: I reproduced the bug and tested the fix myself on the simulator. I used Claude Code to read through the code, write the fix and the test, and draft this description, which I then edited.

@nurullahturkoglu
nurullahturkoglu marked this pull request as ready for review October 10, 2026 17:11

@veloce veloce left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@veloce
veloce merged commit 55db56a into lichess-org:main Oct 15, 2026
2 checks passed
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.

[iOS] "Share challenge URL" button opens Share Sheet at wrong size/position, which makes it unusable

2 participants