From df2b7881c4c54f0dae23644ae817a85278587aa6 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Mon, 1 Sep 2025 19:37:59 -0700 Subject: [PATCH] WIP --- Sources/Packages/Localizable.xcstrings | 280 +++++++++--------- Sources/Secretive/Views/AgentStatusView.swift | 8 +- .../Secretive/Views/IntegrationsView.swift | 36 +-- Sources/Secretive/Views/SetupView.swift | 32 +- 4 files changed, 182 insertions(+), 174 deletions(-) diff --git a/Sources/Packages/Localizable.xcstrings b/Sources/Packages/Localizable.xcstrings index f8b9d5b..3b0a602 100644 --- a/Sources/Packages/Localizable.xcstrings +++ b/Sources/Packages/Localizable.xcstrings @@ -2604,9 +2604,6 @@ } } } - }, - "Done" : { - }, "edit_cancel_button" : { "extractionState" : "manual", @@ -3179,6 +3176,17 @@ } } }, + "integrations_getting_started_multiple_config" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "You can configure more than one tool, they generally won't interfere with each other." + } + } + } + }, "integrations_getting_started_row_title" : { "extractionState" : "manual", "localizations" : { @@ -3201,6 +3209,83 @@ } } }, + "integrations_getting_started_suggestion_git" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you're trying to sign your git commits, set up Git Signing." + } + } + } + }, + "integrations_getting_started_suggestion_shell" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you're trying to configure anything your command line runs to use Secretive, configure your shell." + } + } + } + }, + "integrations_getting_started_suggestion_shell_default" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you don't known what shell you use and haven't changed it, you're probably using `%(shellName)@`." + } + } + } + }, + "integrations_getting_started_suggestion_ssh" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you're trying to authenticate with an SSH server or authenticating with a service like GitHub over SSH, configure your SSH client." + } + } + } + }, + "integrations_getting_started_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Configuring Tools for Secretive" + } + } + } + }, + "integrations_getting_started_title_description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Most tools will try and look for SSH keys on disk in `~/.ssh`. To use Secretive, we need to configure those tools to talk to Secretive instead." + } + } + } + }, + "integrations_getting_started_what_should_i_configure_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "What Should I Configure?" + } + } + } + }, "integrations_other_section_title" : { "extractionState" : "manual", "localizations" : { @@ -3520,138 +3605,6 @@ } } }, - "onboarding_done_button" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Done" - } - } - } - }, - "onboarding_getting_started_multiple_config" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "You can configure more than one tool, they generally won't interfere with each other." - } - } - } - }, - "onboarding_getting_started_suggestion_git" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "If you're trying to sign your git commits, set up Git Signing." - } - } - } - }, - "onboarding_getting_started_suggestion_shell" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "If you're trying to configure anything your command line runs to use Secretive, configure your shell." - } - } - } - }, - "onboarding_getting_started_suggestion_shell_default" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "If you don't known what shell you use and haven't changed it, you're probably using `%(shellName)@`." - } - } - } - }, - "onboarding_getting_started_suggestion_ssh" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "If you're trying to authenticate with an SSH server or authenticating with a service like GitHub over SSH, configure your SSH client." - } - } - } - }, - "onboarding_getting_started_title" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Configuring Tools for Secretive" - } - } - } - }, - "onboarding_getting_started_title_description" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Most tools will try and look for SSH keys on disk in `~/.ssh`. To use Secretive, we need to configure those tools to talk to Secretive instead." - } - } - } - }, - "onboarding_getting_started_what_should_i_configure_title" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "What Should I Configure?" - } - } - } - }, - "onboarding_integrations_button" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Configure" - } - } - } - }, - "onboarding_integrations_description" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Tell the tools you use how to talk to Secretive." - } - } - } - }, - "onboarding_integrations_title" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Configure Integrations" - } - } - } - }, "persist_authentication_accept_button" : { "comment" : "When the user authorizes an action using a secret that requires unlock, they're shown a notification offering to leave the secret unlocked for a set period of time. This is the title for the notification.", "extractionState" : "manual", @@ -4610,6 +4563,50 @@ } } }, + "setup_done_button" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Done" + } + } + } + }, + "setup_integrations_button" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Configure" + } + } + } + }, + "setup_integrations_description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tell the tools you use how to talk to Secretive." + } + } + } + }, + "setup_integrations_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Configure Integrations" + } + } + } + }, "setup_ssh_add_for_me_button" : { "extractionState" : "manual", "localizations" : { @@ -5184,7 +5181,7 @@ } } }, - "setup_updates_ok" : { + "setup_updates_ok_button" : { "extractionState" : "manual", "localizations" : { "ca" : { @@ -5397,6 +5394,17 @@ } } }, + "setupStepCompleteButton" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Done" + } + } + } + }, "signed_notification_description" : { "comment" : "When the user performs an action using a secret, they're shown a notification describing what happened. This is the description, showing which secret was used. The placeholder is the name of the secret.", "extractionState" : "manual", diff --git a/Sources/Secretive/Views/AgentStatusView.swift b/Sources/Secretive/Views/AgentStatusView.swift index 082eccf..d89fca9 100644 --- a/Sources/Secretive/Views/AgentStatusView.swift +++ b/Sources/Secretive/Views/AgentStatusView.swift @@ -22,22 +22,22 @@ struct AgentRunningView: View { Section { if let process = agentStatusChecker.process { ConfigurationItemView( - title: LocalizedStringResource.agentDetailsLocationTitle, + title: .agentDetailsLocationTitle, value: process.bundleURL!.path(), action: .revealInFinder(process.bundleURL!.path()), ) ConfigurationItemView( - title: LocalizedStringResource.agentDetailsSocketPathTitle, + title: .agentDetailsSocketPathTitle, value: socketPath, action: .copy(socketPath), ) ConfigurationItemView( - title: LocalizedStringResource.agentDetailsVersionTitle, + title: .agentDetailsVersionTitle, value: Bundle(url: process.bundleURL!)!.infoDictionary!["CFBundleShortVersionString"] as! String ) if let launchDate = process.launchDate { ConfigurationItemView( - title: LocalizedStringResource.agentDetailsRunningSinceTitle, + title: .agentDetailsRunningSinceTitle, value: launchDate.formatted() ) } diff --git a/Sources/Secretive/Views/IntegrationsView.swift b/Sources/Secretive/Views/IntegrationsView.swift index 1e07ec1..79781dc 100644 --- a/Sources/Secretive/Views/IntegrationsView.swift +++ b/Sources/Secretive/Views/IntegrationsView.swift @@ -23,7 +23,7 @@ struct IntegrationsView: View { } detail: { IntegrationsDetailView(selectedInstruction: $selectedInstruction) .fauxToolbar { - Button(.onboardingDoneButton) { + Button(.setupDoneButton) { dismiss() } .normalButton() @@ -80,24 +80,24 @@ struct IntegrationsDetailView: View { switch selectedInstruction.id { case .gettingStarted: Form { - Section(.onboardingGettingStartedTitle) { - Text(.onboardingGettingStartedTitleDescription) + Section(.integrationsGettingStartedTitle) { + Text(.integrationsGettingStartedTitleDescription) } Section { Group { - Text(.onboardingGettingStartedSuggestionSsh) + Text(.integrationsGettingStartedSuggestionSsh) .onTapGesture { self.selectedInstruction = instructions.ssh } VStack(alignment: .leading, spacing: 5) { - Text(.onboardingGettingStartedSuggestionShell) - Text(.onboardingGettingStartedSuggestionShellDefault(shellName: instructions.defaultShell.tool)) + Text(.integrationsGettingStartedSuggestionShell) + Text(.integrationsGettingStartedSuggestionShellDefault(shellName: instructions.defaultShell.tool)) .font(.caption2) } .onTapGesture { self.selectedInstruction = instructions.defaultShell } - Text(.onboardingGettingStartedSuggestionGit) + Text(.integrationsGettingStartedSuggestionGit) .onTapGesture { self.selectedInstruction = instructions.git } @@ -105,10 +105,10 @@ struct IntegrationsDetailView: View { .foregroundStyle(.link) } header: { - Text(.onboardingGettingStartedWhatShouldIConfigureTitle) + Text(.integrationsGettingStartedWhatShouldIConfigureTitle) } footer: { - Text(.onboardingGettingStartedMultipleConfig) + Text(.integrationsGettingStartedMultipleConfig) } } .formStyle(.grouped) @@ -116,9 +116,9 @@ struct IntegrationsDetailView: View { Form { ForEach(selectedInstruction.steps) { stepGroup in Section { - ConfigurationItemView(title: LocalizedStringResource.integrationsPathTitle, value: stepGroup.path, action: .revealInFinder(stepGroup.path)) + ConfigurationItemView(title: .integrationsPathTitle, value: stepGroup.path, action: .revealInFinder(stepGroup.path)) ForEach(stepGroup.steps, id: \.self) { step in - ConfigurationItemView(title: LocalizedStringResource.integrationsAddThisTitle, action: .copy(step)) { + ConfigurationItemView(title: .integrationsAddThisTitle, action: .copy(step)) { HStack { Text(step) .padding(8) @@ -190,7 +190,7 @@ private struct Instructions { zsh } - var gettingStarted: ConfigurationFileInstructions = ConfigurationFileInstructions(LocalizedStringResource.integrationsGettingStartedRowTitle, id: .gettingStarted) + var gettingStarted: ConfigurationFileInstructions = ConfigurationFileInstructions(.integrationsGettingStartedRowTitle, id: .gettingStarted) var ssh: ConfigurationFileInstructions { ConfigurationFileInstructions( @@ -243,17 +243,17 @@ private struct Instructions { var instructions: [ConfigurationGroup] { [ - ConfigurationGroup(name: LocalizedStringResource.integrationsGettingStartedSectionTitle, instructions: [ + ConfigurationGroup(name: .integrationsGettingStartedSectionTitle, instructions: [ gettingStarted ]), ConfigurationGroup( - name: LocalizedStringResource.integrationsSystemSectionTitle, + name: .integrationsSystemSectionTitle, instructions: [ ssh, git, ] ), - ConfigurationGroup(name: LocalizedStringResource.integrationsShellSectionTitle, instructions: [ + ConfigurationGroup(name: .integrationsShellSectionTitle, instructions: [ zsh, ConfigurationFileInstructions( tool: "bash", @@ -265,10 +265,10 @@ private struct Instructions { configPath: "~/.config/fish/config.fish", configText: "set -x SSH_AUTH_SOCK \(socketPath)" ), - ConfigurationFileInstructions(LocalizedStringResource.integrationsOtherShellRowTitle, id: .otherShell), + ConfigurationFileInstructions(.integrationsOtherShellRowTitle, id: .otherShell), ]), - ConfigurationGroup(name: LocalizedStringResource.integrationsOtherSectionTitle, instructions: [ - ConfigurationFileInstructions(LocalizedStringResource.integrationsAppsRowTitle, id: .otherApp), + ConfigurationGroup(name: .integrationsOtherSectionTitle, instructions: [ + ConfigurationFileInstructions(.integrationsAppsRowTitle, id: .otherApp), ]), ] } diff --git a/Sources/Secretive/Views/SetupView.swift b/Sources/Secretive/Views/SetupView.swift index 5e52ebf..9a49930 100644 --- a/Sources/Secretive/Views/SetupView.swift +++ b/Sources/Secretive/Views/SetupView.swift @@ -19,12 +19,12 @@ struct SetupView: View { VStack { VStack(alignment: .leading, spacing: 0) { StepView( - title: "setup_agent_title", - description: "setup_agent_description", + title: .setupAgentTitle, + description: .setupAgentDescription, systemImage: "lock.laptopcomputer", ) { - OnboardingButton( - "setup_agent_install_button", + setupButton( + .setupAgentInstallButton, complete: installed, width: buttonWidth ) { @@ -36,12 +36,12 @@ struct SetupView: View { } Divider() StepView( - title: "setup_updates_title", - description: "setup_updates_description", + title: .setupUpdatesTitle, + description: .setupUpdatesDescription, systemImage: "network.badge.shield.half.filled", ) { - OnboardingButton( - "setup_updates_ok", + setupButton( + .setupUpdatesOkButton, complete: updates, width: buttonWidth ) { @@ -50,12 +50,12 @@ struct SetupView: View { } Divider() StepView( - title: .onboardingIntegrationsTitle, - description: LocalizedStringResource.onboardingIntegrationsDescription, + title: .setupIntegrationsTitle, + description: .setupIntegrationsDescription, systemImage: "firewall", ) { - OnboardingButton( - LocalizedStringResource.onboardingIntegrationsButton, + setupButton( + .setupIntegrationsButton, complete: integrations, width: buttonWidth ) { @@ -63,14 +63,14 @@ struct SetupView: View { } } } - .onPreferenceChange(OnboardingButton.WidthKey.self) { width in + .onPreferenceChange(setupButton.WidthKey.self) { width in buttonWidth = width } .background(.white.opacity(0.1), in: RoundedRectangle(cornerRadius: 10)) .frame(minWidth: 700, maxWidth: .infinity) HStack { Spacer() - Button(.onboardingDoneButton) { + Button(.setupDoneButton) { setupComplete = true dismiss() } @@ -88,7 +88,7 @@ struct SetupView: View { } } -struct OnboardingButton: View { +struct setupButton: View { struct WidthKey: @MainActor PreferenceKey { @MainActor static var defaultValue: CGFloat? = nil @@ -117,7 +117,7 @@ struct OnboardingButton: View { Button(action: action) { HStack(spacing: 6) { if complete { - Text("Done") + Text(.setupStepCompleteButton) Image(systemName: "checkmark.circle.fill") } else { Text(label)