diff --git a/apple/walkieware/Sources/WalkiewareHeader.swift b/apple/walkieware/Sources/WalkiewareHeader.swift index 626278d841..646802e83e 100644 --- a/apple/walkieware/Sources/WalkiewareHeader.swift +++ b/apple/walkieware/Sources/WalkiewareHeader.swift @@ -84,7 +84,7 @@ struct AccountSheet: View { List { Section { if handle.isEmpty { - Button { signIn(); dismiss() } label: { Label("Sign in to Aesthetic Computer", systemImage: "person") } + Button { signIn(); dismiss() } label: { Label("Log in to Aesthetic Computer", systemImage: "person") } } else { HStack { ComicTitle(text: "@" + handle, colors: colors, size: 26) @@ -127,13 +127,19 @@ struct IdentityHeader: View { let beforeOpening: () -> Void @State private var showingPieces = false @State private var showingAccount = false - private var handleText: String { session.snapshot.handle.isEmpty ? "Sign in" : "@" + session.snapshot.handle } + private var signedIn: Bool { !session.snapshot.handle.isEmpty } + private var handleText: String { signedIn ? "@" + session.snapshot.handle : "Log in" } var body: some View { HStack(spacing: 0) { - Button { beforeOpening(); showingAccount = true } label: { + // Signed out, the whole corner is one plain "Log in" that starts the + // login; the piece code and the account sheet wait for a handle. + Button { + beforeOpening() + if signedIn { showingAccount = true } else { session.command("signIn") } + } label: { ComicTitle(text: handleText, colors: session.snapshot.colors, size: size) - }.buttonStyle(.plain).accessibilityLabel(handleText + ", account").accessibilityIdentifier("workspace-account") - if !session.snapshot.code.isEmpty { + }.buttonStyle(.plain).accessibilityLabel(signedIn ? handleText + ", account" : "Log in").accessibilityIdentifier("workspace-account") + if signedIn && !session.snapshot.code.isEmpty { Button { beforeOpening(); showingPieces = true } label: { ComicTitle(text: "/" + session.snapshot.code, size: size) }.buttonStyle(.plain).accessibilityLabel(session.snapshot.code + ", pieces").accessibilityIdentifier("workspace-settings") diff --git a/apple/walkieware/Sources/WalkiewareScreen.swift b/apple/walkieware/Sources/WalkiewareScreen.swift index 7716ed7418..53a33c1e17 100644 --- a/apple/walkieware/Sources/WalkiewareScreen.swift +++ b/apple/walkieware/Sources/WalkiewareScreen.swift @@ -168,7 +168,6 @@ struct WalkiewareScreen: View { .tint(paper) .animation(reduceMotion ? nil : .easeInOut(duration: 0.3), value: themePhase) } - private var identity: String { (session.snapshot.handle.isEmpty ? "Sign in" : "@" + session.snapshot.handle) + (session.snapshot.code.isEmpty ? "" : "/" + session.snapshot.code) } private var canTalk: Bool { session.workspaceReady && session.engineReady && !session.snapshot.busy && session.capturePhase != .processing } private var talkControl: some View { TimelineView(.animation(minimumInterval: 1 / 30, paused: session.capturePhase != .recording)) { context in diff --git a/apple/walkieware/Walkieware.xcodeproj/project.pbxproj b/apple/walkieware/Walkieware.xcodeproj/project.pbxproj index fdea05e490..04aa189f9f 100644 --- a/apple/walkieware/Walkieware.xcodeproj/project.pbxproj +++ b/apple/walkieware/Walkieware.xcodeproj/project.pbxproj @@ -394,7 +394,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 78; + CURRENT_PROJECT_VERSION = 80; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = FB5948YR3S; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -461,7 +461,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 78; + CURRENT_PROJECT_VERSION = 80; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = FB5948YR3S; ENABLE_NS_ASSERTIONS = NO; diff --git a/apple/walkieware/project.yml b/apple/walkieware/project.yml index 23a06b4932..69607c9817 100644 --- a/apple/walkieware/project.yml +++ b/apple/walkieware/project.yml @@ -9,7 +9,7 @@ settings: CODE_SIGN_STYLE: Automatic SWIFT_VERSION: "5.0" MARKETING_VERSION: "0.1.0" - CURRENT_PROJECT_VERSION: "78" + CURRENT_PROJECT_VERSION: "80" targets: Walkieware: type: application