fix: show in chat on small tablets#64
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts PhotoViewer’s Sequence diagram for updated Show in Chat navigation on tabletssequenceDiagram
actor User
participant PhotoViewer
participant LaunchActivity
participant NotificationCenter
participant ChatActivity
User->>PhotoViewer: tapShowInChat()
PhotoViewer->>PhotoViewer: buildChatArgs()
PhotoViewer->>PhotoViewer: launchActivity = resolveLaunchActivity()
alt Not_LaunchActivity
PhotoViewer-->>User: no_navigation
else LaunchActivity_and_not_full_size_tablet
PhotoViewer->>NotificationCenter: postNotification(closeChats)
PhotoViewer->>LaunchActivity: presentFragment(ChatActivity(args), remove, true)
LaunchActivity->>ChatActivity: create_and_display()
else LaunchActivity_and_full_size_tablet
PhotoViewer->>LaunchActivity: isTabletFullSizeLayout()
LaunchActivity-->>PhotoViewer: true
PhotoViewer--xNotificationCenter: skip_closeChats()
PhotoViewer->>LaunchActivity: presentFragment(ChatActivity(args), remove, true)
LaunchActivity->>ChatActivity: create_and_display()
end
Class diagram for updated PhotoViewer and LaunchActivity behaviorclassDiagram
class PhotoViewer {
int currentAccount
Object parentActivity
MessageObject currentMessageObject
onItemClick(int id)
}
class LaunchActivity {
boolean tabletFullSize
int getMainFragmentsCount()
boolean isTabletFullSizeLayout()
boolean presentFragment(ChatActivity fragment, boolean removeLast, boolean force)
}
class ChatActivity {
ChatActivity(Bundle args)
}
class NotificationCenter {
int closeChats
static NotificationCenter getInstance(int account)
void postNotificationName(int id)
}
class AndroidUtilities {
static boolean isTablet()
}
class MessageObject {
int getId()
}
class Bundle {
void putInt(String key, int value)
}
PhotoViewer --> LaunchActivity : uses_parentActivity
PhotoViewer --> NotificationCenter : postNotification(closeChats)
PhotoViewer --> ChatActivity : create_for_navigation
PhotoViewer --> Bundle : build_args
PhotoViewer --> MessageObject : read_id
LaunchActivity --> ChatActivity : presentFragment
LaunchActivity --> AndroidUtilities : isTabletFullSizeLayout()
LaunchActivity : isTabletFullSizeLayout() returns AndroidUtilities.isTablet() && tabletFullSize
NotificationCenter --> NotificationCenter : getInstance(account)
AndroidUtilities <.. PhotoViewer : static_call_isTablet()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
omg-xtao
approved these changes
May 10, 2026
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.
Fix
Show in Chatnavigation fromPhotoVieweron small tablets.On small tablets using the full-size tablet layout in portrait,
Show in Chatcould close the viewer and return to the chat list instead of opening the target message.This was caused by posting
closeChatsbefore presenting the targetChatActivity, which could close the active chat and drop the navigation during transition.This PR avoids posting
closeChatswhenLaunchActivityis already using the full-size tablet layout. Split-view tablet and phone layouts keep the existing behavior.Summary by Sourcery
Adjust chat navigation from PhotoViewer to respect tablet full-size layout and avoid unintended chat closure on small tablets.
Bug Fixes:
Show in Chatfrom closing the current chat and returning to the chat list on small tablets in full-size tablet portrait layout.Enhancements:
isTabletFullSizeLayouthelper on LaunchActivity to centralize full-size tablet layout checks.