Compare commits

..

No commits in common. "12be44673a6b84c7edeb92fee804cb2c6c5b9883" and "c84a8e36a0457adcbe8ef8814150d3429d00a32d" have entirely different histories.

2 changed files with 86 additions and 132 deletions

View File

@ -131,9 +131,6 @@
}
}
},
"GIF" : {
"comment" : "Message profile category gifs"
},
"Hello, world!" : {
"localizations" : {
"en" : {
@ -511,9 +508,6 @@
"Глобальный поиск" : {
"comment" : "Global search section"
},
"Голосовые" : {
"comment" : "Message profile category voice"
},
"Голосовые звонки пока недоступны. Как только включим WebRTC, кнопка оживёт." : {
"comment" : "Message profile call action description"
},
@ -528,9 +522,6 @@
}
}
},
"Группы" : {
"comment" : "Message profile category groups"
},
"Данные" : {
"localizations" : {
"en" : {
@ -852,6 +843,9 @@
}
}
},
"История медиа синхронизируется. Как только появятся первые вложения, они покажутся здесь списком превью." : {
"comment" : "Message profile media footer"
},
"Ищем пользователей…" : {
"comment" : "Global search loading"
},
@ -1067,8 +1061,8 @@
"Массовая отчистка" : {
},
"Медиа" : {
"comment" : "Message profile category media"
"Медиа, ссылки и файлы" : {
"comment" : "Message profile media title"
},
"Мессенджер-режим сейчас проработан примерно на 50%." : {
@ -1112,9 +1106,6 @@
}
}
},
"Музыка" : {
"comment" : "Message profile category music"
},
"Мы используем адрес только для ответа на ваш запрос." : {
"comment" : "feedback: email hint",
"localizations" : {
@ -1952,6 +1943,12 @@
"Перейдите в раздел \"Настройки > Сменить пароль\" и следуйте инструкциям." : {
"comment" : "FAQ answer: reset password"
},
"Перестанет появляться в чате и не сможет писать." : {
"comment" : "Message profile block subtitle"
},
"Плитки как в Telegram — скоро здесь появятся вложения из чата." : {
"comment" : "Message profile media description"
},
"По умолчанию это полноценная соцсеть с лентой, историями и подписками. Если нужно только общение без лишнего контента, переключитесь на режим “Только чаты”. Переключить режим можно в любой момент." : {
},
@ -2122,6 +2119,9 @@
}
}
},
"Пользователь снова сможет писать вам." : {
"comment" : "Message profile unblock subtitle"
},
"Пользователь удалён" : {
"comment" : "Message profile deleted user status"
},
@ -2151,9 +2151,6 @@
"Последний вход: %@" : {
"comment" : "Дата последнего входа в сессию"
},
"Посты" : {
"comment" : "Message profile category posts"
},
"Похвала" : {
"comment" : "feedback category: praise",
"localizations" : {
@ -2168,6 +2165,9 @@
"Появится мутация на 1 час, 1 день или навсегда." : {
"comment" : "Message profile mute action description"
},
"Появится отдельная запись в адресной книге Yobble." : {
"comment" : "Message profile add to contacts subtitle"
},
"Правила сервиса" : {
},
@ -2392,12 +2392,6 @@
"Разблокировать" : {
"comment" : "Message profile unblock alert title\nMessage profile unblock title\nUnblock confirmation action"
},
"Раздел скоро станет активным — собираем и индексируем вложения." : {
"comment" : "Message profile media placeholder message"
},
"Разделы временно показывают заглушки — позже спрячем пустые категории." : {
"comment" : "Message profile media footer new"
},
"Разрешить пересылку сообщений" : {
"localizations" : {
"en" : {
@ -2715,9 +2709,6 @@
},
"Сохранение..." : {
},
"Сохранённые" : {
"comment" : "Message profile category saved"
},
"Сохраните секретный ключ и введите код из приложения, чтобы завершить настройку." : {
"comment" : "Сообщение после активации 2FA"
@ -2760,9 +2751,6 @@
}
}
},
"Ссылки" : {
"comment" : "Message profile category links"
},
"Старый пароль" : {
"comment" : "Старый пароль",
"localizations" : {
@ -2919,9 +2907,6 @@
}
}
},
"Файлы" : {
"comment" : "Message profile category files"
},
"Функция пока недоступна." : {
"comment" : "Сообщение заглушки"
},

View File

@ -232,11 +232,6 @@ struct MessageProfileView: View {
title: NSLocalizedString("Юзернейм", comment: ""),
value: login
)
}else{
infoRow(
title: NSLocalizedString("Юзернейм", comment: ""),
value: "Неизвестный пользователь"
)
}
if let membership = membershipDescription {
@ -258,23 +253,31 @@ struct MessageProfileView: View {
if shouldShowRelationshipQuickActions {
rowDivider
filledActionButton(
title: NSLocalizedString("Добавить в контакты", comment: "Message profile add to contacts title"),
tint: Color.accentColor
) {
handleAddContactTap()
}
rowDivider
filledActionButton(
title: isBlockedByCurrentUser
? NSLocalizedString("Разблокировать", comment: "Message profile unblock title")
: NSLocalizedString("Заблокировать", comment: "Message profile block title"),
tint: isBlockedByCurrentUser ? Color.green : Color.red
) {
handleBlockToggleTap()
}
VStack(spacing: 8) {
buttonRow(
icon: "person.badge.plus",
title: NSLocalizedString("Добавить в контакты", comment: "Message profile add to contacts title"),
subtitle: NSLocalizedString("Появится отдельная запись в адресной книге Yobble.", comment: "Message profile add to contacts subtitle"),
iconTint: .accentColor
) {
handleAddContactTap()
}
buttonRow(
icon: "hand.raised.slash.fill",
title: isBlockedByCurrentUser
? NSLocalizedString("Разблокировать", comment: "Message profile unblock title")
: NSLocalizedString("Заблокировать", comment: "Message profile block title"),
subtitle: isBlockedByCurrentUser
? NSLocalizedString("Пользователь снова сможет писать вам.", comment: "Message profile unblock subtitle")
: NSLocalizedString("Перестанет появляться в чате и не сможет писать.", comment: "Message profile block subtitle"),
iconTint: .red,
destructive: true
) {
handleBlockToggleTap()
}
}
.padding(.top, 4)
}
}
@ -332,20 +335,34 @@ struct MessageProfileView: View {
}
private var mediaPreviewSection: some View {
VStack(alignment: .leading, spacing: 12) {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 12) {
ForEach(mediaCategories) { category in
mediaCategoryButton(category)
section(
title: NSLocalizedString("Медиа, ссылки и файлы", comment: "Message profile media title"),
description: NSLocalizedString("Плитки как в Telegram — скоро здесь появятся вложения из чата.", comment: "Message profile media description")
) {
card {
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 8), count: 3), spacing: 8) {
ForEach(Array(sharedMediaPlaceholderIcons.enumerated()), id: \.offset) { index, icon in
RoundedRectangle(cornerRadius: 16, style: .continuous)
.fill(sharedMediaPlaceholderColors[index % sharedMediaPlaceholderColors.count])
.frame(height: 72)
.overlay(
Image(systemName: icon)
.font(.system(size: 20, weight: .semibold))
.foregroundColor(.white.opacity(0.9))
)
.overlay(
RoundedRectangle(cornerRadius: 16, style: .continuous)
.stroke(Color.white.opacity(0.18), lineWidth: 1)
)
}
}
.padding(.vertical, 4)
}
.frame(maxWidth: .infinity)
Text(NSLocalizedString("Разделы временно показывают заглушки.", comment: "Message profile media footer new"))
.font(.caption)
.foregroundColor(.secondary)
Text(NSLocalizedString("История медиа синхронизируется. Как только появятся первые вложения, они покажутся здесь списком превью.", comment: "Message profile media footer"))
.font(.caption)
.foregroundColor(.secondary)
.padding(.top, 12)
}
}
}
@ -461,30 +478,6 @@ struct MessageProfileView: View {
.buttonStyle(.plain)
}
private func filledActionButton(
title: String,
subtitle: String? = nil,
tint: Color,
action: @escaping () -> Void
) -> some View {
Button(action: action) {
VStack(alignment: .leading, spacing: 4) {
Text(title)
.font(.body)
.fontWeight(.semibold)
if let subtitle {
Text(subtitle)
.font(.caption)
.foregroundColor(tint.opacity(0.7))
}
}
.foregroundColor(tint)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.vertical, 10)
}
.buttonStyle(.plain)
}
private func iconBackground<Content: View>(color: Color, @ViewBuilder content: () -> Content) -> some View {
RoundedRectangle(cornerRadius: 14, style: .continuous)
.fill(color)
@ -520,20 +513,6 @@ struct MessageProfileView: View {
showPlaceholderAction(title: title, message: message)
}
private var mediaCategories: [MediaCategory] {
[
MediaCategory(title: NSLocalizedString("Медиа", comment: "Message profile category media")),
MediaCategory(title: NSLocalizedString("Сохранённые", comment: "Message profile category saved")),
MediaCategory(title: NSLocalizedString("Файлы", comment: "Message profile category files")),
MediaCategory(title: NSLocalizedString("Голосовые", comment: "Message profile category voice")),
MediaCategory(title: NSLocalizedString("Ссылки", comment: "Message profile category links")),
MediaCategory(title: NSLocalizedString("Группы", comment: "Message profile category groups")),
MediaCategory(title: NSLocalizedString("Музыка", comment: "Message profile category music")),
MediaCategory(title: NSLocalizedString("GIF", comment: "Message profile category gifs")),
MediaCategory(title: NSLocalizedString("Посты", comment: "Message profile category posts"))
]
}
// MARK: - Derived Data
private var profileBio: String? {
@ -685,31 +664,26 @@ struct MessageProfileView: View {
return tags
}
private func mediaCategoryButton(_ category: MediaCategory) -> some View {
Button {
showPlaceholderAction(
title: category.title,
message: NSLocalizedString("Раздел скоро станет активным — собираем и индексируем вложения.", comment: "Message profile media placeholder message")
)
} label: {
VStack(alignment: .leading, spacing: 6) {
Text(category.title)
.font(.footnote)
.fontWeight(.medium)
.foregroundColor(.primary)
}
.padding(.vertical, 12)
.padding(.horizontal, 14)
.background(
RoundedRectangle(cornerRadius: 20, style: .continuous)
.fill(Color(UIColor.secondarySystemBackground))
)
.overlay(
RoundedRectangle(cornerRadius: 20, style: .continuous)
.stroke(Color(UIColor.separator).opacity(0.2), lineWidth: 1)
)
}
.buttonStyle(.plain)
private var sharedMediaPlaceholderIcons: [String] {
[
"photo.on.rectangle",
"doc.text.fill",
"link",
"paperclip",
"music.note",
"video.fill"
]
}
private var sharedMediaPlaceholderColors: [Color] {
[
Color.accentColor.opacity(0.8),
Color.purple.opacity(0.8),
Color.blue.opacity(0.7),
Color.orange.opacity(0.8),
Color.green.opacity(0.7),
Color.pink.opacity(0.8)
]
}
private var quickActionItems: [ProfileQuickAction] {
@ -922,11 +896,6 @@ private struct StatusTag: Identifiable {
let tint: Color
}
private struct MediaCategory: Identifiable {
let id = UUID()
let title: String
}
private struct ProfileQuickAction: Identifiable {
let id = UUID()
let icon: String