Skip to content

Commit a144e35

Browse files
feat(@desktop/externalLinks): Update the external links popup as per new
designs to keep consitent behaviour in both privacy mode and without
1 parent cad3d5b commit a144e35

File tree

6 files changed

+115
-52
lines changed

6 files changed

+115
-52
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import QtQuick
2+
import QtQuick.Layouts
3+
import QtQuick.Controls
4+
5+
import shared.popups
6+
7+
import Storybook
8+
9+
SplitView {
10+
11+
Logs { id: logs }
12+
13+
Item {
14+
SplitView.fillWidth: true
15+
SplitView.fillHeight: true
16+
17+
PopupBackground {
18+
anchors.fill: parent
19+
}
20+
21+
Button {
22+
anchors.centerIn: parent
23+
text: "Reopen"
24+
25+
onClicked: popup.open()
26+
}
27+
28+
ConfirmExternalLinkPopup {
29+
id: popup
30+
31+
closePolicy: Popup.CloseOnEscape
32+
modal: false
33+
visible: true
34+
35+
link: "https://etherscan.io/token/0xdac17f958d2ee523a220622064597c13d831ec7"
36+
domain: "etherscan.io"
37+
38+
onOpenExternalLink: logs.logEvent("onOpenExternalLink called with link: " + link)
39+
onSaveDomainToUnfurledWhitelist: logs.logEvent("onSaveDomainToUnfurledWhitelist called with domain: " + domain)
40+
}
41+
}
42+
43+
LogsAndControlsPanel {
44+
id: logsAndControlsPanel
45+
46+
SplitView.minimumHeight: 100
47+
SplitView.preferredHeight: 200
48+
49+
logsView.logText: logs.logText
50+
}
51+
}
52+
53+
// category: Popups
54+
// https://www.figma.com/design/idUoxN7OIW2Jpp3PMJ1Rl8/Settings----Desktop-Legacy?node-id=27093-584044&m=dev

ui/i18n/qml_base_en.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,23 +3922,23 @@ file format</source>
39223922
<context>
39233923
<name>ConfirmExternalLinkPopup</name>
39243924
<message>
3925-
<source>Before you go</source>
3925+
<source>Cancel</source>
39263926
<translation type="unfinished"></translation>
39273927
</message>
39283928
<message>
3929-
<source>This link is taking you to the following site. Be careful to double check the URL before you go.</source>
3929+
<source>Opening external link</source>
39303930
<translation type="unfinished"></translation>
39313931
</message>
39323932
<message>
3933-
<source>Trust &lt;b&gt;%1&lt;/b&gt; links from now on</source>
3933+
<source>Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.</source>
39343934
<translation type="unfinished"></translation>
39353935
</message>
39363936
<message>
3937-
<source>Cancel</source>
3937+
<source>Always trust links to &lt;b&gt;%1&lt;/b&gt;</source>
39383938
<translation type="unfinished"></translation>
39393939
</message>
39403940
<message>
3941-
<source>Visit site</source>
3941+
<source>Open</source>
39423942
<translation type="unfinished"></translation>
39433943
</message>
39443944
</context>

ui/i18n/qml_base_lokalise_en.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,29 +4786,29 @@
47864786
<context>
47874787
<name>ConfirmExternalLinkPopup</name>
47884788
<message>
4789-
<source>Before you go</source>
4789+
<source>Cancel</source>
47904790
<comment>ConfirmExternalLinkPopup</comment>
4791-
<translation>Before you go</translation>
4791+
<translation>Cancel</translation>
47924792
</message>
47934793
<message>
4794-
<source>This link is taking you to the following site. Be careful to double check the URL before you go.</source>
4794+
<source>Opening external link</source>
47954795
<comment>ConfirmExternalLinkPopup</comment>
4796-
<translation>This link is taking you to the following site. Be careful to double check the URL before you go.</translation>
4796+
<translation>Opening external link</translation>
47974797
</message>
47984798
<message>
4799-
<source>Trust &lt;b&gt;%1&lt;/b&gt; links from now on</source>
4799+
<source>Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.</source>
48004800
<comment>ConfirmExternalLinkPopup</comment>
4801-
<translation>Trust &lt;b&gt;%1&lt;/b&gt; links from now on</translation>
4801+
<translation>Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.</translation>
48024802
</message>
48034803
<message>
4804-
<source>Cancel</source>
4804+
<source>Always trust links to &lt;b&gt;%1&lt;/b&gt;</source>
48054805
<comment>ConfirmExternalLinkPopup</comment>
4806-
<translation>Cancel</translation>
4806+
<translation>Always trust links to &lt;b&gt;%1&lt;/b&gt;</translation>
48074807
</message>
48084808
<message>
4809-
<source>Visit site</source>
4809+
<source>Open</source>
48104810
<comment>ConfirmExternalLinkPopup</comment>
4811-
<translation>Visit site</translation>
4811+
<translation>Open</translation>
48124812
</message>
48134813
</context>
48144814
<context>
@@ -23335,4 +23335,4 @@
2333523335
<translation>This is not a valid account name</translation>
2333623336
</message>
2333723337
</context>
23338-
</TS>
23338+
</TS>

ui/i18n/qml_cs.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3936,24 +3936,24 @@ file format</source>
39363936
<context>
39373937
<name>ConfirmExternalLinkPopup</name>
39383938
<message>
3939-
<source>Before you go</source>
3940-
<translation type="unfinished"></translation>
3939+
<source>Cancel</source>
3940+
<translation type="unfinished">Zrušit</translation>
39413941
</message>
39423942
<message>
3943-
<source>This link is taking you to the following site. Be careful to double check the URL before you go.</source>
3943+
<source>Opening external link</source>
39443944
<translation type="unfinished"></translation>
39453945
</message>
39463946
<message>
3947-
<source>Trust &lt;b&gt;%1&lt;/b&gt; links from now on</source>
3947+
<source>Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.</source>
39483948
<translation type="unfinished"></translation>
39493949
</message>
39503950
<message>
3951-
<source>Cancel</source>
3952-
<translation type="unfinished">Zrušit</translation>
3951+
<source>Always trust links to &lt;b&gt;%1&lt;/b&gt;</source>
3952+
<translation type="unfinished"></translation>
39533953
</message>
39543954
<message>
3955-
<source>Visit site</source>
3956-
<translation type="unfinished"></translation>
3955+
<source>Open</source>
3956+
<translation type="unfinished">Otevřít</translation>
39573957
</message>
39583958
</context>
39593959
<context>

ui/i18n/qml_ko.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,24 +3908,24 @@ file format</source>
39083908
<context>
39093909
<name>ConfirmExternalLinkPopup</name>
39103910
<message>
3911-
<source>Before you go</source>
3912-
<translation>가기 전에</translation>
3911+
<source>Cancel</source>
3912+
<translation>취소</translation>
39133913
</message>
39143914
<message>
3915-
<source>This link is taking you to the following site. Be careful to double check the URL before you go.</source>
3916-
<translation>이 링크는 다음 사이트로 이동합니다. 이동하기 전에 URL을 다시 한 번 확인하세요.</translation>
3915+
<source>Opening external link</source>
3916+
<translation type="unfinished"></translation>
39173917
</message>
39183918
<message>
3919-
<source>Trust &lt;b&gt;%1&lt;/b&gt; links from now on</source>
3920-
<translation>지금부터 &lt;b&gt;%1&lt;/b&gt; 링크를 신뢰하세요</translation>
3919+
<source>Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.</source>
3920+
<translation type="unfinished"></translation>
39213921
</message>
39223922
<message>
3923-
<source>Cancel</source>
3924-
<translation>취소</translation>
3923+
<source>Always trust links to &lt;b&gt;%1&lt;/b&gt;</source>
3924+
<translation type="unfinished"></translation>
39253925
</message>
39263926
<message>
3927-
<source>Visit site</source>
3928-
<translation>사이트 방문</translation>
3927+
<source>Open</source>
3928+
<translation type="unfinished">열기</translation>
39293929
</message>
39303930
</context>
39313931
<context>

ui/imports/shared/popups/ConfirmExternalLinkPopup.qml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import QtQuick
2-
import QtQuick.Controls
32
import QtQuick.Layouts
4-
import QtQml.Models
5-
6-
import utils
73

84
import StatusQ.Core.Theme
95
import StatusQ.Components
106
import StatusQ.Controls
117
import StatusQ.Popups.Dialog
128
import StatusQ.Core
139

10+
import shared.controls
11+
1412
StatusDialog {
1513
id: root
1614

@@ -20,10 +18,11 @@ StatusDialog {
2018
signal openExternalLink(string link)
2119
signal saveDomainToUnfurledWhitelist(string domain)
2220

23-
width: 521
21+
implicitWidth: 521
22+
padding: Theme.padding
2423

2524
header: StatusDialogHeader {
26-
headline.title: qsTr("Before you go")
25+
headline.title: qsTr("Opening external link")
2726
actions.closeButton.onClicked: root.close()
2827
leftComponent: StatusRoundIcon {
2928
asset.name: "browser"
@@ -32,33 +31,43 @@ StatusDialog {
3231
}
3332

3433
contentItem: ColumnLayout {
35-
spacing: 20
34+
spacing: Theme.padding
3635
StatusBaseText {
3736
Layout.fillWidth: true
3837
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
39-
text: qsTr("This link is taking you to the following site. Be careful to double check the URL before you go.")
38+
text: qsTr("Status asks before opening links to protect your privacy, as websites may collect your IP address or device information. Copy the link to open it elsewhere, or tap Open to continue in your default browser.")
4039
}
4140
Rectangle {
4241
Layout.fillWidth: true
4342
Layout.preferredHeight: 66
4443
radius: Theme.halfPadding
4544
color: Theme.palette.baseColor4
4645

47-
StatusBaseText {
46+
RowLayout {
4847
anchors.fill: parent
49-
anchors.leftMargin: Theme.padding
50-
anchors.rightMargin: Theme.padding
51-
anchors.topMargin: 11
52-
anchors.bottomMargin: Theme.halfPadding
53-
text: root.link
54-
wrapMode: Text.WrapAnywhere
55-
elide: Text.ElideRight
48+
anchors.margins: Theme.padding
49+
50+
spacing: Theme.padding
51+
52+
StatusBaseText {
53+
Layout.fillWidth: true
54+
text: root.link
55+
wrapMode: Text.WrapAnywhere
56+
elide: Text.ElideRight
57+
}
58+
CopyButton {
59+
Layout.alignment: Qt.AlignTop
60+
textToCopy: root.link
61+
}
62+
5663
}
5764
}
5865
StatusCheckBox {
5966
id: trustDomainCheckbox
67+
68+
Layout.margins: 12
6069
Layout.fillWidth: true
61-
text: qsTr("Trust <b>%1</b> links from now on").arg(root.domain)
70+
text: qsTr("Always trust links to <b>%1</b>").arg(root.domain)
6271
}
6372
}
6473

@@ -69,7 +78,7 @@ StatusDialog {
6978
onClicked: root.close()
7079
}
7180
StatusButton {
72-
text: qsTr("Visit site")
81+
text: qsTr("Open")
7382
onClicked: {
7483
// (optionally) save the domain to whitelist
7584
if (trustDomainCheckbox.checked) {

0 commit comments

Comments
 (0)