-
Notifications
You must be signed in to change notification settings - Fork 92
Feat/shake to share master #19809
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
base: master
Are you sure you want to change the base?
Feat/shake to share master #19809
Conversation
Jenkins BuildsClick to see older builds (37)
|
cac378b to
82e3bcc
Compare
Implement shake to share for android and IOS + migrate to an event driven mechanism for IOS as well
82e3bcc to
8d7f436
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a shake-to-share feature for mobile platforms, allowing users to export app logs or report bugs by shaking their device. The feature is inspired by the legacy app's functionality.
Changes:
- Added shake detection support for iOS (using CoreMotion accelerometer) and Android (using SensorManager)
- Implemented a dialog UI that presents two options when shake is detected: export log files or report a bug on GitHub
- Added cross-platform file sharing utilities to share log files through the native share sheets
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/main.qml | Added shake detection handler and dialog UI for log export/bug reporting |
| ui/imports/utils/Constants.qml | Added GitHub bug report URL constant |
| ui/i18n/*.ts | Added translation entries for the new dialog strings |
| ui/StatusQ/src/systemutilsinternal.cpp | Implemented shake detection callbacks and file sharing methods for iOS and Android |
| ui/StatusQ/src/ios_utils.mm | Added iOS accelerometer-based shake detection and native share sheet implementation |
| ui/StatusQ/src/ios_utils.h | Added shake detection and share sheet function declarations |
| ui/StatusQ/include/StatusQ/systemutilsinternal.h | Added shakeDetected signal and share methods to API |
| ui/StatusQ/CMakeLists.txt | Linked CoreMotion framework for iOS |
| src/app/global/utils.nim | Added collectLogFilesJson method to gather log files for sharing |
| mobile/wrapperApp/Status.pro | Added CoreMotion framework to iOS build |
| mobile/android/qt6/src/app/status/mobile/StatusQtActivity.java | Integrated shake detection lifecycle management |
| mobile/android/qt6/src/app/status/mobile/ShareUtils.java | Implemented Android file sharing via FileProvider |
| mobile/android/qt6/src/app/status/mobile/ShakeDetector.java | Implemented Android accelerometer-based shake detection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <source>Hello World</source> | ||
| <comment>main</comment> | ||
| <translation>Hello World</translation> | ||
| </message> | ||
| <message> |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation files include an entry for "Hello World" which doesn't appear to be used anywhere in the code. This appears to be leftover from development or testing and should be removed to keep the translation files clean.
| <source>Hello World</source> | |
| <comment>main</comment> | |
| <translation>Hello World</translation> | |
| </message> | |
| <message> |
| <source>Hello World</source> | ||
| <translation type="unfinished"></translation> | ||
| </message> | ||
| <message> |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation files include an entry for "Hello World" which doesn't appear to be used anywhere in the code. This appears to be leftover from development or testing and should be removed to keep the translation files clean.
| <source>Hello World</source> | |
| <translation type="unfinished"></translation> | |
| </message> | |
| <message> |
| <source>Hello World</source> | ||
| <translation type="unfinished"></translation> | ||
| </message> | ||
| <message> |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation files include an entry for "Hello World" which doesn't appear to be used anywhere in the code. This appears to be leftover from development or testing and should be removed to keep the translation files clean.
| <source>Hello World</source> | |
| <translation type="unfinished"></translation> | |
| </message> | |
| <message> |
| <source>Hello World</source> | ||
| <translation type="unfinished"></translation> | ||
| </message> | ||
| <message> |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation files include an entry for "Hello World" which doesn't appear to be used anywhere in the code. This appears to be leftover from development or testing and should be removed to keep the translation files clean.
| <source>Hello World</source> | |
| <translation type="unfinished"></translation> | |
| </message> | |
| <message> |
| function onShakeDetected() { | ||
| const nowMs = Date.now() | ||
| if (nowMs - d.lastShakeShareMs < 3000) { | ||
| return | ||
| } | ||
| d.lastShakeShareMs = nowMs | ||
| shakeToShareLoader.active = true | ||
| } |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onShakeDetected handler is placed inside a Connections block with enabled: SQUtils.Utils.mac which restricts it to only work on macOS. However, based on the PR description and the shake detection implementations in systemutilsinternal.cpp (Android on lines 99-128, iOS on lines 131-159), this feature is intended for mobile platforms (iOS and Android), not macOS. This means the shake detection will not work on the intended platforms. Consider either:
- Removing the
enabledcondition from this Connections block (since onQuit is already checking for mac in its logic), or - Moving onShakeDetected to a separate Connections block with
enabled: SQUtils.Utils.isMobile
| // Set up iOS shake detection (event-driven callback) | ||
| ::setIOSShakeCallback(&iosShakeDetected); | ||
| // Set up iOS shake detection |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are duplicate comments about setting up iOS shake detection on consecutive lines. Line 135 says "Set up iOS shake detection (event-driven callback)" and line 137 says "Set up iOS shake detection" which are redundant. Consider consolidating these into a single clear comment.
| // Set up iOS shake detection (event-driven callback) | |
| ::setIOSShakeCallback(&iosShakeDetected); | |
| // Set up iOS shake detection | |
| // Set up iOS shake detection: register callback and enable detection | |
| ::setIOSShakeCallback(&iosShakeDetected); |
| StatusButton { | ||
| Layout.fillWidth: true | ||
| text: qsTr("Export log files") | ||
| onClicked: { | ||
| try { | ||
| const json = globalUtils.collectLogFilesJson() | ||
| const paths = JSON.parse(json) | ||
| if (!paths || paths.length === 0) { | ||
| return | ||
| } | ||
|
|
||
| SystemUtils.sharePaths(paths) | ||
| } catch (e) { | ||
| console.error("[Shake] handler threw: " + e) | ||
| } | ||
| } | ||
| } | ||
| StatusButton { | ||
| Layout.fillWidth: true | ||
| text: qsTr("Report a bug on GitHub") | ||
| onClicked: { | ||
| Qt.openUrlExternally(Constants.bugReportUrl) | ||
| } | ||
| } |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dialog buttons do not explicitly close the dialog after their actions complete. When "Export log files" is clicked, the system share sheet is invoked but the shake dialog remains open in the background. Similarly, when "Report a bug on GitHub" is clicked, the browser opens but the dialog stays open. Consider calling the dialog's close method or setting shakeToShareLoader.active to false at the end of each button's onClicked handler to dismiss the dialog after the user takes action.
| if (!paths || paths.length === 0) { | ||
| return | ||
| } |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When no log files are found (paths.length === 0), the function silently returns without providing any feedback to the user. This could leave users confused when they shake their device expecting to share logs but nothing happens. Consider showing a toast notification or message to inform users that no log files were found.
| <source>Hello World</source> | ||
| <translation type="unfinished"></translation> | ||
| </message> | ||
| <message> |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation files include an entry for "Hello World" which doesn't appear to be used anywhere in the code. This appears to be leftover from development or testing and should be removed to keep the translation files clean.
| <source>Hello World</source> | |
| <translation type="unfinished"></translation> | |
| </message> | |
| <message> |
| */ | ||
| Connections { | ||
| target: SystemUtils | ||
| enabled: SQUtils.Utils.mac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted elsewhere, this is wrong :D
| target: SystemUtils | ||
| enabled: SQUtils.Utils.mac | ||
|
|
||
| function onQuit(spontaneous) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to split into 2 Connections, and enable this onQuit handler everywhere
What does the PR do
Implementing a convenience feature to share app logs or report bugs.
It's inspired from the legacy app where shaking the phone will allow the user to report a bug or export the app logs.
Affected areas
StatusQ mainly
Architecture compliance
My PR is consistent with this document: QML Architecture Guidelines
Screencapture of the functionality
ScreenRecording_01-28-2026.17-19-41_1.MP4
Screen_Recording_20260128_172417_GitHub.mp4
Impact on end user
The user will be able to export logs or to quickly report bugs.
How to test
Shake the phone in any screen
Risk
Low