Skip to content

New Feature: Seen Repositories#344

Merged
rainxchzed merged 5 commits intomainfrom
togglable-liquid
Mar 20, 2026
Merged

New Feature: Seen Repositories#344
rainxchzed merged 5 commits intomainfrom
togglable-liquid

Conversation

@rainxchzed
Copy link
Member

@rainxchzed rainxchzed commented Mar 20, 2026

  • New Feature: Seen Repositories

    • Implement a tracking system to mark GitHub repositories as "seen" once viewed in the details screen.
    • Add a toggle in Profile settings to hide previously seen repositories from discovery and search feeds.
    • Provide a "Clear Seen History" option in settings to reset the seen status of all repositories.
    • Update HomeViewModel, SearchViewModel, and DetailsViewModel to handle seen repository state and filtering logic.
  • Database & Data Layer

    • Perform a Room database migration (version 5 to 6) to add the seen_repos table.
    • Create SeenRepoDao, SeenRepoEntity, and SeenReposRepository to manage persistent seen status.
    • Update TweaksRepository to store the "Hide Seen" user preference.
  • Flatpak Packaging

    • Add initial Flatpak packaging support including build manifest (.yml), AppStream metadata, desktop entry, and launcher scripts.
    • Include a comprehensive README.md in the packaging directory detailing build requirements and local installation steps.
  • UI & Localization

    • Add localized strings for "Hide Seen Repositories" and "Clear Seen History" features.
    • Enhance the Profile screen with new toggle and action cards for managing seen repository history.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added repository view tracking to mark repositories as seen when opened.
    • Added ability to hide already-viewed repositories from discovery feeds via a new toggle setting.
    • Added clear history action to remove all previously viewed repository records.
  • UI/UX Improvements

    • Added "Seen" badge to repository cards indicating previously viewed items.
  • Localization

    • Added translations for all new features in 13+ languages.
  • Documentation

    • Added Flatpak packaging guide.

- **New Feature: Seen Repositories**
    - Implement a tracking system to mark GitHub repositories as "seen" once viewed in the details screen.
    - Add a toggle in Profile settings to hide previously seen repositories from discovery and search feeds.
    - Provide a "Clear Seen History" option in settings to reset the seen status of all repositories.
    - Update `HomeViewModel`, `SearchViewModel`, and `DetailsViewModel` to handle seen repository state and filtering logic.

- **Database & Data Layer**
    - Perform a Room database migration (version 5 to 6) to add the `seen_repos` table.
    - Create `SeenRepoDao`, `SeenRepoEntity`, and `SeenReposRepository` to manage persistent seen status.
    - Update `TweaksRepository` to store the "Hide Seen" user preference.

- **Flatpak Packaging**
    - Add initial Flatpak packaging support including build manifest (`.yml`), AppStream metadata, desktop entry, and launcher scripts.
    - Include a comprehensive `README.md` in the packaging directory detailing build requirements and local installation steps.

- **UI & Localization**
    - Add localized strings for "Hide Seen Repositories" and "Clear Seen History" features.
    - Enhance the Profile screen with new toggle and action cards for managing seen repository history.
- Add localized strings for "Hide seen repositories", "Clear seen history", and related descriptions.
- Provide translations for Arabic, Bengali, Spanish, French, Hindi, Italian, Japanese, Korean, Polish, Russian, Turkish, and Chinese (Simplified).
- Include status message for "Seen history cleared" notification.
- Add `isSeen` property to `DiscoveryRepositoryUi` to track if a repository has been viewed.
- Update `HomeViewModel` and `SearchViewModel` to observe seen repository IDs and reactively update the UI state.
- Initialize the `isSeen` status when mapping repository data in both home and search flows.
- Implement `SeenBadge` component in `RepositoryCard` to display a "Viewed" label with a visibility icon.
- Add "Viewed" localized string resource.
- Refactor `RepositoryCard` to display multiple badges (Installation status and Seen status) using a `Row` layout.
…ages

- Add localized string for `seen_badge` to provide a "Seen" or "Viewed" label.
- Update translations for Bengali, Hindi, Italian, Spanish, Arabic, French, Polish, Russian, Japanese, Korean, Turkish, and Chinese (Simplified).
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 069974b0-f0e0-4303-9ee9-775b928b9cab

📥 Commits

Reviewing files that changed from the base of the PR and between 533ce50 and 486250a.

📒 Files selected for processing (42)
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/4.json
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/5.json
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/6.json
  • core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt
  • core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_5_6.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/di/SharedModule.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/SeenRepoDao.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/SeenRepoEntity.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/SeenReposRepositoryImpl.kt
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/TweaksRepositoryImpl.kt
  • core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/SeenReposRepository.kt
  • core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/TweaksRepository.kt
  • core/presentation/src/commonMain/composeResources/values-ar/strings-ar.xml
  • core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xml
  • core/presentation/src/commonMain/composeResources/values-es/strings-es.xml
  • core/presentation/src/commonMain/composeResources/values-fr/strings-fr.xml
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
  • core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
  • core/presentation/src/commonMain/composeResources/values-pl/strings-pl.xml
  • core/presentation/src/commonMain/composeResources/values-ru/strings-ru.xml
  • core/presentation/src/commonMain/composeResources/values-tr/strings-tr.xml
  • core/presentation/src/commonMain/composeResources/values-zh-rCN/strings-zh-rCN.xml
  • core/presentation/src/commonMain/composeResources/values/strings.xml
  • core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/RepositoryCard.kt
  • core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/model/DiscoveryRepositoryUi.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeRoot.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeState.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileAction.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileEvent.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileState.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Appearance.kt
  • feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt
  • feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchState.kt
  • feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchViewModel.kt
  • packaging/flatpak/README.md

Walkthrough

A new "seen repositories" feature is introduced, tracking which repositories users have viewed. It adds database persistence (new seen_repos table with migration), repository/DAO layers, repository marking logic in details screen, filtering in home/search feeds with optional hide-seen toggle, settings management, and UI badges indicating seen status across 15+ language localizations.

Changes

Cohort / File(s) Summary
Database Schema & Migration
core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/4.json, core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/5.json, core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/6.json, core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_5_6.kt, core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt
Room database schema versioning (4→5→6) and migration implementation creating seen_repos table with repoId primary key and seenAt timestamp.
Data Layer: Entities & DAO
core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/SeenRepoEntity.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/SeenRepoDao.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
New SeenRepoEntity mapping to seen_repos, SeenRepoDao with query/insert/clear operations, and database extension with seenRepoDao property.
Data Layer: Repositories & DI
core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/SeenReposRepositoryImpl.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/TweaksRepositoryImpl.kt, core/data/src/commonMain/kotlin/zed/rainxch/core/data/di/SharedModule.kt
Implementation of seen repos repository (mark as seen, get IDs, clear all), tweak repository updates for hideSeenEnabled preference, and Koin DI bindings.
Domain Layer: Repositories
core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/SeenReposRepository.kt, core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/repository/TweaksRepository.kt
Domain interfaces for SeenReposRepository and hideSeenEnabled setting accessors.
Localization Strings
core/presentation/src/commonMain/composeResources/values*/strings*.xml (13 locales: ar, bn, es, fr, hi, it, ja, ko, pl, ru, tr, zh-rCN, default)
6 new string keys per language: hide_seen_title/description, clear_seen_history*, seen_history_cleared, seen_badge.
UI Components & Models
core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/RepositoryCard.kt, core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/model/DiscoveryRepositoryUi.kt
SeenBadge composable added to RepositoryCard, badge visibility logic updated, DiscoveryRepositoryUi extended with isSeen field.
Feature: Home
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt, feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeState.kt, feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeRoot.kt
ViewModel observes seen repos and hide-seen setting, filters visibleRepos based on seenRepoIds when hiding enabled, state tracks isHideSeenEnabled and seenRepoIds.
Feature: Search
feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchViewModel.kt, feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchState.kt, feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt
ViewModel observes seen repos and hide-seen setting, filters results, sets isSeen flag on results; state extended with visibility tracking.
Feature: Details
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
Marks repository as seen when user views details via seenReposRepository.markAsSeen().
Feature: Profile
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileState.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileAction.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileEvent.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Appearance.kt
Toggle hideSeenEnabled setting, clear all seen repos, display confirmation snackbar; UI elements (toggle card, clear history card) added to appearance section.
Documentation
packaging/flatpak/README.md
Comprehensive Flatpak packaging guide covering prerequisites, setup, build/test/install workflows, AppStream validation, and Flathub publishing checklist.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant DetailsScreen
    participant DetailsVM as DetailsViewModel
    participant SeenRepo as SeenReposRepository
    participant SeenDAO as SeenRepoDAO
    participant DB as Database
    
    User->>DetailsScreen: Views repository details
    DetailsScreen->>DetailsVM: Repository loaded (repo.id)
    DetailsVM->>SeenRepo: markAsSeen(repoId)
    SeenRepo->>SeenDAO: insert(SeenRepoEntity)
    SeenDAO->>DB: INSERT INTO seen_repos
    DB-->>SeenDAO: Success
    
    Note over DetailsVM: Concurrently observing seen repos
    DetailsVM->>SeenRepo: getAllSeenRepoIds()
    SeenRepo->>SeenDAO: Query all seenRepoIds
    SeenDAO->>DB: SELECT repoId FROM seen_repos
    DB-->>SeenDAO: List of repoIds
    SeenDAO-->>SeenRepo: Flow<Set<Long>>
    SeenRepo-->>DetailsVM: Update state.seenRepoIds
    
    participant HomeVM as HomeViewModel
    participant HomeScreen
    
    HomeVM->>HomeVM: Observe seenRepoIds & isHideSeenEnabled
    HomeVM->>HomeVM: Compute visibleRepos = repos.filter()
    HomeVM-->>HomeScreen: Update state with filtered repos
    HomeScreen->>RepositoryCard: Render each repo with isSeen flag
    RepositoryCard->>RepositoryCard: Show SeenBadge if isSeen
    HomeScreen-->>User: Display filtered list
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 A rabbit's tale of repositories seen,
Now marked with badges, shiny and clean.
We hop through history, filtering with care,
While preferences whisper what repos to spare. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch togglable-liquid

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rainxchzed rainxchzed changed the title Togglable liquid New Feature: Seen Repositories Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant