fix: Add additional information to the Beta tags

- display additional beta information as a tooltip
- don't overlap the Beta badge with the unread msg indicator
- some minor cleanups & fixes

Fixes #15795
Fixes #15929
This commit is contained in:
Lukáš Tinkl 2024-08-03 09:49:14 +02:00 committed by Lukáš Tinkl
parent 27aaa97ebd
commit 6159f53839
16 changed files with 106 additions and 27 deletions

View File

@ -17,8 +17,8 @@ SplitView {
SplitView.fillHeight: true SplitView.fillHeight: true
StatusBetaTag { StatusBetaTag {
id: tag
anchors.centerIn: parent anchors.centerIn: parent
tooltipText: ctrlTooltip.text
} }
} }
@ -27,6 +27,16 @@ SplitView {
SplitView.preferredWidth: 400 SplitView.preferredWidth: 400
SplitView.fillHeight: true SplitView.fillHeight: true
RowLayout {
Label {
text: "Tooltip:"
}
TextField {
id: ctrlTooltip
text: "Hic sunt leones!!!"
}
}
} }
} }

View File

@ -1,10 +1,14 @@
import QtQuick 2.13 import QtQuick 2.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
Rectangle { Rectangle {
id: root id: root
property alias tooltipText: tip.text
implicitHeight: 20 implicitHeight: 20
implicitWidth: 36 implicitWidth: 36
radius: 4 radius: 4
@ -20,4 +24,13 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
text: "Beta" text: "Beta"
} }
StatusToolTip {
id: tip
visible: hoverHandler.hovered && !!text
}
HoverHandler {
id: hoverHandler
}
} }

View File

@ -1,4 +1,5 @@
import QtQuick 2.13 import QtQuick 2.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1 import StatusQ.Components 0.1
@ -29,14 +30,6 @@ StatusListItem {
Theme.palette.baseColor4 Theme.palette.baseColor4
} }
MouseArea {
id: sensor
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: statusNavigationListItem.clicked(statusNavigationListItem.itemId, mouse)
}
components: [ components: [
StatusBadge { StatusBadge {
id: statusBadge id: statusBadge

View File

@ -1,9 +1,9 @@
import QtQuick 2.13 import QtQuick 2.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
Loader { Loader {
id: root id: root

View File

@ -1,5 +1,6 @@
import QtQuick 2.13 import QtQuick 2.15
import QtQuick.Controls 2.13 import QtQuick.Controls 2.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1

View File

@ -28,6 +28,7 @@ Column {
Repeater { Repeater {
id: mainMenuItems id: mainMenuItems
delegate: StatusNavigationListItem { delegate: StatusNavigationListItem {
id: navigationItem
objectName: itemId + "-MainMenuItem" objectName: itemId + "-MainMenuItem"
width: root.width width: root.width
itemId: model.subsection itemId: model.subsection
@ -41,7 +42,7 @@ Column {
return !root.privacyStore.mnemonicBackedUp return !root.privacyStore.mnemonicBackedUp
case Constants.settingsSubsection.syncingSettings: case Constants.settingsSubsection.syncingSettings:
return root.devicesStore.devicesModel.count - root.devicesStore.devicesModel.pairedCount return root.devicesStore.devicesModel.count - root.devicesStore.devicesModel.pairedCount
default: return ""; default: return 0
} }
} }
visible: { visible: {
@ -55,12 +56,16 @@ Column {
} }
Loader { Loader {
id: betaTagLoader
readonly property string experimentalTooltip: model.experimentalTooltip
active: model.isExperimental active: model.isExperimental
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15 anchors.rightMargin: Style.current.padding + (navigationItem.badge.visible ? navigationItem.badge.width + Style.current.halfPadding : 0)
sourceComponent: StatusBetaTag {} sourceComponent: StatusBetaTag {
tooltipText: betaTagLoader.experimentalTooltip
}
} }
} }
} }

View File

@ -108,11 +108,15 @@ QtObject {
append({subsection: Constants.settingsSubsection.ensUsernames, append({subsection: Constants.settingsSubsection.ensUsernames,
text: qsTr("ENS usernames"), text: qsTr("ENS usernames"),
icon: "username", icon: "username",
isExperimental: true}) isExperimental: true,
experimentalTooltip: qsTr("This section is going through a redesign.")
})
append({subsection: Constants.settingsSubsection.syncingSettings, append({subsection: Constants.settingsSubsection.syncingSettings,
text: qsTr("Syncing"), text: qsTr("Syncing"),
icon: "rotate", icon: "rotate",
isExperimental: true}) isExperimental: true,
experimentalTooltip: qsTr("Connection problems can happen.<br>If they do, please use the Enter a Seed Phrase feature instead.")
})
} }
} }

View File

@ -188,6 +188,7 @@ SettingsContentBase {
anchors.left: parent.right anchors.left: parent.right
anchors.leftMargin: 8 anchors.leftMargin: 8
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
tooltipText: qsTr("Connection problems can happen.<br>If they do, please use the Enter a Seed Phrase feature instead.")
} }
} }
} }

View File

@ -388,7 +388,9 @@ SettingsContentBase {
Component { Component {
id: experimentalTagComponent id: experimentalTagComponent
StatusBetaTag {} StatusBetaTag {
tooltipText: qsTr("Under construction, you might experience some minor issues")
}
} }
Component { Component {

View File

@ -146,6 +146,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 125 anchors.leftMargin: 125
tooltipText: qsTr("Under construction, you might experience some minor issues")
} }
} }
@ -168,6 +169,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 135 anchors.leftMargin: 135
tooltipText: qsTr("Under construction, you might experience some minor issues")
} }
} }

View File

@ -204,7 +204,7 @@ Item {
sendModal: root.sendModalPopup sendModal: root.sendModalPopup
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
headerButton.text: RootStore.overview.ens || StatusQUtils.Utils.elideText(RootStore.overview.mixedcaseAddress, 6, 4) headerButton.text: RootStore.overview.ens || StatusQUtils.Utils.elideAndFormatWalletAddress(RootStore.overview.mixedcaseAddress)
headerButton.visible: !RootStore.overview.isAllAccounts headerButton.visible: !RootStore.overview.isAllAccounts
onLaunchShareAddressModal: Global.openShowQRPopup({ onLaunchShareAddressModal: Global.openShowQRPopup({
switchingAccounsEnabled: true, switchingAccounsEnabled: true,

View File

@ -188,6 +188,7 @@ Control {
} }
MouseArea { MouseArea {
cursorShape: root.enabled ? Qt.PointingHandCursor : undefined
anchors.fill: parent anchors.fill: parent
onClicked: dropdown.opened ? dropdown.close() : dropdown.open() onClicked: dropdown.opened ? dropdown.close() : dropdown.open()
} }

View File

@ -144,9 +144,9 @@ Rectangle {
StatusFlatButton { StatusFlatButton {
id: swap id: swap
interactive: !d.isCollectibleSoulbound && networkConnectionStore.sendBuyBridgeEnabled interactive: !d.isCollectibleViewed && networkConnectionStore.sendBuyBridgeEnabled
visible: d.swapActionAvailable visible: d.swapActionAvailable
tooltip.text: d.isCollectibleSoulbound ? qsTr("Soulbound collectibles cannot be swapped") : networkConnectionStore.sendBuyBridgeToolTipText tooltip.text: d.isCollectibleViewed ? qsTr("Collectibles cannot be swapped") : networkConnectionStore.sendBuyBridgeToolTipText
icon.name: "swap" icon.name: "swap"
text: qsTr("Swap") text: qsTr("Swap")
onClicked: root.launchSwapModal() onClicked: root.launchSwapModal()

View File

@ -76,7 +76,9 @@ Item {
} }
} }
StatusBetaTag {} StatusBetaTag {
tooltipText: qsTr("Under construction.<br>More notification types to be coming soon.")
}
StatusFlatRoundButton { StatusFlatRoundButton {
id: markAllReadBtn id: markAllReadBtn

View File

@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1 as SQUtils
import StatusQ.Components 0.1 import StatusQ.Components 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
@ -105,6 +106,39 @@ ColumnLayout {
} }
} }
InformationTag {
id: betaTag
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
Layout.topMargin: root.firstItemOffset
Layout.preferredHeight: 56
visible: root.firstItemOffset === 0 // visible only in the main wallet view
spacing: Style.current.halfPadding
backgroundColor: Theme.palette.primaryColor3
bgRadius: Style.current.radius
bgBorderColor: Theme.palette.primaryColor2
tagPrimaryLabel.textFormat: Text.RichText
tagPrimaryLabel.font.pixelSize: Style.current.additionalTextSize
tagPrimaryLabel.text: qsTr("Activity is in beta. If transactions are missing, check %1, %2, or %3.")
.arg(Utils.getStyledLink("Etherscan", "https://etherscan.io/", tagPrimaryLabel.hoveredLink))
.arg(Utils.getStyledLink("OP Explorer", "https://optimistic.etherscan.io/", tagPrimaryLabel.hoveredLink))
.arg(Utils.getStyledLink("Arbiscan", "https://arbiscan.io/", tagPrimaryLabel.hoveredLink))
tagPrimaryLabel.onLinkActivated: (link) => {
const explorerUrl = WalletStores.RootStore.showAllAccounts ? link
: "%1/%2/%3".arg(link).arg(Constants.networkExplorerLinks.addressPath).arg(WalletStores.RootStore.selectedAddress)
Global.openLinkWithConfirmation(explorerUrl, SQUtils.StringUtils.extractDomainFromLink(explorerUrl))
}
asset {
name: "warning"
width: 20
height: 20
color: Theme.palette.primaryColor1
}
HoverHandler {
cursorShape: hovered && !!parent.tagPrimaryLabel.hoveredLink ? Qt.PointingHandCursor : undefined
}
}
StyledText { StyledText {
id: nonArchivalNodeError id: nonArchivalNodeError
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -137,11 +137,22 @@ QtObject {
`<a href="${link}">${link}</a>` `<a href="${link}">${link}</a>`
} }
function getStyledLink(linkText, linkUrl, hoveredLink, textColor = Theme.palette.directColor1, linkColor = Theme.palette.primaryColor1) {
return `<style type="text/css">` +
`a {` +
`color: ${textColor};` +
`text-decoration: underline;` +
`}` +
(hoveredLink === linkUrl ? `a[href="${linkUrl}"] { text-decoration: underline; color: ${linkColor} }` : "") +
`</style>` +
`<a href="${linkUrl}">${linkText}</a>`
}
function isMnemonic(value) { function isMnemonic(value) {
if(!value.match(/^([a-z\s]+)$/)){ if(!value.match(/^([a-z\s]+)$/)){
return false; return false;
} }
return Utils.seedPhraseValidWordCount(value); return seedPhraseValidWordCount(value);
} }
function compactAddress(addr, numberOfChars) { function compactAddress(addr, numberOfChars) {