Fix direct chat back button: pop instead of dismiss, enlarge hit area - #9
Open
topAmity wants to merge 1 commit into
Open
Fix direct chat back button: pop instead of dismiss, enlarge hit area#9topAmity wants to merge 1 commit into
topAmity wants to merge 1 commit into
Conversation
AmityChatPage's back button had two issues in direct (conversation) chat: 1. Closes the whole UIKit instead of returning to the chat list. The chat room is pushed onto the nav stack by AmityChatHomePage, so "back" must pop. It called dismissOrPop(), which checks presentingViewController first and dismisses the entire modal when the nav stack itself was presented modally (the common host integration). AmityGroupChatPage already pops directly; direct chat now matches by preferring popViewController whenever it is not the nav-stack root, falling back to dismissOrPop() otherwise. 2. Back tap can fall through to the adjacent avatar (which, when a chatPageBehavior is registered, opens the profile image viewer). The back button was a bare 16x16 target with .buttonStyle(.plain) sitting 12pt from a 40x40 avatar. Expanded the tappable region to the 44x44 minimum with .contentShape(Rectangle()), which also hardens hit-test routing when the page is embedded in a custom container/nav wrapper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
AmityChatPage's back button had two issues in direct (conversation) chat:
Closes the whole UIKit instead of returning to the chat list. The chat room is pushed onto the nav stack by AmityChatHomePage, so "back" must pop. It called dismissOrPop(), which checks presentingViewController first and dismisses the entire modal when the nav stack itself was presented modally (the common host integration). AmityGroupChatPage already pops directly; direct chat now matches by preferring popViewController whenever it is not the nav-stack root, falling back to dismissOrPop() otherwise.
Back tap can fall through to the adjacent avatar (which, when a chatPageBehavior is registered, opens the profile image viewer). The back button was a bare 16x16 target with .buttonStyle(.plain) sitting 12pt from a 40x40 avatar. Expanded the tappable region to the 44x44 minimum with .contentShape(Rectangle()), which also hardens hit-test routing when the page is embedded in a custom container/nav wrapper.