Skip to content

feat(cloud): account toolbar control and device sign-in (3.4.0) - #709

Merged
fernandotonon merged 9 commits into
masterfrom
codex/cloud-account-toolbar
Jun 3, 2026
Merged

feat(cloud): account toolbar control and device sign-in (3.4.0)#709
fernandotonon merged 9 commits into
masterfrom
codex/cloud-account-toolbar

Conversation

@fernandotonon

@fernandotonon fernandotonon commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Moves QtMesh Cloud account controls from the menu bar to a VS Code-style CloudAccountMenuButton at the bottom of the left objects toolbar (avatar, status badge, structured popup menu).
  • Adds device-authorization sign-in that polls while the dialog stays open, so copy/paste approval on the website works without requiring Open Browser.
  • Bumps version to 3.4.0 and expands unit tests for the new cloud UI and credential-store paths.

UI / UX

  • Logged out: outline user/cloud icon + offline badge; menu shows Sign in, Upload Files (always available).
  • Logged in: initials avatar + connected badge; header shows display name and “Signed in to QtMesh Cloud”; Open My Projects, Upload Files, Sign out.
  • Reusable CloudAccountMenuButton widget for future placement (e.g. top toolbar).

Technical

  • CloudCredentialStore uses isolated fallback-file storage when QCoreApplication::organizationName() is QtMeshEditorTests so unit tests do not touch the OS keychain.
  • Sentry ui.action breadcrumbs on cloud toolbar actions; browser open failures surface a warning.
  • Sonar/review fixes: credential-store branch consolidation, C++17 init-statements, test isolation.

Test plan

  • ./build_local/bin/UnitTests --gtest_filter="MainWindowTest.CloudAccount*"
  • ./build_local/bin/UnitTests --gtest_filter="CloudAccountMenuButtonTest.*"
  • ./build_local/bin/UnitTests --gtest_filter="CloudCredentialStoreTest.*"
  • Manual: sign in via copy code + approve on site (no Open Browser click)
  • Manual: sign in via Open Browser
  • CI: unit-tests-linux + SonarCloud quality gate

Made with Cursor

Summary by CodeRabbit

Release Notes - Version 3.4.0

  • New Features

    • Enhanced cloud account menu with improved sign-in/sign-out handling and better error messaging for cloud operations.
  • Improvements

    • Better dialog handling and user feedback during cloud authentication flows.
    • Updated documentation and examples to reflect latest version compatibility.
  • Tests

    • Added comprehensive test coverage for cloud account menu functionality and credential management.

fernandotonon and others added 8 commits June 1, 2026 19:04
Replace the Cloud menu bar entry with a VS Code-style account button
pinned to the bottom of the left objects toolbar, including a disabled
signed-in user row in the popup menu and MainWindow unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Clear CloudCredentialStore in MainWindowTest teardown, add ui.action
Sentry breadcrumbs for cloud toolbar menu actions, and warn when the
browser fails to open QtMesh Cloud.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the generic network icon with a dedicated CloudAccountMenuButton
component: outline user icon when signed out, initials avatar when signed in,
and a status badge for connected/offline. Restructure the popup with a
non-clickable name header, main cloud actions, and account sign-in/out.

Fix signed-out paint crash (nested QPainter) and remove the header from the
menu when logged out so stale name text no longer bleeds through.

Co-authored-by: Cursor <cursoragent@cursor.com>
Route credential storage to an isolated fallback file when tests set
organization to QtMeshEditorTests so unit tests do not touch the OS
keychain. Use gtest fixtures with isolated QSettings in cloud tests,
show "Signed in to QtMesh Cloud" in the menu header subtitle, and
centralize MainWindow cloud-session cleanup in TearDown.

Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidate duplicate fallback branches in CloudCredentialStore, apply
C++17 init-statements, const-correctness, and auto per SonarCloud rules
for the account menu changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Poll for browser approval while the sign-in dialog stays open so copy/paste
approval works without clicking Open Browser. Show status text without
repeating the user code.

Tests: assert legacy cloudTokenExpiresAt is cleared on migration, and that
the signed-out menu no longer lists the account header widget action.

Co-authored-by: Cursor <cursoragent@cursor.com>
Raise project version to 3.4.0 and sync pinned doc references.

Add unit tests for CloudAccountMenuButton (auth refresh, menu actions,
display-name fallbacks, signals) and CloudCredentialStore (empty token,
corrupt session file, migration no-op) to improve coverage on new cloud UI code.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Version 3.4.0 release with Sentry observability instrumentation for cloud account menu interactions. CloudAccountMenuButton gains breadcrumb logging for menu display and action triggers. Comprehensive test suite validates initials, menu state, signal emission, and refresh behavior. CloudCredentialStore tests expanded for session persistence. MainWindow refactored to wire button signals and async sign-in polling. CMake test configuration updated.

Changes

Version 3.4.0 Release with Cloud Account Observability

Layer / File(s) Summary
Version bump 3.3.1 → 3.4.0
CMakeLists.txt, README.md, website/src/hooks/useQtmeshActionRef.js
Project version updated to 3.4.0 in CMakeLists.txt, README CI templates/examples, and website GitHub Actions fallback reference.
SentryReporter breadcrumb instrumentation for CloudAccountMenuButton
src/CloudAccountMenuButton.cpp
CloudAccountMenuButton logs Sentry breadcrumbs when the menu opens and when each cloud action is triggered (Open Projects, Upload Files, Sign In, Sign Out).
CloudAccountMenuButton comprehensive test suite
src/CloudAccountMenuButton_test.cpp
Test fixture with helpers for menu action lookup and header detection. Thirteen tests validate initials extraction, menu state refresh for signed-out/signed-in sessions, display name fallback chain, header visibility, signal emission for all menu actions, dynamic refresh on menu display, rendering stability across sign transitions, and UI element naming.
CloudCredentialStore test coverage enhancements
src/CloudCredentialStore_test.cpp
Adds sessionFilePath() helper and four new test cases validating empty token rejection, hasSession() clearing, corrupt file handling, and migration safety. Adds RoundTripWithoutEmail test and removes obsolete MigratesLegacyPlaintextSettings test.
MainWindow cloud account UI integration and sign-in flow
src/mainwindow.cpp
setupCloudAccountStatusControl() wires CloudAccountMenuButton signals to MainWindow slots and positions button in toolbar. Sign-in flow refactored to use async QTimer polling instead of blocking dialog; button handlers add Sentry breadcrumbs; failSignIn returns early if dialog dismissed; polling starts asynchronously. Open Projects handler simplified to open cloud URL with warning on failure.
CMake test configuration for CloudAccountMenuButton_test
tests/CMakeLists.txt
Adds conditional compilation of CloudAccountMenuButton_test executable and GoogleTest discovery with PRE_TEST mode for test integration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • fernandotonon/QtMeshEditor#700: The main PR extends the same cloud toolbar account control codepaths by refining CloudAccountMenuButton behavior, test coverage, and MainWindow integration built on the foundation established in PR #700.
  • fernandotonon/QtMeshEditor#696: Related through CloudCredentialStore session persistence improvements and cloud sign-in/out flow adjustments that build on the device-auth implementation surface.

Poem

🐰 A version bump and breadcrumbs bright,
CloudAccount logs each menu flight—
Tests validate each sign-in dance,
Async polls get their second chance.
With credentials cached and UI shown,
The cloud now feels more like home! ☁️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: moving cloud account controls to a toolbar button, adding device sign-in, and bumping to version 3.4.0.
Description check ✅ Passed The description provides comprehensive coverage with Summary, UI/UX details, Technical implementation, and Test plan sections, mostly aligning with the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cloud-account-toolbar

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/CloudAccountMenuButton_test.cpp

In file included from src/CloudAccountMenuButton_test.cpp:1:
src/CloudAccountMenuButton.h:4:10: fatal error: 'QWidget' file not found
4 | #include
| ^~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-f3a1516cff3d39a0/tmp/clang_command_.tmp.e5572d.txt
++Contents of '/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-f3a1516cff3d39a0/tmp/clang_command_.tmp.e5572d.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-

... [truncated 1138 characters] ...

lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/f3a1516cff3d39a0/file.o" "-x" "c++"
"src/CloudAccountMenuButton_test.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/CloudAccountMenuButton.cpp

In file included from src/CloudAccountMenuButton.cpp:1:
src/CloudAccountMenuButton.h:4:10: fatal error: 'QWidget' file not found
4 | #include
| ^~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-2379474b44135183/tmp/clang_command_.tmp.fd3113.txt
++Contents of '/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-2379474b44135183/tmp/clang_command_.tmp.fd3113.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu"

... [truncated 1123 characters] ...

tall/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/2379474b44135183/file.o" "-x" "c++"
"src/CloudAccountMenuButton.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/CloudCredentialStore_test.cpp

In file included from src/CloudCredentialStore_test.cpp:1:
src/CloudCredentialStore.h:14:10: fatal error: 'QString' file not found
14 | #include
| ^~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-f443d5dfff793717/tmp/clang_command_.tmp.1646eb.txt
++Contents of '/tmp/coderabbit-infer/f94236ad24c98bac994ef43373e28e5befc62450-f443d5dfff793717/tmp/clang_command_.tmp.1646eb.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu

... [truncated 1131 characters] ...

l/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/f443d5dfff793717/file.o" "-x" "c++"
"src/CloudCredentialStore_test.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

  • 1 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83eb78247c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mainwindow.cpp
Comment on lines +2481 to +2483
pollTimer.start(intervalMs);
pollOnce();
prompt.exec();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Start polling after the sign-in dialog is shown

If the very first pollOnce() returns anything other than authorization_pending/slow_down (for example a transient network error from QtMeshCloudClient::pollDeviceToken, or an immediate failure from the service), failSignIn() calls prompt.reject() before prompt.exec() has started. QDialog::exec() then initializes and shows the dialog anyway, with the timer already stopped, leaving users stuck in a sign-in dialog that will never poll again after the warning. Start the timer/poll from the dialog's event loop (e.g. a zero-delay QTimer::singleShot) or skip exec() when the pre-exec poll already completed.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 54-57: Update the stale version strings in the README so all
examples and descriptive text match the bumped tag 3.4.0: replace occurrences of
"currently **3.1.0**" and "pin :**3.1.0**" (and any other mentions within the
ranges cited: 82-86, 89-95, 97-104, 106-113) with "3.4.0" (or "currently
**3.4.0**"/"pin :**3.4.0**" to match existing formatting) so the documented
example using uses: fernandotonon/QtMeshEditor@3.4.0 and image-tag: "3.4.0" is
consistent throughout.

In `@src/CloudAccountMenuButton.cpp`:
- Around line 238-255: The menu actions in CloudAccountMenuButton
(m_openProjectsAction, m_uploadAction, m_signOutAction, m_signInAction) must
emit their own telemetry breadcrumbs; move/insert
SentryReporter::addBreadcrumb(...) calls directly next to each
QAction::triggered connect in the CloudAccountMenuButton constructor so the
widget self-reports when openProjectsRequested, uploadFilesRequested,
signOutRequested and signInRequested are triggered, using a clear
category/message per action and ensuring the breadcrumb call runs before
emitting the signal.

In `@src/CloudCredentialStore_test.cpp`:
- Around line 74-80: The test writes a corrupt session file at sessionFilePath()
but doesn't create the parent directory first, causing file.open(...) to fail on
a clean worker; before opening the QFile at path, create the parent directory
like CloudCredentialStore::writeFallbackFile() does (use QFileInfo or QDir to
get the directory for sessionFilePath() and call QDir::mkpath(...) to ensure it
exists) so the subsequent QFile::open and write succeed and the corrupt-file
path is exercised.

In `@src/mainwindow.cpp`:
- Around line 2296-2326: The cloud toolbar entry points add breadcrumbs but
follow-on actions are missing instrumentation; update
MainWindow::setupCloudAccountStatusControl and the related flows to add
SentryReporter::addBreadcrumb calls for all follow-on user actions and failures:
add a breadcrumb on QDesktopServices::openUrl failure in the Open My Projects
handler (use a message like "Cloud toolbar: Open My Projects failed"), and
ensure signInToQtMeshCloud(), signOutOfQtMeshCloud(), and
uploadFilesToQtMeshCloud() emit breadcrumbs for their subsequent user actions
(e.g., device-code flow steps); instrument the device-code dialog callbacks
(Copy Code, Open Browser, Cancel/Close) to call SentryReporter::addBreadcrumb
with descriptive messages (e.g., "Cloud device-code: Copy Code", "Cloud
device-code: Open Browser", "Cloud device-code: Cancel") and keep the existing
m_cloudAccountControl/menu aboutToShow breadcrumb.

In `@tests/CMakeLists.txt`:
- Line 68: The tests for CloudAccountMenuButton aren't registered with CTest:
include the test source src/CloudAccountMenuButton_test.cpp in the call to
create_test_executable(...) (alongside the existing support source
CloudAccountMenuButton.cpp) and ensure that the resulting target is passed to
gtest_discover_tests(...) so the 12 tests are built and executed in CI; update
the tests/CMakeLists.txt entries that reference CloudAccountMenuButton.cpp, the
create_test_executable(...) invocation, and the gtest_discover_tests(...) call
accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9092085-cf28-4f91-b22c-8caf36f978ac

📥 Commits

Reviewing files that changed from the base of the PR and between 0e73b5d and 83eb782.

⛔ Files ignored due to path filters (1)
  • resources/cloud_account_user.svg is excluded by !**/*.svg
📒 Files selected for processing (14)
  • CMakeLists.txt
  • README.md
  • resources/resource.qrc
  • src/CMakeLists.txt
  • src/CloudAccountMenuButton.cpp
  • src/CloudAccountMenuButton.h
  • src/CloudAccountMenuButton_test.cpp
  • src/CloudCredentialStore.cpp
  • src/CloudCredentialStore_test.cpp
  • src/mainwindow.cpp
  • src/mainwindow.h
  • src/mainwindow_test.cpp
  • tests/CMakeLists.txt
  • website/src/hooks/useQtmeshActionRef.js

Comment thread README.md
Comment thread src/CloudAccountMenuButton.cpp
Comment thread src/CloudCredentialStore_test.cpp
Comment thread src/mainwindow.cpp Outdated
Comment on lines +2296 to +2326
void MainWindow::setupCloudAccountStatusControl()
{
m_cloudAccountControl = new CloudAccountMenuButton(this);

connect(m_cloudAccountControl, &CloudAccountMenuButton::signInRequested, this, [this]() {
SentryReporter::addBreadcrumb(QStringLiteral("ui.action"),
QStringLiteral("Cloud toolbar: Sign in"));
signInToQtMeshCloud();
});
connect(m_cloudAccountControl, &CloudAccountMenuButton::signOutRequested, this, [this]() {
SentryReporter::addBreadcrumb(QStringLiteral("ui.action"),
QStringLiteral("Cloud toolbar: Sign out"));
signOutOfQtMeshCloud();
});
connect(m_cloudAccountControl, &CloudAccountMenuButton::uploadFilesRequested, this, [this]() {
SentryReporter::addBreadcrumb(QStringLiteral("ui.action"),
QStringLiteral("Cloud toolbar: Upload Files"));
uploadFilesToQtMeshCloud();
});
connect(m_cloudAccountControl, &CloudAccountMenuButton::openProjectsRequested, this, [this]() {
SentryReporter::addBreadcrumb(QStringLiteral("ui.action"),
QStringLiteral("Cloud toolbar: Open My Projects"));
if (!QDesktopServices::openUrl(QUrl(QStringLiteral(QTMESH_CLOUD_WEB_URL)))) {
QMessageBox::warning(this, tr("QtMesh Cloud"),
tr("Could not open QtMesh Cloud in your browser."));
}
});
connect(m_cloudAccountControl->menu(), &QMenu::aboutToShow, this, []() {
SentryReporter::addBreadcrumb(QStringLiteral("ui.action"),
QStringLiteral("Cloud toolbar menu opened"));
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Breadcrumb the rest of the new cloud sign-in flow.

The toolbar entry points are tracked, but the new follow-on actions are not: failed openUrl() here, Copy Code, Open Browser, and cancel/close in the device-code dialog all bypass ui.action breadcrumbs. That leaves the new cloud UX under-instrumented even though it is now a primary user flow.

As per coding guidelines, **/*.cpp: "All user-facing actions and significant operations must be tracked with SentryReporter::addBreadcrumb(category, message)."

Also applies to: 2460-2485

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mainwindow.cpp` around lines 2296 - 2326, The cloud toolbar entry points
add breadcrumbs but follow-on actions are missing instrumentation; update
MainWindow::setupCloudAccountStatusControl and the related flows to add
SentryReporter::addBreadcrumb calls for all follow-on user actions and failures:
add a breadcrumb on QDesktopServices::openUrl failure in the Open My Projects
handler (use a message like "Cloud toolbar: Open My Projects failed"), and
ensure signInToQtMeshCloud(), signOutOfQtMeshCloud(), and
uploadFilesToQtMeshCloud() emit breadcrumbs for their subsequent user actions
(e.g., device-code flow steps); instrument the device-code dialog callbacks
(Copy Code, Open Browser, Cancel/Close) to call SentryReporter::addBreadcrumb
with descriptive messages (e.g., "Cloud device-code: Copy Code", "Cloud
device-code: Open Browser", "Cloud device-code: Cancel") and keep the existing
m_cloudAccountControl/menu aboutToShow breadcrumb.

Comment thread tests/CMakeLists.txt
Resolve test file conflicts keeping expanded cloud coverage; defer sign-in
polling until the dialog is shown; move Sentry breadcrumbs into the widget;
fix README version pins and register CloudAccountMenuButton tests in CTest.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
tests/CMakeLists.txt (1)

566-572: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add CloudAccountMenuButton_test to the aggregate target dependencies.

run_all_materialeditorthml_tests still doesn’t depend on CloudAccountMenuButton_test, so the new test binary may not be built before ctest --verbose runs.

Suggested patch
 add_custom_target(run_all_materialeditorthml_tests
     COMMAND ctest --verbose
     DEPENDS MaterialEditorQML_qml_test_runner
+    $<$<TARGET_EXISTS:CloudAccountMenuButton_test>:CloudAccountMenuButton_test>
     $<$<TARGET_EXISTS:MaterialEditorQML_test>:MaterialEditorQML_test>
     $<$<TARGET_EXISTS:MaterialEditorQML_qml_test>:MaterialEditorQML_qml_test>
     $<$<TARGET_EXISTS:MaterialEditorQML_perf_test>:MaterialEditorQML_perf_test>
     COMMENT "Running all MaterialEditorQML comprehensive tests"
 )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/CMakeLists.txt` around lines 566 - 572, The aggregate CMake target
run_all_materialeditorthml_tests is missing the new CloudAccountMenuButton_test
dependency; update the add_custom_target(...) DEPENDS list for
run_all_materialeditorthml_tests to include CloudAccountMenuButton_test so the
test binary is built before running ctest --verbose, ensuring you add
CloudAccountMenuButton_test alongside the existing dependencies
(MaterialEditorQML_test, MaterialEditorQML_qml_test,
MaterialEditorQML_perf_test) in the add_custom_target definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@tests/CMakeLists.txt`:
- Around line 566-572: The aggregate CMake target
run_all_materialeditorthml_tests is missing the new CloudAccountMenuButton_test
dependency; update the add_custom_target(...) DEPENDS list for
run_all_materialeditorthml_tests to include CloudAccountMenuButton_test so the
test binary is built before running ctest --verbose, ensuring you add
CloudAccountMenuButton_test alongside the existing dependencies
(MaterialEditorQML_test, MaterialEditorQML_qml_test,
MaterialEditorQML_perf_test) in the add_custom_target definition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e802da4f-21d9-4689-a4cc-ed609dabe70e

📥 Commits

Reviewing files that changed from the base of the PR and between 83eb782 and f94236a.

📒 Files selected for processing (6)
  • README.md
  • src/CloudAccountMenuButton.cpp
  • src/CloudAccountMenuButton_test.cpp
  • src/CloudCredentialStore_test.cpp
  • src/mainwindow.cpp
  • tests/CMakeLists.txt
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/CloudAccountMenuButton.cpp
  • src/CloudAccountMenuButton_test.cpp

@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

@fernandotonon
fernandotonon merged commit ecc8d90 into master Jun 3, 2026
20 checks passed
@fernandotonon
fernandotonon deleted the codex/cloud-account-toolbar branch June 3, 2026 16:25
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.

1 participant