Skip to content

Data layer for creating a ListMember#1050

Merged
tunjid merged 2 commits intomainfrom
tj/add-list-member-data
Feb 28, 2026
Merged

Data layer for creating a ListMember#1050
tunjid merged 2 commits intomainfrom
tj/add-list-member-data

Conversation

@tunjid
Copy link
Owner

@tunjid tunjid commented Feb 28, 2026

Fixes #1047

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the foundational data layer for creating and managing ListMember entities within the application. It encompasses the definition of the ListMember data model, the necessary repository methods for creation, and the integration into the record resolution and write queue systems. These changes enable the application to interact with list member records, supporting future features that involve managing user lists.

Highlights

  • ListMember Data Model: Introduced a new ListMember data model, including its Create variant for defining new list members, and updated the Record.Reference to allow for nullable IDs.
  • Record Repository Functionality: Added addListMember to the RecordRepository interface and its OfflineRecordRepository implementation, enabling the creation of new list member records via the network service and local database persistence.
  • Record Resolution and Deletion: Integrated ListMemberUri into the RecordResolver to allow for fetching and resolving ListMember records, and added corresponding deletion logic in ListDao and RecordResolver.
  • Simplified Record Embedding: Refactored record embedding logic in MessageRepository and AtProtoConversions by introducing a new toStrongReferencedRecord utility, making the process more robust by handling cases where a record ID might be null.
  • Write Queue Integration: Extended the Writable interface and WriteQueue to support FeedList.AddMember operations, ensuring that list member creation can be handled asynchronously and with proper status messaging.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/repository/MessageRepository.kt
    • Removed unused imports for BskyRecord and StrongRef.
    • Updated record embedding logic to use the new toStrongReferencedRecord utility function.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/repository/NotificationsRepository.kt
    • Imported the new ListMember data model.
    • Added ListMember to the when statement for handling unknown notification exceptions.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/repository/RecordRepository.kt
    • Imported BskyListMember for graph list items.
    • Added imports for ListMemberUri, RecordKey, recordUriOrNull, and ListMemberEntity.
    • Imported toOutcome utility.
    • Added addListMember function to the RecordRepository interface.
    • Implemented addListMember in OfflineRecordRepository to create and persist ListMember records.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/utilities/AtProtoConversions.kt
    • Modified postEmbedUnion to use toStrongReferencedRecord instead of toRecord.
    • Refactored toRecord into toStrongReferencedRecord, making it an internal function and allowing the record ID to be nullable.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/utilities/recordResolver/RecordResolver.kt
    • Imported BskyListMember for graph list items.
    • Imported ListMember data model and ListMemberUri type.
    • Added logic to OfflineRecordResolver to resolve ListMemberUri records, fetching profile and list details.
    • Added ListMemberUri handling to the deleteRecord function.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/utilities/writequeue/Writable.kt
    • Imported the ListMember data model.
    • Introduced a new FeedList.AddMember sealed class to the Writable interface for creating list members.
  • data/core/src/commonMain/kotlin/com/tunjid/heron/data/utilities/writequeue/WriteQueue.kt
    • Added Writable.FeedList to the writeTimeout function for proper timeout handling.
  • data/database/src/commonMain/kotlin/com/tunjid/heron/data/database/daos/ListDao.kt
    • Imported ListMemberUri.
    • Added deleteListMember function to delete list member entities by URI.
  • data/models/src/commonMain/kotlin/com/tunjid/heron/data/core/models/ListMember.kt
    • Imported ProfileId.
    • Defined the ListMember data class, making it implement the Record interface.
    • Added a nested Create data class for ListMember creation, including profileId and listUri.
  • data/models/src/commonMain/kotlin/com/tunjid/heron/data/core/models/Record.kt
    • Modified Record.Reference.id to be nullable, reflecting cases where a record might not have an immediate ID.
  • data/models/src/commonMain/kotlin/com/tunjid/heron/data/core/types/Uri.kt
    • Made ListMemberUri implement RecordUri.
    • Added a NAMESPACE companion object constant for ListMemberUri.
    • Included ListMemberUri in the requireCollection function to return its namespace.
  • ui/timeline/src/commonMain/composeResources/values/strings.xml
    • Added a new string resource writable_add_list_member.
  • ui/timeline/src/commonMain/kotlin/com/tunjid/heron/timeline/utilities/WriteQueueStatusMemos.kt
    • Imported the writable_add_list_member string resource.
    • Added a case for Writable.FeedList.AddMember to display appropriate status messages in the UI.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the necessary data layer components to support creating a ListMember. The changes span across repositories, models, and data access objects, which is well-structured. I've found a critical issue in RecordRepository where the wrong repository DID is used when creating a listitem record, which would cause API calls to fail in most scenarios. I've provided a fix for this. Additionally, I've suggested a naming improvement in the ListMember.Create data class for better code clarity and maintainability. Please review the comments for details.

@tunjid
Copy link
Owner Author

tunjid commented Feb 28, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces functionality for managing list members, specifically adding new members to a list. Key changes include adding a new addListMember function to the RecordRepository interface and its OfflineRecordRepository implementation, which handles network requests to create list member records and saves them to the local database. The ListMember model was updated to include a Create data class for new member creation and to implement the Record interface. Related changes involve updating ListDao with a deleteListMember function, adding ListMemberUri to various type handling logic, and integrating ListMember into the NotificationsRepository and RecordResolver. Additionally, a new Writable.FeedList.AddMember type was introduced to the write queue for managing list member additions, along with a corresponding string resource for UI feedback. A review comment highlighted that the viewerState for ListMember was hardcoded to null and suggested populating it from the getProfile network response to accurately reflect the viewer's relationship with the list member's subject.

@tunjid tunjid merged commit bc6d24f into main Feb 28, 2026
3 checks passed
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.

Add the data layer for creating a ListMember

1 participant