Skip to content

fix(wizard): align reauthentication with account setup - #10459

Open
Rello wants to merge 8 commits into
masterfrom
bugfix/ReAuthDialog
Open

fix(wizard): align reauthentication with account setup#10459
Rello wants to merge 8 commits into
masterfrom
bugfix/ReAuthDialog

Conversation

@Rello

@Rello Rello commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Replace the legacy QWidget reauthentication dialog with a QML window that shares the account wizard browser-auth content, footer, dimensions, and style tokens.

Keep credential replacement isolated from account creation and remove the unreachable provider-signup widget stack and its orphaned helpers.

Bildschirmfoto 2026-07-27 um 15 27 51

Assisted-by: Codex:GPT-5

Replace the legacy QWidget reauthentication dialog with a QML window
that shares the account wizard browser-auth content, footer, dimensions,
and style tokens.

Keep credential replacement isolated from account creation and remove
the unreachable provider-signup widget stack and its orphaned helpers.

Assisted-by: Codex:GPT-5
Signed-off-by: Rello <github@scherello.de>
@Rello Rello added this to the 34.0.1 milestone Jul 27, 2026

@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: c1957df8f9

ℹ️ 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/gui/WizardStyledWindow.qml Outdated
| Qt.CustomizeWindowHint
| Qt.WindowTitleHint
| Qt.WindowSystemMenuHint
| Qt.WindowMinimizeButtonHint

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 Keep the minimize hint scoped to authentication windows

When opening any existing WizardStyledWindow consumer, this base-level flag now adds minimize decoration to ActivitiesWindow.qml, AssistantWindow.qml, SearchWindow.qml, and UserStatusWindow.qml; previously only AccountWizardWindow.qml explicitly opted into minimization. Keep this hint on the account and reauthentication windows, or explicitly preserve the existing chrome for the other consumers, so the reauthentication refactor does not change unrelated windows.

AGENTS.md reference: AGENTS.md:L25-L27

Useful? React with 👍 / 👎.

@Rello Rello added the design Design, UI, UX, etc. label Jul 27, 2026

@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: f03bdf0288

ℹ️ 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/gui/trayaccountpopup_qt.cpp Outdated
Comment thread test/testbrowserreauthcontroller.cpp
@Rello
Rello force-pushed the bugfix/ReAuthDialog branch from f03bdf0 to c1957df Compare July 27, 2026 17:37
Replaced the direct successful slotAuthResult() test with integration coverage through WebFlowCredentials::askFromUser().
Exercises real QML window creation, browser-flow polling, credential replacement, persistence invocation, automatic close, and account-registration safety.
Added cancellation coverage by closing the actual QML window and verifying credentials remain unchanged.
Added a safe Application null guard for standard Qt test runners.

Assisted-by: Codex:GPT-5
Signed-off-by: Rello <github@scherello.de>
@Rello

Rello commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

@claucambra can you check the quite complex test? it applied the new guidelines - but look complicated. opinion?

@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: 90296ac1d0

ℹ️ 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 test/testbrowserreauthcontroller.cpp
Rello and others added 6 commits July 28, 2026 08:47
@github-actions

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-10459.zip

Digest: sha256:2093842478f7053d2511e6d360d3ee4b2dc2ea19aac3c545a3755eebe62ef1c3

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
75.4% Coverage on New Code (required ≥ 80%)
68 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

enabled: !root.controller.busy
text: qsTranslate("AccountWizardWindow", "Cancel")
Layout.fillWidth: true
Layout.preferredWidth: 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think the preferred width should ever be 1 for these buttons

Comment on lines +1 to +12
/*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
*/

import QtQuick

BrowserAuthPage {
id: root

descriptionText: root.controller.infoText
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This component seems unnecessary to me...

connect(this, &BrowserReAuthWindow::credentialsReady, this, &BrowserReAuthWindow::close, Qt::QueuedConnection);
connect(this, &BrowserReAuthWindow::cancelled, this, &BrowserReAuthWindow::close, Qt::QueuedConnection);

auto *const systray = Systray::instance();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should avoid auto *const in places where const auto achieves the same thing and is clearer

return;
}

auto *engine = systray->trayEngine();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, this could also be const

Comment on lines +54 to +55
QVariantMap initialProperties;
initialProperties.insert(QStringLiteral("controller"), QVariant::fromValue<QObject *>(_controller));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can construct a QVariantMap with the values inserted here directly, making this more concise and allowing us to constify this value

void BrowserReAuthWindow::show()
{
if (_loadFailed || !_window) {
QTimer::singleShot(0, this, [this] {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QMetaObject::invokeMethod is better than this

Comment thread theme/Style/Style.qml
readonly property int wizardStandaloneWindowMinimumWidth: 520
readonly property int wizardStandaloneWindowMinimumHeight: 420
readonly property int accountWizardWindowWidth: 600
readonly property int accountWizardCompactHeight: 420

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any reason to not reuse wizardStandaloneWindowMinimumHeight ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design, UI, UX, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants