Skip to content

Commit

Permalink
430 - Design review for first public TestFlight Part2
Browse files Browse the repository at this point in the history
  • Loading branch information
gileluard committed Jan 27, 2023
1 parent d44ce9f commit a5a3973
Show file tree
Hide file tree
Showing 19 changed files with 453 additions and 131 deletions.
2 changes: 1 addition & 1 deletion DesignKit/Sources/Buttons/ElementCapsuleButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct ElementCapsuleButtonStyle: ButtonStyle {
configuration.label
.padding(7)
.frame(maxWidth: .infinity)
.font(.element.footnote)
.font(.element.headline)
.foregroundColor(fontColor)
.multilineTextAlignment(.center)
.background(background)
Expand Down
4 changes: 4 additions & 0 deletions ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
CF82143AA4A4F7BD11D22946 /* RoomTimelineViewProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACB6C5E4950B6C9842F35A38 /* RoomTimelineViewProvider.swift */; };
D034A195A3494E38BF060485 /* MockSessionVerificationControllerProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A9CCCF53495CF3D7B19FCE /* MockSessionVerificationControllerProxy.swift */; };
D05A193AE63030F2CFCE2E9C /* UITestScreenIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6FE34A0A47D010BBB4D4D4 /* UITestScreenIdentifier.swift */; };
D1DF52739551A5B2655C2D2E /* SettingsPickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7428970E7B5EA449806CFA3 /* SettingsPickerRow.swift */; };
D2D70B5DB1A5E4AF0CD88330 /* target.yml in Resources */ = {isa = PBXBuildFile; fileRef = 033DB41C51865A2E83174E87 /* target.yml */; };
D33AC79A50DFC26D2498DD28 /* FileRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5098DA7799946A61E34A2373 /* FileRoomTimelineItem.swift */; };
D59F046B15AA8E971053C1A6 /* RoomDetailsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813B198AE8833FD12E5A9C78 /* RoomDetailsCoordinator.swift */; };
Expand Down Expand Up @@ -1014,6 +1015,7 @@
D6CA5F386C7701C129398945 /* AuthenticationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationCoordinator.swift; sourceTree = "<group>"; };
D6D094C15E8DB424F1C6FC94 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = "<group>"; };
D6DC38E64A5ED3FDB201029A /* BugReportService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BugReportService.swift; sourceTree = "<group>"; };
D7428970E7B5EA449806CFA3 /* SettingsPickerRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsPickerRow.swift; sourceTree = "<group>"; };
D751BB69BB7C38FD247517B4 /* UITestsRootCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestsRootCoordinator.swift; sourceTree = "<group>"; };
D77B3D4950F1707E66E4A45A /* AnalyticsConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsConfiguration.swift; sourceTree = "<group>"; };
D8F5F9E02B1AB5350B1815E7 /* TimelineStartRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineStartRoomTimelineItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1335,6 +1337,7 @@
839E2C35DF3F9C7B54C3CE49 /* RoundedCornerShape.swift */,
F3F8435052B2488947B35942 /* SettingsActionButton.swift */,
BFB3D0B0E16FEC93175ABC2D /* SettingsDefaultRow.swift */,
D7428970E7B5EA449806CFA3 /* SettingsPickerRow.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -3241,6 +3244,7 @@
D6417E5A799C3C7F14F9EC0A /* SessionVerificationViewModelProtocol.swift in Sources */,
052BE25E8C466D3D60558DA3 /* SettingsActionButton.swift in Sources */,
A2DDFA5033B535AB2BA51F5C /* SettingsDefaultRow.swift in Sources */,
D1DF52739551A5B2655C2D2E /* SettingsPickerRow.swift in Sources */,
7FED310F6AB7A70CBFB7C8A3 /* SettingsScreen.swift in Sources */,
233221E32DA045018D3D3050 /* SettingsScreenCoordinator.swift in Sources */,
DBAA69CC2CE4D44BC8E20105 /* SettingsScreenModels.swift in Sources */,
Expand Down
55 changes: 50 additions & 5 deletions ElementX/Resources/Localizations/en.lproj/Untranslated.strings
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"screenshot_detected_message" = "Would you like to submit a bug report?";

"settings_appearance" = "Appearance";
"settings_timeline_style" = "Timeline Style";
"settings_timeline_style" = "Message layout";
"settings_session_verification" = "Complete verification";

"room_timeline_style_plain_long_description" = "Plain Timeline";
"room_timeline_style_bubbled_long_description" = "Bubbled Timeline";
"room_timeline_style_plain_long_description" = "Modern";
"room_timeline_style_bubbled_long_description" = "Bubbles";

"room_timeline_permalink_creation_failure" = "Failed creating the permalink";
"room_timeline_backpagination_failure" = "Failed loading messages";
Expand All @@ -38,8 +39,9 @@
"noticeRoomUnknownMembershipChange" = "%1$@ made an unknown change to their membership";


"session_verification_banner_title" = "Help keep your messages secure";
"session_verification_banner_message" = "Looks like you’re using a new device. Verify its you.";
"session_verification_banner_title" = "Access your message history";
"session_verification_banner_message" = "Looks like you’re using a new device. Verify it’s you to access your encrypted messages.";
"session_verification_start" = "Start";

"server_selection_server_footer" = "You can only connect to an existing server";

Expand Down Expand Up @@ -70,3 +72,46 @@
"bug_report_screen_description" = "Please describe the bug. What did you do? What did you expect to happen? What actually happened. Please go into as much detail as you can.";
"bug_report_screen_include_logs" = "Send logs to help";
"bug_report_screen_logs_description" = "To check things work as intended, logs will be sent with your message. These will be private. To just send your message, turn off this setting.";


// Session verification
/*
"verification_open_other_to_verify" = "Use an existing session to verify this one, granting it access to encrypted messages.";
"verification_profile_verify" = "Verify";
"verification_profile_verified" = "Verified";
"verification_profile_warning" = "Warning";
"verification_conclusion_warning" = "Untrusted sign in";
"verification_sas_match" = "They match";
"verification_sas_do_not_match" = "They don\'t match";
"verification_conclusion_not_secure" = "Not secure";
"verification_conclusion_compromised" = "One of the following may be compromised:\n\n - Your homeserver\n - The homeserver the user you’re verifying is connected to\n - Yours, or the other users’ internet connection\n - Yours, or the other users’ device";
"verification_request_waiting" = "Waiting…";
"verification_request_other_cancelled" = "%@ cancelled";
"verification_request_you_cancelled" = "You cancelled";
"verification_request_other_accepted" = "%@ accepted";
"verification_request_you_accepted" = "You accepted";
"verification_sent" = "Verification Sent";
"verification_request" = "Verification Request";
"verification_verify_device" = "Verify this session";
"verification_scan_notice" = "Scan the code with the other user\'s device to securely verify each other";
"verification_scan_self_notice" = "Scan the code with your other device or switch and scan with this device";
"verification_scan_their_code" = "Scan their code";
"verification_scan_with_this_device" = "Scan with this device";
"verification_scan_emoji_title" = "Can\'t scan";
"verification_scan_emoji_subtitle" = "If you\'re not in person, compare emoji instead";
"verification_scan_self_emoji_subtitle" = "Verify by comparing emoji instead";
"verification_no_scan_emoji_title" = "Verify by comparing emojis";
"verification_verify_user" = "Verify %@";
"verification_verified_user" = "Verified %@";
"verification_request_waiting_for" = "Waiting for %@…";
*/

"verification_open_other_to_verify_title" = "Open an existing session";
"verification_open_other_to_verify_detail" = "Prove it’s you in order to access your encrypted message history.";
"verification_request_waiting_accept_request_title" = "Waiting to accept request";
"verification_request_waiting_accept_request_detail" = "Accept the request to start the verification process in your other session to continue.";
"verification_request_cancelled_title" = "Verification cancelled";
"verification_request_cancelled_detail" = "Something doesn’t seem right. Either the request timed out or the request was denied.";
"verification_compare_emojis_title" = "Compare emojis";
"verification_compare_emojis_detail" = "Confirm that the emojis below match those shown on your other session.";
"verification_conclusion_ok_self_notice_title" = "Verification complete";
32 changes: 27 additions & 5 deletions ElementX/Sources/Generated/Strings+Untranslated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ extension ElementL10n {
public static func roomTimelineReplyingTo(_ p1: Any) -> String {
return ElementL10n.tr("Untranslated", "room_timeline_replying_to", String(describing: p1))
}
/// Bubbled Timeline
/// Bubbles
public static let roomTimelineStyleBubbledLongDescription = ElementL10n.tr("Untranslated", "room_timeline_style_bubbled_long_description")
/// Plain Timeline
/// Modern
public static let roomTimelineStylePlainLongDescription = ElementL10n.tr("Untranslated", "room_timeline_style_plain_long_description")
/// Syncing
public static let roomTimelineSyncing = ElementL10n.tr("Untranslated", "room_timeline_syncing")
Expand All @@ -116,20 +116,42 @@ extension ElementL10n {
public static let screenshotDetectedTitle = ElementL10n.tr("Untranslated", "screenshot_detected_title")
/// You can only connect to an existing server
public static let serverSelectionServerFooter = ElementL10n.tr("Untranslated", "server_selection_server_footer")
/// Looks like you’re using a new device. Verify its you.
/// Looks like you’re using a new device. Verify it’s you to access your encrypted messages.
public static let sessionVerificationBannerMessage = ElementL10n.tr("Untranslated", "session_verification_banner_message")
/// Help keep your messages secure
/// Access your message history
public static let sessionVerificationBannerTitle = ElementL10n.tr("Untranslated", "session_verification_banner_title")
/// Start
public static let sessionVerificationStart = ElementL10n.tr("Untranslated", "session_verification_start")
/// Appearance
public static let settingsAppearance = ElementL10n.tr("Untranslated", "settings_appearance")
/// Timeline Style
/// Complete verification
public static let settingsSessionVerification = ElementL10n.tr("Untranslated", "settings_session_verification")
/// Message layout
public static let settingsTimelineStyle = ElementL10n.tr("Untranslated", "settings_timeline_style")
/// Untranslated
public static let untranslated = ElementL10n.tr("Untranslated", "untranslated")
/// Plural format key: "%#@VARIABLE@"
public static func untranslatedPlural(_ p1: Int) -> String {
return ElementL10n.tr("Untranslated", "untranslated_plural", p1)
}
/// Confirm that the emojis below match those shown on your other session.
public static let verificationCompareEmojisDetail = ElementL10n.tr("Untranslated", "verification_compare_emojis_detail")
/// Compare emojis
public static let verificationCompareEmojisTitle = ElementL10n.tr("Untranslated", "verification_compare_emojis_title")
/// Verification complete
public static let verificationConclusionOkSelfNoticeTitle = ElementL10n.tr("Untranslated", "verification_conclusion_ok_self_notice_title")
/// Prove it’s you in order to access your encrypted message history.
public static let verificationOpenOtherToVerifyDetail = ElementL10n.tr("Untranslated", "verification_open_other_to_verify_detail")
/// Open an existing session
public static let verificationOpenOtherToVerifyTitle = ElementL10n.tr("Untranslated", "verification_open_other_to_verify_title")
/// Something doesn’t seem right. Either the request timed out or the request was denied.
public static let verificationRequestCancelledDetail = ElementL10n.tr("Untranslated", "verification_request_cancelled_detail")
/// Verification cancelled
public static let verificationRequestCancelledTitle = ElementL10n.tr("Untranslated", "verification_request_cancelled_title")
/// Accept the request to start the verification process in your other session to continue.
public static let verificationRequestWaitingAcceptRequestDetail = ElementL10n.tr("Untranslated", "verification_request_waiting_accept_request_detail")
/// Waiting to accept request
public static let verificationRequestWaitingAcceptRequestTitle = ElementL10n.tr("Untranslated", "verification_request_waiting_accept_request_title")
}
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces
2 changes: 1 addition & 1 deletion ElementX/Sources/Other/AvatarSize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ enum RoomAvatarSizeOnScreen {
case .timeline:
return 32
case .home:
return 44
return 52
case .details:
return 70
}
Expand Down
53 changes: 53 additions & 0 deletions ElementX/Sources/Other/SwiftUI/Views/SettingsPickerRow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// Copyright 2023 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import SwiftUI

/// Picker row that can be reused for settings screens
struct SettingsPickerRow<SelectionValue: Hashable, Content: View>: View {
// MARK: Public

let title: String
let image: Image
@Binding var selection: SelectionValue
let content: () -> Content

// MARK: Private

@ScaledMetric private var menuIconSize = 30.0
private let listRowInsets = EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16)

// MARK: Views

var body: some View {
Picker(selection: $selection, content: content) {
HStack(spacing: 16) {
image
.foregroundColor(.element.systemGray)
.padding(4)
.background(Color.element.systemGray6)
.clipShape(RoundedRectangle(cornerRadius: 8))
.frame(width: menuIconSize, height: menuIconSize)

Text(title)
.font(.element.body)
.foregroundColor(.element.primaryContent)
}
}
.listRowInsets(listRowInsets)
.listRowSeparator(.hidden)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ struct AuthenticationIconImage: View {
.resizable()
.renderingMode(.template)
.foregroundColor(.element.secondaryContent)
.aspectRatio(contentMode: .fit)
.accessibilityHidden(true)
.padding(20)
.padding(16)
.frame(width: 72, height: 72)
.background(RoundedRectangle(cornerRadius: 14).fill(Color.element.quinaryContent))
}
Expand Down
49 changes: 27 additions & 22 deletions ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,23 @@ struct HomeScreen: View {
userMenuButton
}
}
.background(Color.element.background)
}

@ViewBuilder
private var userMenuButton: some View {
Menu {
Section {
Button(action: settings) {
Label(ElementL10n.settingsUserSettings, systemImage: "gearshape")
Label(ElementL10n.settings, systemImage: "gearshape")
}
}
Section {
Button(action: inviteFriends) {
Label(ElementL10n.inviteFriends, systemImage: "square.and.arrow.up")
Label(ElementL10n.actionInvite, systemImage: "square.and.arrow.up")
}
Button(action: feedback) {
Label(ElementL10n.feedback, systemImage: "questionmark.circle")
Label(ElementL10n.bugReportScreenTitle, systemImage: "questionmark.circle")
}
}
Section {
Expand Down Expand Up @@ -122,31 +123,35 @@ struct HomeScreen: View {

private var sessionVerificationBanner: some View {
VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: 2) {
Text(ElementL10n.sessionVerificationBannerTitle)
.font(.element.subheadlineBold)
.foregroundColor(.element.systemPrimaryLabel)
VStack(alignment: .leading, spacing: 4) {
HStack(spacing: 16) {
Text(ElementL10n.sessionVerificationBannerTitle)
.font(.element.headline)
.foregroundColor(.element.systemPrimaryLabel)

Spacer()

Button {
context.send(viewAction: .skipSessionVerification)
} label: {
Image(systemName: "xmark")
.foregroundColor(.element.secondaryContent)
.frame(width: 12, height: 12)
}
}
Text(ElementL10n.sessionVerificationBannerMessage)
.font(.element.footnote)
.foregroundColor(.element.systemSecondaryLabel)
.font(.element.subheadline)
.foregroundColor(.element.secondaryContent)
}

HStack(spacing: 16) {
Button(ElementL10n.actionSkip) {
context.send(viewAction: .skipSessionVerification)
}
.frame(maxWidth: .infinity)
.buttonStyle(.elementCapsule)

Button(ElementL10n.continue) {
context.send(viewAction: .verifySession)
}
.frame(maxWidth: .infinity)
.buttonStyle(.elementCapsuleProminent)
Button(ElementL10n.continue) {
context.send(viewAction: .verifySession)
}
.frame(maxWidth: .infinity)
.buttonStyle(.elementCapsuleProminent)
}
.padding(16)
.background(Color.element.systemSecondaryBackground)
.background(Color.element.system)
.cornerRadius(14)
.padding(.horizontal, 16)
}
Expand Down
Loading

0 comments on commit a5a3973

Please sign in to comment.