Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(2.4) feat(feedback-ui): Add screenshots #4338

Merged
merged 122 commits into from
Jan 16, 2025

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Dec 3, 2024

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

Based on #4328

📜 Description

This PR adds attachment handling in the SDK capture feedback form leaving the image picking to be implemented on the client:

Note that string attachments are converted to UInt8Array before sending to the server.

Android iOS

💡 Motivation and Context

Fixes #4337

💚 How did you test it?

CI, Manual testing (example)

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog

As discussed we will use the no props configuration in the changelog.

Base automatically changed from antonis/3859-newCaptureFeedbackAPI-Form to feedback-ui January 10, 2025 10:32
…ents

# Conflicts:
#	CHANGELOG.md
#	packages/core/src/js/feedback/FeedbackForm.styles.ts
#	packages/core/src/js/feedback/FeedbackForm.tsx
#	packages/core/src/js/feedback/FeedbackForm.types.ts
#	packages/core/src/js/feedback/defaults.ts
#	packages/core/src/js/index.ts
#	packages/core/test/feedback/FeedbackForm.test.tsx
#	samples/react-native/src/App.tsx
#	samples/react-native/src/Screens/ErrorsScreen.tsx
@krystofwoldrich
Copy link
Member

The impl looks good, but I would scale the scope down to only allow bytes array for now and remove the conversion. We can extend it later.

@krystofwoldrich
Copy link
Member

@antonis Have you explored the option of taking screenshot of the app and attaching it?

@antonis
Copy link
Collaborator Author

antonis commented Jan 10, 2025

@antonis Have you explored the option of taking screenshot of the app and attaching it?

I haven't explored this option on the SDK side. My assumption was that the developer may choose to implement this. E.g to capture a screenshot with react-native-view-shot instead of selecting an image with react-native-image-picker as the sample implementation.
Looking at it now I see that we already have captureScreenshot (that convenietly returns Uint8Array) functionality exposed by the native SDKs. I'm not sure if this would be useful though since it will be a screenshot of the feedback form unless we use a screenshot taken before 🤔 Maybe I can explore this on this or a separate PR.

@krystofwoldrich
Copy link
Member

I haven't explored this option on the SDK side. My assumption was that the developer may choose to implement this. E.g to capture a screenshot with react-native-view-shot instead of selecting an image with react-native-image-picker as the sample implementation.

Got it. This is nice and flexible, but provides less out of the box value.

Looking at it now I see that we already have captureScreenshot (that convenietly returns Uint8Array) functionality exposed by the native SDKs. I'm not sure if this would be useful though since it will be a screenshot of the feedback form unless we use a screenshot taken before 🤔 Maybe I can explore this on this or a separate PR.

Yes, exactly we already have that function, but as you said taking the screenshot of the form is not useful. But especially when combined with the auto inject, since we will be responsible for showing and hiding the form we can, hide the form take the screenshot and then show it again.

Note: We might anyway also need to create a base64 representation of the screenshot to be able to show a preview using RN Image tag. Or create a tmp file.

@antonis
Copy link
Collaborator Author

antonis commented Jan 13, 2025

Thank you for the feedback @krystofwoldrich 🙇

But especially when combined with the auto inject, since we will be responsible for showing and hiding the form we can, hide the form take the screenshot and then show it again.

This makes sense 👍 I will iterate along the auto-inject functionality.

Note: We might anyway also need to create a base64 representation of the screenshot to be able to show a preview using RN Image tag. Or create a tmp file.

👍

…ents

# Conflicts:
#	packages/core/src/js/feedback/FeedbackForm.tsx
#	packages/core/src/js/feedback/FeedbackForm.types.ts
#	packages/core/src/js/feedback/defaults.ts
#	packages/core/test/feedback/FeedbackForm.test.tsx
Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good! 🚀

Just left two small nits in the comments.

@krystofwoldrich krystofwoldrich changed the title (2.4) Feedback form attachments (2.4) feat(feedback-ui): Add screenshots Jan 16, 2025
@antonis
Copy link
Collaborator Author

antonis commented Jan 16, 2025

Just left two small nits in the comments.

Thank you once more for the feedback @krystofwoldrich 🙇
I fixed the nits and I'll merge on the feature branch as soon as the CI is 🟢

@antonis antonis merged commit aa15c88 into feedback-ui Jan 16, 2025
66 checks passed
@antonis antonis deleted the antonis/3959-captureFeedback-attachements branch January 16, 2025 12:02
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.

Add attachment/screenshot handling in the feedback form UI
3 participants