Skip to content

Conversation

@sashalukin
Copy link
Contributor

@sashalukin sashalukin commented Jul 9, 2025

Chiko and I have made several improvements to Socialite without affecting existing functionality:

  • Migrated to Navigation 3
  • Added adaptive layouts
  • Added drag & drop functionality
  • Enabled keyboard shortcuts (e.g., Enter to send a message)
  • Added right-click support (e.g., copy image on right-click)
  • Minor UI improvements

We've tested this branch thoroughly and used it during I/O Connect in Berlin. It includes all existing changes from main plus our enhancements.

sashalukin and others added 30 commits April 15, 2025 18:27
Adding ChatsListDetail to show both chats list
and chat details on one screen when launching on
a large screen device.
Feat: Enable opening chats in new app instance
Fix the pane transition issue on the ChatListDetails screen
Migrated from navigation 2 to navigation 3.
Had to use a snapshot build as it's not public yet.
Manually copied Navigation 3 CAMAL support as it is not merged yet.
…meline

Fix: self-letterboxing on the timeline screen.
Feat: Enable opening chats by dropping chat list item into desktop
alexvanyo and others added 23 commits May 12, 2025 09:36
Migration of drag & drop indication to IndicationNodeFactory
Update to latest navigation3 snapshot and add shared elements
# Conflicts:
#	app/build.gradle.kts
#	gradle/libs.versions.toml
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.

Summary of Changes

Hello @sashalukin, 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 a suite of modern Android development features to the Socialite app, focusing on improving user experience across different device form factors and interaction methods. The core navigation system has been upgraded, and new functionalities like drag-and-drop, right-click menus, and keyboard shortcuts have been implemented. Additionally, the underlying media handling and build system have been significantly enhanced to support these new capabilities.

Highlights

  • Navigation System Overhaul: The application's navigation has been migrated to the new Navigation 3 library, replacing androidx.navigation.compose. This includes a complete refactoring of how navigation is handled internally, utilizing a custom back stack of Pane objects, which are now Parcelable.
  • Adaptive Layout Support: Adaptive layout capabilities have been integrated, allowing the UI to dynamically adjust based on screen size and window class. This is particularly evident in the Timeline screen, which now supports both Pager and Grid layouts, and the Chat List, which can display a bottom sheet for chat options on smaller screens.
  • Enhanced User Interaction (Drag & Drop, Right-Click, Keyboard Shortcuts): New interaction features have been added, including drag-and-drop for media items within chats and the timeline, right-click context menu support for copying media, and keyboard shortcuts for common actions like sending messages and scrolling chat history.
  • Media Handling Improvements: Significant improvements to media handling include a new MediaItem data class, functions for saving and removing attached media in the repository, and a FileProvider setup for secure content sharing. The camera and photo picker functionalities have been updated to integrate with these changes.
  • Build System and Dependency Updates: The project's build configuration has been updated to compileSdk = 36, and numerous dependencies have been upgraded to their latest versions, including various Compose, CameraX, Media3, and Hilt libraries. New adaptive and navigation3 dependencies have been added, and snapshot repositories are configured.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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 introduces a major architectural refactoring by migrating to Navigation 3, implementing adaptive layouts, and adding significant new features like drag-and-drop and keyboard shortcuts. The changes are extensive and represent a great step forward for the application's structure and capabilities.

My review highlights a critical issue in ChatRepository concerning media handling and a resource leak, a potential UI regression on the camera screen, and some suggestions for improving code organization and build stability. Addressing these points will help ensure the new functionality is robust and the codebase is more maintainable.

Comment on lines +187 to +206
data class MediaItem(val uri: String, val mimeType: String) {

val extension get(): String? {
return mimeTypeToExtensionMap[mimeType]
}

companion object {
private val mimeTypeToExtensionMap = mapOf(
"image/bmp" to "bmp",
"image/gif" to "gif",
"image/jpeg" to "jpg",
"image/jpg" to "jpg",
"image/png" to "png",
"image/svg+xml" to "svg",
"image/webp" to "webp",
"video/mp4" to "mp4",
"video/mpeg" to "mpeg",
)
}
}

Choose a reason for hiding this comment

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

medium

The MediaItem data class is a model class that is used by both this ChatViewModel and ChatRepository. Defining it inside the ViewModel file couples it too tightly to this specific ViewModel.

To improve code organization, reusability, and to avoid potential circular dependencies, it's best practice to move this data class to its own file in a more suitable package, for example, com.google.android.samples.socialite.model or a new com.google.android.samples.socialite.ui.chat.model package.

Comment on lines +22 to +24
maven {
url = uri("https://androidx.dev/snapshots/builds/13508953/artifacts/repository")
}

Choose a reason for hiding this comment

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

medium

Using hardcoded snapshot repository URLs with specific build numbers is risky for long-term maintenance and build reproducibility. These snapshot builds can be removed from the server at any time, which would break the build for anyone trying to build this project in the future.

If these snapshot dependencies are essential, consider adding a comment explaining why they are needed and which dependencies they are for. For a more stable solution, it would be better to wait for these dependencies to be released to a stable repository like Google's Maven repository or Maven Central.

Comment on lines +34 to +36
maven {
url = uri("https://androidx.dev/snapshots/builds/13496827/artifacts/repository")
}

Choose a reason for hiding this comment

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

medium

Similar to the pluginManagement block, using a hardcoded snapshot repository URL here is risky. These builds are not guaranteed to be available long-term, which can cause build failures later on. It's generally better to rely on stable artifact releases.

@android android deleted a comment from gemini-code-assist bot Jul 9, 2025
@madebymozart madebymozart self-requested a review July 21, 2025 16:57
Copy link
Contributor

@madebymozart madebymozart left a comment

Choose a reason for hiding this comment

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

LGTM

@madebymozart madebymozart merged commit cba8cb5 into android:main Jul 25, 2025
2 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.

4 participants