Repository navigation
fix(chat): a message's editor opens on its message under the window's zoom - #1308
Merged
Merged
Conversation
… zoom The editor is painted over the list, at its placeholder's top: taken as the difference of the two places on screen, which the window's zoom (Interface Size) scales while the editor's layer paints in units of its own. At 125% it was drawn a quarter of its distance from the history's top too low; near the bottom, its lower lines under the composer, as in #1257 (at 80%, too high). It is now placed in the layer's own units, and so is the message it closes back into, and the bubble's frame it opens from. And a click with the mouse opened it following the end again: the press stopped the list following while held, to follow again as it is let go, after the message had opened its editor (#1287's not following undone). Opening it now takes that over. Tests: under zoom (80%, 125%), and opened with a mouse while following; both failed before. The first test in the file still has its pending timer on main (unrelated). Co-Authored-By: BaoCode <noreply@baocode.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1257 / #1287: a new recording (Windows) still shows the editor's lower lines under the composer.
Cause. The editor is painted over the list at its placeholder's top, computed as
placeholder.localToGlobal(0) - layer.localToGlobal(0).UiZoom(Interface Size) scaleslocalToGlobal, while_StickyFollowerpaints in its own, unscaled units, so the editor landed atzoom ×its real distance from the history's top: at 125% a quarter too low (the closer to the bottom, the further off, under the composer); at 80%, too high. The list itself scrolled right, which is why #1287's reveal looked correct in tests (all at 100%). In the recording the closing editor is also drawn below the message it returns to: same cause._editorTop(open and closing) places it in the layer's own units (getTransformTo(layer))._scrolledPastmeasures within the viewport (localToGlobal(ancestor: viewport)).UserMessageBubble.frameIngives a true on-screen rect;UserMessageEditMorphmaps it back with the inverse transform, so the opening frame starts on the bubble under zoom too.Also. Clicked with a mouse, the editor followed the end again: the history's press handler stops following while the button is held and restores it on release, which runs after the bubble's own pointer-up has opened the editor, undoing #1287's
anchored = false(and recording_followedBeforeEditas false)._startEditingnow takes over the press's restore. Tests used touch taps, which skip that path.Tests (
test/chat/message_edit_visibility_test.dart): under zoom 80%/125% the editor opens where its message is; opened with a mouse while following, the list does not follow and follows again once closed. Both failed before the fix (6/6 each). The first test in the file keeps its pending-timer failure onmain(unrelated).sticky_message_test,height_motion_test,history_selection_test,chat_history_rebuild_test,user_message_selection_test,user_message_style_test,retry_turn_testpass.Refs #1257
🤖 Generated with BaoCode