fix(chat): float the edited message and keep the toolbar sharp - #717
Merged
Conversation
The floated copy went straight into the navigation controller's view above the blur, which put it above the composer bar and the whole chat screen. The blur is height-clipped to the top of the bar; the copy was clipped to nothing, so once the keyboard raised the transcript, a copy of a low row kept its position and drew on top of the composer. Put the copy in a clipping container sized to the blur's rect and re-measured with it, so it stops where the blur does at both edges.
Two things were missing from the edit chrome. The floated copy of the edited message never appeared, and the navigation bar went blank instead of staying legible through the blur. The copy went missing because the snapshot was taken in the menu's dismissal completion, while UIKit still has the row's own bubble hidden behind its lifted preview. `snapshotView` on a hidden view returns a blank view rather than nil, so an empty copy was floated and, since one existed, never replaced. `bubbleSnapshot` now reports "not yet" for a hidden or empty bubble, and the screen retries over the next few runloop turns rather than waiting on a layout pass or a scroll that may not come. The bar went blank because the title and avatar faded to zero for the duration of the edit. The held blur already slides under the navigation bar, so the bar is sharp on its own — only the back button needs to change, to back out of the edit rather than out of the chat.
UIKit dims the screen behind a context menu and takes that dimming away with the menu, so a blur held into an edit keeps the material but loses the dim. On the same patch of empty transcript that reads rgb 22 under the menu, the edit read 44 — visibly lighter, the state it was meant to continue. Fade a black overlay in inside the held blur as the menu dismisses, so the two cross rather than the screen brightening between them. The same patch now reads 23.
An edit is about one message, not the counterpart, and the avatar next to the edit-exit chevron reads as a second thing to tap. Leave the name alone in the bar for the duration of the edit; it comes back with the avatar on exit.
An edit is about one message, not the counterpart, so the name and avatar have nothing to say while it is open — and next to an exit chevron they read as a second thing to tap. Drop the whole title item for the duration; it comes back on exit. Supersedes the avatar-only removal, which left the name hanging beside the chevron.
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 #715, which merged before these two commits landed.
Three things were wrong with the edit chrome as it shipped.
The floated copy drew over the composer and the navigation bar. It went straight into the navigation controller's view, above the whole chat screen, so a copy of a row that had scrolled past either edge covered the chrome an edit needs sharp. It now sits in a clip view framed to the blur.
The copy never appeared at all. The snapshot was taken in the context menu's dismissal completion, while UIKit still has the row's own bubble hidden behind its lifted preview.
snapshotViewon a hidden view returns a blank view rather than nil, so an empty copy was floated and, because one then existed, nothing replaced it.bubbleSnapshotnow reports "not yet" for a hidden or empty bubble, and the screen retries over the next few runloop turns instead of waiting on a layout pass or a scroll that may not come.The navigation bar went blank. The title and avatar faded to zero for the duration of the edit, a leftover from the iteration where the blur covered the bar. The held blur slides under the bar, so the bar is sharp on its own; only the back button still changes, to back out of the edit rather than out of the chat.