Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ val viewModelsModule =
apkInspector = get(),
authenticationState = get(),
systemInstallSerializer = get(),
profileRepository = get(),
)
}
viewModelOf(::DeveloperProfileViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"Ignore updates per app — silence the update badge for any app you don't want to update.",
"Skip a specific update — dismiss a single release if it's a false-positive prompt; you'll be re-notified when a newer one lands.",
"Silent install via root — Magisk, KernelSU, and APatch users can now install without Shizuku or Dhizuku.",
"Search in Starred and Favourites — quickly filter long lists by repo name, owner, description, or language."
"Search in Starred and Favourites — quickly filter long lists by repo name, owner, description, or language.",
"Self-owned ✓ badge — when you're signed in, repos you own get a verified checkmark on Home and Search cards."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@
<string name="clear_seen_history_description">إعادة تعيين جميع المستودعات المشاهَدة لتظهر مجدداً في الخلاصات</string>
<string name="seen_history_cleared">تم مسح سجل المشاهدة</string>
<string name="seen_badge">تمت المشاهدة</string>
<string name="self_owned_badge">هذا المستودع لك</string>
<string name="privacy_section">الخصوصية</string>
<string name="telemetry_title">ساعد في تحسين البحث</string>
<string name="telemetry_description">مشاركة بيانات الاستخدام (عمليات البحث والتثبيتات والتفاعلات) المرتبطة بمعرّف تحليلي قابل لإعادة التعيين. لا تتم مشاركة تفاصيل الحساب.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@
<string name="clear_seen_history_description">সমস্ত দেখা রিপোজিটরি রিসেট করুন যাতে সেগুলো ফিডে আবার দেখা যায়</string>
<string name="seen_history_cleared">দেখার ইতিহাস মুছে ফেলা হয়েছে</string>
<string name="seen_badge">দেখা হয়েছে</string>
<string name="self_owned_badge">এই রিপো আপনার</string>
<string name="privacy_section">গোপনীয়তা</string>
<string name="telemetry_title">অনুসন্ধান উন্নত করতে সহায়তা করুন</string>
<string name="telemetry_description">পুনরায় সেট করা যায় এমন একটি বিশ্লেষণ আইডির সাথে যুক্ত ব্যবহার ডেটা (অনুসন্ধান, ইনস্টল, ইন্টারঅ্যাকশন) শেয়ার করুন। অ্যাকাউন্ট বিবরণ শেয়ার করা হয় না।</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
<string name="clear_seen_history_description">Restablecer todos los repositorios vistos para que aparezcan de nuevo en las fuentes</string>
<string name="seen_history_cleared">Historial de vistos borrado</string>
<string name="seen_badge">Visto</string>
<string name="self_owned_badge">Eres dueño de este repo</string>
<string name="privacy_section">Privacidad</string>
<string name="telemetry_title">Ayudar a mejorar la búsqueda</string>
<string name="telemetry_description">Compartir datos de uso (búsquedas, instalaciones, interacciones) asociados a un ID de análisis restablecible. No se comparten detalles de la cuenta.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@
<string name="clear_seen_history_description">Réinitialiser tous les dépôts consultés pour qu'ils réapparaissent dans les flux</string>
<string name="seen_history_cleared">Historique des consultations effacé</string>
<string name="seen_badge">Consulté</string>
<string name="self_owned_badge">Vous possédez ce dépôt</string>
<string name="privacy_section">Confidentialité</string>
<string name="telemetry_title">Aider à améliorer la recherche</string>
<string name="telemetry_description">Partager des données d'utilisation (recherches, installations, interactions) associées à un identifiant d'analyse réinitialisable. Aucun détail de compte n'est partagé.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@
<string name="clear_seen_history_description">सभी देखे गए रिपॉजिटरी रीसेट करें ताकि वे फ़ीड में फिर से दिखें</string>
<string name="seen_history_cleared">देखने का इतिहास साफ़ किया गया</string>
<string name="seen_badge">देखा गया</string>
<string name="self_owned_badge">यह रेपो आपका है</string>
<string name="privacy_section">गोपनीयता</string>
<string name="telemetry_title">खोज को बेहतर बनाने में मदद करें</string>
<string name="telemetry_description">रीसेट करने योग्य एनालिटिक्स आईडी से जुड़े उपयोग डेटा (खोज, इंस्टॉल, इंटरैक्शन) साझा करें। खाता विवरण साझा नहीं किए जाते।</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@
<string name="clear_seen_history_description">Reimposta tutti i repository visualizzati in modo che ricompaiano nei feed</string>
<string name="seen_history_cleared">Cronologia visualizzazioni cancellata</string>
<string name="seen_badge">Visualizzato</string>
<string name="self_owned_badge">Sei il proprietario di questo repo</string>
<string name="privacy_section">Privacy</string>
<string name="telemetry_title">Aiuta a migliorare la ricerca</string>
<string name="telemetry_description">Condividi dati di utilizzo (ricerche, installazioni, interazioni) associati a un ID analitico ripristinabile. Nessun dettaglio dell'account viene condiviso.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@
<string name="clear_seen_history_description">すべての閲覧済みリポジトリをリセットしてフィードに再表示します</string>
<string name="seen_history_cleared">閲覧履歴をクリアしました</string>
<string name="seen_badge">閲覧済み</string>
<string name="self_owned_badge">あなたが所有するリポジトリ</string>
<string name="privacy_section">プライバシー</string>
<string name="telemetry_title">検索の改善に協力</string>
<string name="telemetry_description">リセット可能な分析 ID に関連付けられた使用データ(検索、インストール、操作)を共有します。アカウント情報は共有されません。</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@
<string name="clear_seen_history_description">모든 조회 기록을 초기화하여 피드에 다시 표시합니다</string>
<string name="seen_history_cleared">조회 기록이 삭제되었습니다</string>
<string name="seen_badge">확인함</string>
<string name="self_owned_badge">내가 소유한 저장소</string>
<string name="privacy_section">개인 정보 보호</string>
<string name="telemetry_title">검색 개선에 도움 주기</string>
<string name="telemetry_description">재설정 가능한 분석 ID에 연결된 사용 데이터(검색, 설치, 상호작용)를 공유합니다. 계정 정보는 공유되지 않습니다.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@
<string name="clear_seen_history_description">Zresetuj wszystkie przeglądane repozytoria, aby ponownie pojawiły się w kanałach</string>
<string name="seen_history_cleared">Historia przeglądania wyczyszczona</string>
<string name="seen_badge">Przeglądane</string>
<string name="self_owned_badge">Jesteś właścicielem tego repo</string>
<string name="privacy_section">Prywatność</string>
<string name="telemetry_title">Pomóż ulepszyć wyszukiwanie</string>
<string name="telemetry_description">Udostępniaj dane o użyciu (wyszukiwania, instalacje, interakcje) powiązane z resetowalnym identyfikatorem analitycznym. Żadne dane konta nie są udostępniane.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@
<string name="clear_seen_history_description">Сбросить все просмотренные репозитории, чтобы они снова появились в лентах</string>
<string name="seen_history_cleared">История просмотров очищена</string>
<string name="seen_badge">Просмотрено</string>
<string name="self_owned_badge">Ваш репозиторий</string>
<string name="privacy_section">Конфиденциальность</string>
<string name="telemetry_title">Помочь улучшить поиск</string>
<string name="telemetry_description">Отправлять данные об использовании (поиски, установки, взаимодействия), связанные со сбрасываемым идентификатором аналитики. Данные учётной записи не передаются.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@
<string name="clear_seen_history_description">Tüm görüntülenen depoları sıfırlayarak akışlarda tekrar görünmelerini sağlayın</string>
<string name="seen_history_cleared">Görüntüleme geçmişi temizlendi</string>
<string name="seen_badge">Görüntülendi</string>
<string name="self_owned_badge">Bu deponun sahibisin</string>
<string name="privacy_section">Gizlilik</string>
<string name="telemetry_title">Aramayı iyileştirmeye yardım et</string>
<string name="telemetry_description">Sıfırlanabilir bir analiz kimliğiyle ilişkilendirilmiş kullanım verilerini (aramalar, yüklemeler, etkileşimler) paylaş. Hesap ayrıntıları paylaşılmaz.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@
<string name="clear_seen_history_description">重置所有已浏览的仓库,使其重新出现在信息流中</string>
<string name="seen_history_cleared">浏览记录已清除</string>
<string name="seen_badge">已浏览</string>
<string name="self_owned_badge">你拥有此仓库</string>
<string name="privacy_section">隐私</string>
<string name="telemetry_title">帮助改进搜索</string>
<string name="telemetry_description">分享与可重置分析 ID 关联的使用数据(搜索、安装、交互)。不分享账户详情。</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@
<string name="clear_seen_history_description">Reset all seen repositories so they appear again in feeds</string>
<string name="seen_history_cleared">Seen history cleared</string>
<string name="seen_badge">Viewed</string>
<string name="self_owned_badge">You own this repo</string>

<!-- Privacy / telemetry -->
<string name="privacy_section">Privacy</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.CallSplit
import androidx.compose.material.icons.filled.CheckCircle
import androidx.compose.material.icons.filled.Verified
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.OpenInBrowser
import androidx.compose.material.icons.filled.Share
Expand Down Expand Up @@ -63,6 +64,7 @@ import zed.rainxch.githubstore.core.presentation.res.home_view_details
import zed.rainxch.githubstore.core.presentation.res.installed
import zed.rainxch.githubstore.core.presentation.res.open_in_browser
import zed.rainxch.githubstore.core.presentation.res.seen_badge
import zed.rainxch.githubstore.core.presentation.res.self_owned_badge
import zed.rainxch.githubstore.core.presentation.res.share_repository
import zed.rainxch.githubstore.core.presentation.res.update_available

Expand Down Expand Up @@ -150,7 +152,12 @@ fun RepositoryCard(
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false),
)

if (discoveryRepositoryUi.isCurrentUserOwner) {
OfficialBadge()
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
}

Text(
Expand Down Expand Up @@ -455,6 +462,16 @@ fun InstallStatusBadge(
}
}

@Composable
fun OfficialBadge(modifier: Modifier = Modifier) {
Icon(
imageVector = Icons.Filled.Verified,
contentDescription = stringResource(Res.string.self_owned_badge),
modifier = modifier.size(16.dp),
tint = MaterialTheme.colorScheme.primary,
)
}

@Composable
fun SeenBadge(modifier: Modifier = Modifier) {
Surface(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ data class DiscoveryRepositoryUi(
val isFavourite: Boolean,
val isStarred: Boolean,
val isSeen: Boolean = false,
val isCurrentUserOwner: Boolean = false,
val repository: GithubRepoSummaryUi,
)
1 change: 1 addition & 0 deletions feature/details/presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ kotlin {
implementation(projects.core.domain)
implementation(projects.core.presentation)
implementation(projects.feature.details.domain)
implementation(projects.feature.profile.domain)

implementation(libs.markdown.renderer)
implementation(libs.markdown.renderer.coil3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import zed.rainxch.details.presentation.model.TranslationTarget

data class DetailsState(
val isLoading: Boolean = true,
val isCurrentUserOwner: Boolean = false,
val isRefreshing: Boolean = false,
val refreshCooldownUntilEpochMs: Long? = null,
val errorMessage: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.receiveAsFlow
import kotlinx.coroutines.flow.stateIn
Expand Down Expand Up @@ -128,6 +130,7 @@ class DetailsViewModel(
private val apkInspector: ApkInspector,
private val authenticationState: zed.rainxch.core.domain.repository.AuthenticationState,
private val systemInstallSerializer: zed.rainxch.core.domain.system.SystemInstallSerializer,
private val profileRepository: zed.rainxch.profile.domain.repository.ProfileRepository,
) : ViewModel() {
private var hasLoadedInitialData = false
private var currentDownloadJob: Job? = null
Expand All @@ -142,6 +145,7 @@ class DetailsViewModel(
if (!hasLoadedInitialData) {
loadInitial()
observeApkInspectCoachmark()
observeCurrentUserForBadge()

hasLoadedInitialData = true
}
Expand Down Expand Up @@ -804,6 +808,25 @@ class DetailsViewModel(
* the pulse would render at the exact moment the system install
* prompt is up, which is the user's peak-attention frame.
*/
// Reactively flips `isCurrentUserOwner` whenever either the signed-in
// user changes (login/logout/switch-account) or the loaded repository
// owner login arrives. Avoids touching every repo-assignment site.
private fun observeCurrentUserForBadge() {
viewModelScope.launch {
combine(
profileRepository.getUser(),
_state
.map { it.repository?.owner?.login }
.distinctUntilChanged(),
) { user, ownerLogin ->
val login = user?.username
login != null && ownerLogin != null && ownerLogin.equals(login, ignoreCase = true)
}.collect { isOwner ->
_state.update { it.copy(isCurrentUserOwner = isOwner) }
}
}
}

private fun observeApkInspectCoachmark() {
viewModelScope.launch {
val alreadyShown =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import zed.rainxch.core.domain.model.GithubUserProfile
import zed.rainxch.core.domain.model.InstalledApp
import zed.rainxch.core.domain.util.VersionMath
import zed.rainxch.core.presentation.components.ForkBadge
import zed.rainxch.core.presentation.components.OfficialBadge
import zed.rainxch.core.presentation.components.PlatformChip
import zed.rainxch.core.presentation.utils.formatReleasedAt
import zed.rainxch.details.presentation.model.DownloadStage
Expand All @@ -70,6 +71,7 @@ fun AppHeader(
modifier: Modifier = Modifier,
downloadStage: DownloadStage = DownloadStage.IDLE,
downloadProgress: Int? = null,
isCurrentUserOwner: Boolean = false,
) {
val animatedProgress by animateFloatAsState(
targetValue = (downloadProgress ?: 0) / 100f,
Expand Down Expand Up @@ -174,13 +176,23 @@ fun AppHeader(
}
}
author?.login?.let { author ->
Text(
text = stringResource(Res.string.by_author, author),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.primary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(6.dp),
) {
Text(
text = stringResource(Res.string.by_author, author),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.primary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false),
)

if (isCurrentUserOwner) {
OfficialBadge()
}
}
}

Spacer(Modifier.height(8.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fun LazyListScope.header(
installedApp = state.installedApp,
downloadStage = state.downloadStage,
downloadProgress = state.downloadProgressPercent,
isCurrentUserOwner = state.isCurrentUserOwner,
)
}
}
Expand Down
1 change: 1 addition & 0 deletions feature/favourites/presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ kotlin {
implementation(projects.core.domain)
implementation(projects.core.presentation)
implementation(projects.feature.favourites.domain)
implementation(projects.feature.profile.domain)

implementation(libs.bundles.landscapist)
implementation(libs.kotlinx.collections.immutable)
Expand Down
Loading