Skip to content

Commit

Permalink
Onboarding: non-intrusive current page name inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
micieslak committed Jan 7, 2025
1 parent a24c098 commit 45b7c0c
Show file tree
Hide file tree
Showing 25 changed files with 61 additions and 102 deletions.
2 changes: 1 addition & 1 deletion storybook/pages/BackupSeedphraseFlowPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Item {
Label {
anchors.right: parent.right
anchors.bottom: parent.bottom
text: !!stack.currentItem && stack.currentItem.pageClassName === "BackupSeedphraseVerify" ?
text: !!stack.currentItem && stack.currentItem instanceof BackupSeedphraseVerify ?
"Hint: %1".arg(stack.currentItem.seedWordsToVerify.map((entry) => entry.seedWord))
: ""
}
Expand Down
3 changes: 1 addition & 2 deletions storybook/pages/OnboardingLayoutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ SplitView {
Component {
id: splashScreen
DidYouKnowSplashScreen {
readonly property string pageClassName: "Splash"
property bool runningProgressAnimation
NumberAnimation on progress {
from: 0.0
Expand Down Expand Up @@ -187,7 +186,7 @@ SplitView {
ColumnLayout {
Layout.fillWidth: true
Label {
text: "Current page: %1".arg(onboarding.stack.currentItem ? onboarding.stack.currentItem.pageClassName : "")
text: "Current page: %1".arg(InspectionUtils.baseName(onboarding.stack.currentItem))
}
Label {
text: "Stack depth: %1".arg(onboarding.stack.depth)
Expand Down
117 changes: 59 additions & 58 deletions storybook/qmlTests/tests/tst_OnboardingLayout.qml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/BackupSeedphraseAcks.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ OnboardingPage {

signal backupSeedphraseContinue()

pageClassName: "BackupSeedphraseAcks"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/BackupSeedphraseIntro.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ OnboardingPage {

signal backupSeedphraseRequested()

pageClassName: "BackupSeedphraseIntro"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/BackupSeedphraseOutro.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ OnboardingPage {

signal backupSeedphraseRemovalConfirmed()

pageClassName: "BackupSeedphraseOutro"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ OnboardingPage {

signal backupSeedphraseConfirmed()

pageClassName: "BackupSeedphraseReveal"

QtObject {
id: d
property bool seedphraseRevealed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ OnboardingPage {

signal backupSeedphraseVerified()

pageClassName: "BackupSeedphraseVerify"

QtObject {
id: d
readonly property var seedSuggestions: BIP39_en {} // [{seedWord:string}, ...]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ OnboardingPage {
signal createKeycardProfileWithNewSeedphrase()
signal createKeycardProfileWithExistingSeedphrase()

pageClassName: "CreateKeycardProfilePage"

contentItem: Item {
ColumnLayout {
width: parent.width
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/CreatePasswordPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ OnboardingPage {

title: qsTr("Create profile password")

pageClassName: "CreatePasswordPage"

QtObject {
id: d

Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/CreateProfilePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ OnboardingPage {
signal createProfileWithSeedphraseRequested()
signal createProfileWithEmptyKeycardRequested()

pageClassName: "CreateProfilePage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/EnableBiometricsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ OnboardingPage {

signal enableBiometricsRequested(bool enable)

pageClassName: "EnableBiometricsPage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ OnboardingPage {
signal shareUsageDataRequested(bool enabled)
signal privacyPolicyRequested()

pageClassName: "HelpUsImproveStatusPage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/KeycardAddKeyPairPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ OnboardingPage {
signal reloadKeycardRequested()
signal createProfilePageRequested()

pageClassName: "KeycardAddKeyPairPage"

Timer {
id: timer
interval: root.timeoutInterval
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ KeycardBasePage {

signal keycardPinCreated(string pin)

pageClassName: "KeycardCreatePinPage"
image.source: Theme.png("onboarding/keycard/reading")

QtObject {
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/KeycardEmptyPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ KeycardBasePage {
subtitle: qsTr("There is no profile key pair on this Keycard")
image.source: Theme.png("onboarding/keycard/error")

pageClassName: "KeycardEmptyPage"

buttons: [
MaybeOutlineButton {
anchors.horizontalCenter: parent.horizontalCenter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ KeycardBasePage {
signal unlockWithSeedphraseRequested()
signal keycardFactoryResetRequested()

pageClassName: "KeycardEnterPinPage"
image.source: Theme.png("onboarding/keycard/reading")

QtObject {
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/KeycardIntroPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ KeycardBasePage {
signal emptyKeycardDetected()
signal notEmptyKeycardDetected()

pageClassName: "KeycardIntroPage"

OnboardingFrame {
id: promoBanner
visible: false
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/KeycardNotEmptyPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ KeycardBasePage {
subtitle: qsTr("You can’t use it to store new keys right now")
image.source: Theme.png("onboarding/keycard/error")

pageClassName: "KeycardNotEmptyPage"

buttons: [
MaybeOutlineButton {
text: qsTr("I’ve inserted a different Keycard")
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/LoginBySyncingPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ OnboardingPage {

title: qsTr("Log in by syncing")

pageClassName: "LoginBySyncingPage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/LoginPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ OnboardingPage {
signal loginWithSyncingRequested()
signal loginWithKeycardRequested()

pageClassName: "LoginPage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/OnboardingPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import QtQuick.Controls 2.15
import StatusQ.Core.Theme 0.1

Page {
required property string pageClassName

signal openLink(string link)
signal openLinkWithConfirmation(string link, string domain)

Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/SeedphrasePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ OnboardingPage {

signal seedphraseSubmitted(string seedphrase)

pageClassName: "SeedphrasePage"

contentItem: Item {
ColumnLayout {
anchors.centerIn: parent
Expand Down
2 changes: 0 additions & 2 deletions ui/app/AppLayouts/Onboarding2/pages/SyncProgressPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ OnboardingPage {
signal restartSyncRequested()
signal loginWithSeedphraseRequested()

pageClassName: "SyncProgressPage"

Timer {
id: timer
interval: root.timeoutInterval
Expand Down
1 change: 0 additions & 1 deletion ui/app/AppLayouts/Onboarding2/pages/WelcomePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import utils 1.0
OnboardingPage {
id: root

pageClassName: "WelcomePage"
title: qsTr("Welcome to Status")

signal createProfileRequested()
Expand Down

0 comments on commit 45b7c0c

Please sign in to comment.