Skip to content

Commit 925286c

Browse files
committed
Working on Seed Backup page layout.
1 parent f1d5437 commit 925286c

3 files changed

Lines changed: 41 additions & 19 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ _For related Threat Modeling, see the [Seed Tool Manual](https://github.com/Bloc
4747

4848
[Join the Test Flight Open Beta](https://testflight.apple.com/join/0LIl6H1h)
4949

50+
### 1.6 (77)
51+
52+
* THIS IS A RELEASE CANDIDATE
53+
* Fixed: Output descriptor was not being included in the QR code on Seed backup printed pages.
54+
5055
### 1.6 (76)
5156

5257
* THIS IS A RELEASE CANDIDATE

SeedTool/Model/BackupPage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct BackupPage<Subject, Footer>: View where Subject: ObjectIdentifiable, Foot
2727
}
2828

2929
var body: some View {
30-
VStack(alignment: .leading, spacing: 20) {
30+
VStack(alignment: .leading, spacing: 10) {
3131
HStack(spacing: 0.25 * pointsPerInch) {
3232
identity
3333
Spacer()
@@ -37,7 +37,7 @@ struct BackupPage<Subject, Footer>: View where Subject: ObjectIdentifiable, Foot
3737

3838
if didLimit {
3939
Caution("Some metadata was elided to fit into the QR code. Try making your notes field smaller.")
40-
.font(.system(size: 14))
40+
.font(.system(size: 12))
4141
}
4242

4343
footer

SeedTool/Seeds/SeedBackupPage.swift

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ struct SeedBackupPage: View {
2222

2323
let titleFontSize = 16.0
2424
let textFontSize = 12.0
25-
let sectionSpacing = 12.0
25+
let dataFontSize = 8.0
26+
let sectionSpacing = 8.0
2627
let itemSpacing = 5.0
2728

2829
var body: some View {
@@ -35,36 +36,40 @@ struct SeedBackupPage: View {
3536
byteWords
3637
bip39
3738
envelopeView
38-
if seed.creationDate != nil {
39+
if hasCreationDate {
3940
creationDate
4041
}
41-
derivations
42-
BackupPageNoteSection(note: seed.note)
42+
if hasDerivation {
43+
derivations
44+
}
45+
if hasNote {
46+
BackupPageNoteSection(note: seed.note)
47+
}
4348
Spacer()
4449
}
4550
}
4651

4752
var data: some View {
4853
BackupPageSection(title: Text("Hex"), icon: Image.hex) {
4954
Text(seed.data.hex)
50-
.appMonospaced(size: textFontSize)
51-
.layoutPriority(1)
55+
.appMonospaced(size: dataFontSize)
5256
}
57+
.layoutPriority(1)
5358
}
5459

5560
var byteWords: some View {
5661
BackupPageSection(title: Text("ByteWords"), icon: Image.byteWords) {
5762
Text(seed.byteWords)
58-
.appMonospaced(size: textFontSize)
59-
.layoutPriority(1)
63+
.appMonospaced(size: dataFontSize)
64+
.fixedVertical()
6065
}
6166
}
6267

6368
var bip39: some View {
6469
BackupPageSection(title: Text("BIP39 Words"), icon: Image.bip39) {
6570
Text(seed.bip39.mnemonic)
66-
.appMonospaced(size: textFontSize)
67-
.layoutPriority(1)
71+
.appMonospaced(size: dataFontSize)
72+
.fixedVertical()
6873
}
6974
}
7075

@@ -74,13 +79,14 @@ struct SeedBackupPage: View {
7479
.appMonospaced(size: textFontSize)
7580
.minimumScaleFactor(0.3)
7681
}
82+
.layoutPriority(0.5)
7783
}
7884

7985
var creationDate: some View {
8086
BackupPageSection(title: Text("Creation Date"), icon: Image.date) {
8187
Text(seedDateFormatter.string(from: seed.creationDate!))
82-
.layoutPriority(1)
8388
}
89+
.layoutPriority(1)
8490
}
8591

8692
@ViewBuilder
@@ -145,6 +151,19 @@ struct SeedBackupPage: View {
145151
.layoutPriority(1)
146152
}
147153

154+
var hasDerivation: Bool {
155+
globalSettings.primaryAsset != .btc ||
156+
seed.outputDescriptor != nil
157+
}
158+
159+
var hasCreationDate: Bool {
160+
seed.creationDate != nil
161+
}
162+
163+
var hasNote: Bool {
164+
!seed.note.isEmpty
165+
}
166+
148167
var masterKey: HDKey {
149168
seed.masterKey
150169
}
@@ -196,13 +215,11 @@ struct BackupPageNoteSection: View {
196215
let note: String
197216

198217
var body: some View {
199-
if let note = sizeLimitedNote, !note.isEmpty {
200-
BackupPageSection(title: Text("Notes"), icon: Image.note) {
201-
Text(note)
202-
.minimumScaleFactor(0.5)
203-
.layoutPriority(0.5)
204-
}
218+
BackupPageSection(title: Text("Notes"), icon: Image.note) {
219+
Text(note)
220+
.minimumScaleFactor(0.5)
205221
}
222+
.layoutPriority(0.5)
206223
}
207224

208225
var sizeLimitedNote: String? {

0 commit comments

Comments
 (0)