Fix (mention): The mention suggestions panel no longer overflows the viewport on narrow screens
Closes #20182.
On narrow screens the mention suggestions panel could stick out of the viewport. All four balloon positions anchor the panel to the caret, so when a wide panel did not fit on either side of the caret, whichever position got picked still overflowed the screen and the suggestions were cut off.
The position callbacks now clamp the panel's left coordinate to the viewport rect, which getOptimalPosition() already passes to positioning functions. If the panel would stick out, it is shifted just enough to stay fully visible. Vertical behavior is unchanged.
Tested on the mention-custom-renderer manual test at a 390px viewport. Before, the panel rect ended at 414px with its right side cut off. After, it ends right at the 390px edge:

The existing position tests were updated because the callbacks now take the viewport rect as a third argument, and a new test covers the clamping on both screen edges. The ckeditor5-mention suite passes with 100% coverage. A changelog entry is included.
Already signed the CLA...
Thanks for the PRs! We're on them. They look really solid and we'll let you know once our QA team finishes assessing them.
Just flagging that this fix already landed on master as 674d3cb74f, so this PR can be closed. Thanks!
Closing the PR then. Thanks for the contribution!