Skip to content

Room List Should Display Names#8

Open
TheSameCat2 wants to merge 2 commits intomainfrom
7-room_list_should_display_names
Open

Room List Should Display Names#8
TheSameCat2 wants to merge 2 commits intomainfrom
7-room_list_should_display_names

Conversation

@TheSameCat2
Copy link
Owner

Summary

  • compute and populate human-friendly room display names in backend room summaries
  • keep desktop room-list fallback behavior for missing/blank names
  • update roadmap statuses for completed display-name and image-media milestones

Validation

  • cargo test -p backend-matrix -p pikachat-desktop

Closes #7

@gemini-code-assist
Copy link

Summary of Changes

Hello @TheSameCat2, 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 significantly enhances the user experience by introducing human-friendly room display names in the room list. It includes robust logic to determine appropriate room names, with a fallback mechanism to room IDs for cases where names are missing or empty. Additionally, the underlying room listing operations have been updated to be asynchronous, and the project roadmap has been revised to reflect these completed features.

Highlights

  • Room Display Names: Implemented logic to compute and display human-friendly room names in the backend room summaries, enhancing user experience.
  • Fallback Behavior: Ensured the desktop room list falls back to displaying room IDs when room names are missing or blank, maintaining usability.
  • Asynchronous Operations: Refactored room listing functions to be asynchronous, improving responsiveness and concurrency.
  • Roadmap Updates: Updated the project roadmap to reflect the completion of room display name and image media milestones.
Changelog
  • README.md
    • Updated the roadmap status for "Room Names/Group Names" to completed.
    • Updated the roadmap status for "Media Upload/Download (Images)" to completed.
  • apps/pikachat-desktop/src/state.rs
    • Modified the room_with_name test helper to accept an Option<&str> for the name.
    • Added a new test case to verify room list fallback behavior for missing or blank names.
  • crates/backend-matrix/src/lib.rs
    • Imported RoomDisplayName from matrix_sdk.
    • Converted list_rooms function and its trait implementation to be async.
    • Updated all call sites for collect_room_summaries and list_rooms to await their results.
    • Introduced normalize_room_summary_name to trim and filter empty room names.
    • Added room_display_name_to_summary_name to convert RoomDisplayName variants to Option<String>.
    • Implemented choose_room_summary_name to prioritize explicit names over calculated display names.
    • Created resolve_room_summary_name to asynchronously determine the best display name for a room, logging warnings on failure.
    • Refactored collect_room_summaries to be an async function, iterating through rooms and using resolve_room_summary_name to populate the name field.
    • Added new unit tests for normalize_room_summary_name, choose_room_summary_name, and room_display_name_to_summary_name.
    • Updated the MockBackend to support the async list_rooms function.
Activity
  • No human activity has been recorded on this pull request yet.
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

The pull request successfully implements human-friendly room display names by leveraging the Matrix SDK's name resolution logic. It introduces asynchronous support for room list generation, which is necessary for the SDK's display_name() method, and includes a robust resolution helper that prioritizes cached names to minimize latency. The implementation also features string normalization to handle whitespace-only names and ensures the desktop app correctly falls back to room IDs when names are unavailable. The roadmap updates accurately reflect the completion of these milestones. The code is well-structured, follows existing patterns, and includes comprehensive tests for the new logic.

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.

Room List Should Display Names

1 participant