Skip to content

Conversation

@nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Oct 21, 2024

🔗 Issue Link

Resolves https://stream-io.atlassian.net/browse/PBE-6263

🎯 Goal

Fix crash when opening message overlay in iPad with a TabBar

🛠 Implementation

Current Solution:

  • Uses UIGraphicsImageRenderer, which does not crash when providing a CGSize.zero
  • Changes topVC() so that it accounts for a tab bar controller

Shortcomings:

  • The only problem at the moment is that the navigation bar is not part of the screenshot. I'm not 100% sure why the navigation bar is not being captured by the snapshot yet, but for now, this works as a workaround.

Ideal solution:

  • We need to refactor the whole Overlay view to use a background blur overlay instead of a snapshot. The snapshot is too dependent on the app hierarchy, which ofc is error-prone and not scalable.

I created a ticket so that we can tackle this in the future: https://stream-io.atlassian.net/browse/PBE-6270

🧪 Testing

  1. Open the app with iPad
  2. Open a channel
  3. Long press a message
  4. It should not crash and it should show the message actions overlay view.

🎨 Changes

image

☑️ Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Affected documentation updated (docusaurus, tutorial, CMS (task created)

@nuno-vieira nuno-vieira requested a review from a team as a code owner October 21, 2024 17:11
@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Oct 21, 2024

SDK Size

title develop branch diff status
StreamChatSwiftUI 7.97 MB 7.97 MB 0 KB 🟢

@sonarqubecloud
Copy link

@nuno-vieira nuno-vieira merged commit 561be6f into develop Oct 22, 2024
11 checks passed
@nuno-vieira nuno-vieira deleted the fix/message-actions-view-crashes-when-iPad-with-tab-bar branch October 22, 2024 09:30
@Stream-SDK-Bot Stream-SDK-Bot mentioned this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants