diff --git a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings index fedb6512..c67338f7 100644 --- a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings @@ -518,6 +518,10 @@ "accessibility.editor.button.drafts" = "Чарнавікі"; "accessibility.editor.button.custom-emojis" = "Уласныя эмодзі"; "accessibility.editor.button.language" = "Мова"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Дадаць уліковы запіс"; "accessibility.app-account.selector.accounts" = "Уліковыя запісы"; diff --git a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings index fa5e0623..816ead3b 100644 --- a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings @@ -512,6 +512,10 @@ "accessibility.editor.button.drafts" = "Drafts"; "accessibility.editor.button.custom-emojis" = "Custom emojis"; "accessibility.editor.button.language" = "Language"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Add account"; "accessibility.app-account.selector.accounts" = "Accounts"; diff --git a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings index 59a22162..a5da44ef 100644 --- a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings @@ -508,6 +508,10 @@ "accessibility.editor.button.drafts" = "Entwürfe"; "accessibility.editor.button.custom-emojis" = "Eigene Emojis"; "accessibility.editor.button.language" = "Sprache"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Konto hinzufügen"; "accessibility.app-account.selector.accounts" = "Konten"; diff --git a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings index f164980c..91e44192 100644 --- a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings @@ -515,7 +515,11 @@ "accessibility.editor.button.drafts" = "Drafts"; "accessibility.editor.button.custom-emojis" = "Custom emojis"; "accessibility.editor.button.language" = "Language"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; "accessibility.tabs.timeline.add-account" = "Add Account"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.app-account.selector.accounts" = "Accounts"; // MARK: Report diff --git a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings index cf8ed8b5..bf10d316 100644 --- a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings @@ -514,6 +514,10 @@ "accessibility.editor.button.drafts" = "Drafts"; "accessibility.editor.button.custom-emojis" = "Custom emojis"; "accessibility.editor.button.language" = "Language"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Add Account"; "accessibility.app-account.selector.accounts" = "Accounts"; diff --git a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings index ce874116..cf7c1d36 100644 --- a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings @@ -514,6 +514,10 @@ "accessibility.editor.button.drafts" = "Borradores"; "accessibility.editor.button.custom-emojis" = "Emojis personalizados"; "accessibility.editor.button.language" = "Idioma"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Añadir cuenta"; "accessibility.app-account.selector.accounts" = "Cuentas"; diff --git a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings index b987a550..4a6aeceb 100644 --- a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings @@ -503,6 +503,10 @@ "accessibility.editor.button.drafts" = "Zirriborroak"; "accessibility.editor.button.custom-emojis" = "Instantziaren emojiak"; "accessibility.editor.button.language" = "Hizkuntza"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Gehitu kontua"; "accessibility.app-account.selector.accounts" = "Kontuak"; diff --git a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings index c4b20f68..3b2fa4fc 100644 --- a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings @@ -509,6 +509,10 @@ "accessibility.editor.button.drafts" = "Brouillons"; "accessibility.editor.button.custom-emojis" = "Emojis personalisés"; "accessibility.editor.button.language" = "Langue"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Ajouter un compte>"; "accessibility.app-account.selector.accounts" = "Comptes"; diff --git a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings index dca6f1c5..18566191 100644 --- a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "Bozze"; "accessibility.editor.button.custom-emojis" = "Emoji personalizzate"; "accessibility.editor.button.language" = "Lingua"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Aggiungi account"; "accessibility.app-account.selector.accounts" = "Account"; diff --git a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings index 54297534..b31267d9 100644 --- a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "下書き"; "accessibility.editor.button.custom-emojis" = "カスタム絵文字"; "accessibility.editor.button.language" = "言語"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "アカウントを追加"; "accessibility.app-account.selector.accounts" = "アカウント"; diff --git a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings index 0ee93922..5b695e36 100644 --- a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings @@ -515,6 +515,10 @@ "accessibility.editor.button.drafts" = "임시 보관함"; "accessibility.editor.button.custom-emojis" = "커스텀 이모지"; "accessibility.editor.button.language" = "글 언어 지정"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "계정 추가"; "accessibility.app-account.selector.accounts" = "계정"; diff --git a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings index 71fa0a9e..546505fa 100644 --- a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "Drafts"; "accessibility.editor.button.custom-emojis" = "Custom emojis"; "accessibility.editor.button.language" = "Language"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Add account"; "accessibility.app-account.selector.accounts" = "Accounts"; diff --git a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings index d8e635d4..614d8dee 100644 --- a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings @@ -510,6 +510,10 @@ "accessibility.editor.button.drafts" = "Concepten"; "accessibility.editor.button.custom-emojis" = "Aangepaste emoji’s"; "accessibility.editor.button.language" = "Taal"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Voeg account toe"; "accessibility.app-account.selector.accounts" = "Accounts"; diff --git a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings index 6dd79b29..9e98b484 100644 --- a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings @@ -505,6 +505,10 @@ "accessibility.editor.button.drafts" = "Wersje robocze"; "accessibility.editor.button.custom-emojis" = "Emotikony własne"; "accessibility.editor.button.language" = "Język"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Dodaj konto"; "accessibility.app-account.selector.accounts" = "Konta"; diff --git a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings index fc650b3f..0913c842 100644 --- a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "Rascunhos"; "accessibility.editor.button.custom-emojis" = "Emojis customizados"; "accessibility.editor.button.language" = "Idioma"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Adicionar conta"; "accessibility.app-account.selector.accounts" = "Contas"; diff --git a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings index 82c7a9f2..5b48209b 100644 --- a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "Drafts"; "accessibility.editor.button.custom-emojis" = "Custom emojis"; "accessibility.editor.button.language" = "Language"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Add account"; "accessibility.app-account.selector.accounts" = "Accounts"; diff --git a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings index 99357e77..4f1236ef 100644 --- a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings @@ -514,6 +514,10 @@ "accessibility.editor.button.drafts" = "Чернетка"; "accessibility.editor.button.custom-emojis" = "Власні emojis"; "accessibility.editor.button.language" = "Мова"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "Додати профіль"; "accessibility.app-account.selector.accounts" = "Профілі"; diff --git a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings index 7da4908e..6079060e 100644 --- a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings @@ -515,6 +515,10 @@ "accessibility.editor.button.drafts" = "草稿"; "accessibility.editor.button.custom-emojis" = "自定义表情"; "accessibility.editor.button.language" = "选择语言"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "添加账户"; "accessibility.app-account.selector.accounts" = "账户"; diff --git a/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings index 6d86fd3f..43d23fd0 100644 --- a/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings @@ -513,6 +513,10 @@ "accessibility.editor.button.drafts" = "草稿"; "accessibility.editor.button.custom-emojis" = "自定表情符號"; "accessibility.editor.button.language" = "語言"; +"accessibility.editor.button.ai-prompt" = "AI prompt"; +"accessibility.editor.button.characters-remaining" = "Characters remaining"; +"accessibility.editor.privacy.label" = "Visibility"; +"accessibility.editor.privacy.hint" = "Changes post audience."; "accessibility.tabs.timeline.add-account" = "新增帳號"; "accessibility.app-account.selector.accounts" = "帳號"; diff --git a/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift b/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift index 41eaa4ff..caba2305 100644 --- a/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift +++ b/Packages/Status/Sources/Status/Editor/Components/StatusEditorAccessoryView.swift @@ -176,6 +176,7 @@ struct StatusEditorAccessoryView: View { ProgressView() } else { Image(systemName: "faxmachine") + .accessibilityLabel("accessibility.editor.button.ai-prompt") } } } @@ -236,13 +237,13 @@ struct StatusEditorAccessoryView: View { NavigationStack { List { ForEach(preferences.draftsPosts, id: \.self) { draft in - Text(draft) - .lineLimit(3) - .listRowBackground(theme.primaryBackgroundColor) - .onTapGesture { - viewModel.insertStatusText(text: draft) - isDraftsSheetDisplayed = false - } + Button { + viewModel.insertStatusText(text: draft) + isDraftsSheetDisplayed = false + } label: { + Text(draft) + .lineLimit(3) + }.listRowBackground(theme.primaryBackgroundColor) } .onDelete { indexes in if let index = indexes.first { @@ -274,10 +275,13 @@ struct StatusEditorAccessoryView: View { .resizable() .aspectRatio(contentMode: .fill) .frame(width: 40, height: 40) + .accessibilityLabel(emoji.shortcode.replacingOccurrences(of: "_", with: " ")) + .accessibilityAddTraits(.isButton) } else if state.isLoading { Rectangle() .fill(Color.gray) .frame(width: 40, height: 40) + .accessibility(hidden: true) .shimmering() } } @@ -300,10 +304,18 @@ struct StatusEditorAccessoryView: View { .presentationDetents([.medium]) } + @ViewBuilder private var characterCountView: some View { - Text("\((currentInstance.instance?.configuration?.statuses.maxCharacters ?? 500) + viewModel.statusTextCharacterLength)") - .foregroundColor(.gray) + let value = (currentInstance.instance?.configuration?.statuses.maxCharacters ?? 500) + viewModel.statusTextCharacterLength + + Text("\(value)") + .foregroundColor(value < 0 ? .red : .secondary) .font(.scaledCallout) + .accessibilityLabel("accessibility.editor.button.characters-remaining") + .accessibilityValue("\(value)") + .accessibilityRemoveTraits(.isStaticText) + .accessibilityAddTraits(.updatesFrequently) + .accessibilityRespondsToUserInteraction(false) } private var recentlyUsedLanguages: [Language] { diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift index f26ad862..bf120800 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift @@ -66,7 +66,7 @@ public struct StatusEditorView: View { } .padding(.top, 8) .padding(.bottom, 40) - } + }.accessibilitySortPriority(1) // Ensure that all elements inside the `ScrollView` occur earlier than the accessory views VStack(alignment: .leading, spacing: 0) { StatusEditorAutoCompleteView(viewModel: viewModel) StatusEditorAccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused, @@ -235,6 +235,7 @@ public struct StatusEditorView: View { } else { AvatarView(url: account.avatar, size: .status) .environmentObject(theme) + .accessibilityHidden(true) } VStack(alignment: .leading, spacing: 4) { privacyMenu @@ -261,6 +262,9 @@ public struct StatusEditorView: View { } label: { HStack { Label(viewModel.visibility.title, systemImage: viewModel.visibility.iconName) + .accessibilityLabel("accessibility.editor.privacy.label") + .accessibilityValue(viewModel.visibility.title) + .accessibilityHint("accessibility.editor.privacy.hint") Image(systemName: "chevron.down") } .font(.scaledFootnote) diff --git a/Packages/Status/Sources/Status/Editor/UITextView/Modifiers.swift b/Packages/Status/Sources/Status/Editor/UITextView/Modifiers.swift index b2ca3763..270f9cce 100644 --- a/Packages/Status/Sources/Status/Editor/UITextView/Modifiers.swift +++ b/Packages/Status/Sources/Status/Editor/UITextView/Modifiers.swift @@ -19,6 +19,7 @@ public extension TextView { var view = self let text = Text(placeholder) view.placeholderView = AnyView(configure(text)) + view.placeholderText = placeholder return view } diff --git a/Packages/Status/Sources/Status/Editor/UITextView/TextView.swift b/Packages/Status/Sources/Status/Editor/UITextView/TextView.swift index 2cf53880..3f3154eb 100644 --- a/Packages/Status/Sources/Status/Editor/UITextView/TextView.swift +++ b/Packages/Status/Sources/Status/Editor/UITextView/TextView.swift @@ -13,6 +13,7 @@ public struct TextView: View { private var getTextView: ((UITextView) -> Void)? var placeholderView: AnyView? + var placeholderText: String? var keyboard: UIKeyboardType = .default /// Makes a new TextView that supports `NSAttributedString` @@ -41,6 +42,7 @@ public struct TextView: View { minHeight: calculatedHeight, maxHeight: calculatedHeight ) + .accessibilityValue($text.wrappedValue.string.isEmpty ? (placeholderText ?? "") : $text.wrappedValue.string) .background( placeholderView? .foregroundColor(Color(.placeholderText)) @@ -48,7 +50,8 @@ public struct TextView: View { .font(.scaledBody) .padding(.horizontal, 0) .padding(.vertical, 0) - .opacity(isEmpty ? 1 : 0), + .opacity(isEmpty ? 1 : 0) + .accessibilityHidden(true), alignment: .topLeading ) }