Skip to content

Comments

Add kdocs to ui/uistate/capture classes#465

Open
davidjiagoogle wants to merge 22 commits intomainfrom
david/captureUiStateDocs
Open

Add kdocs to ui/uistate/capture classes#465
davidjiagoogle wants to merge 22 commits intomainfrom
david/captureUiStateDocs

Conversation

@davidjiagoogle
Copy link
Collaborator

@davidjiagoogle davidjiagoogle commented Feb 4, 2026

As titled
SnackBarUiState is moved from ui/uistate/capture to ui/uistate. SnackBarUiStateAdapter is moved to ui/uistateadapter. This is so that postcapture doesn't have to depend on capture

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @davidjiagoogle, 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 focuses on improving the documentation of the UI state definitions within the ui/uistate/capture module. By adding extensive KDoc comments, the intent, structure, and usage of various UI state classes are now clearly articulated, which will aid in future development and onboarding for this part of the codebase.

Highlights

  • KDoc Documentation Added: Comprehensive KDoc comments have been added to all classes, interfaces, data objects, and enums within the ui/uistate/capture package. This includes detailed descriptions for each UI state, its nested components, and their respective properties or parameters.
  • Improved Code Readability: The addition of KDocs significantly enhances the readability and maintainability of the UI state definitions, making it easier for developers to understand the purpose and usage of each UI state component.
  • Removed TODO Comments: An outdated // todo comment related to audio permission handling in AudioUiState.kt has been removed, replaced by a proper KDoc explanation.

🧠 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
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/AspectRatioUiState.kt
    • Added KDoc for AspectRatioUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/AudioUiState.kt
    • Added KDoc for AudioUiState sealed interface.
    • Added KDoc for amplitude property.
    • Added KDoc for Enabled sealed interface.
    • Added KDoc for On data class.
    • Added KDoc for Mute data object.
    • Added KDoc for Disabled data object.
    • Removed // todo comment.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureButtonUiState.kt
    • Added KDoc for CaptureButtonUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled sealed interface.
    • Added KDoc for Idle data class and its parameter.
    • Added KDoc for Recording sealed interface.
    • Added KDoc for PressedRecording data object.
    • Added KDoc for LockedRecording data object.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureModeToggleUiState.kt
    • Added KDoc for CaptureModeToggleUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for isCaptureModeSelectable extension function.
    • Added KDoc for findSelectableStateFor extension function.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureModeUiState.kt
    • Added KDoc for CaptureModeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for isCaptureModeSelectable extension function.
    • Added KDoc for findSelectableStateFor extension function.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ConcurrentCameraUiState.kt
    • Added KDoc for ConcurrentCameraUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/DebugUiState.kt
    • Added KDoc for DebugUiState sealed interface.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled sealed interface and its properties.
    • Added KDoc for Closed data class.
    • Added KDoc for Open data class and its properties.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ElapsedTimeUiState.kt
    • Added KDoc for ElapsedTimeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FlashModeUiState.kt
    • Added KDoc for FlashModeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FlipLensUiState.kt
    • Added KDoc for FlipLensUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FocusMeteringUiState.kt
    • Added KDoc for FocusMeteringUiState sealed interface.
    • Added KDoc for Unspecified data object.
    • Added KDoc for Specified data class and its parameters.
    • Added KDoc for Status enum and its entries.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/HdrUiState.kt
    • Added KDoc for HdrUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ImageWellUiState.kt
    • Added KDoc for ImageWellUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for LastCapture data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ScreenFlashUiState.kt
    • Added KDoc for ScreenFlashUiState data class and its parameters.
    • Removed an internal comment.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/SnackBarUiState.kt
    • Added KDoc for SnackBarUiState data class and its parameter.
    • Added KDoc for SnackbarData data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/StabilizationUiState.kt
    • Added KDoc for StabilizationUiState sealed interface.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled sealed interface and its properties.
    • Added KDoc for Specific data class and its parameters.
    • Added KDoc for Auto data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/StreamConfigUiState.kt
    • Added KDoc for StreamConfigUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ZoomControlUiState.kt
    • Added KDoc for ZoomControlUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ZoomUiState.kt
    • Added KDoc for ZoomUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/CaptureUiState.kt
    • Added KDoc for CaptureUiState sealed interface.
    • Added KDoc for NotReady data object.
    • Added KDoc for Ready data class and its properties.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/PreviewDisplayUiState.kt
    • Added KDoc for PreviewDisplayUiState data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/QuickSettingsUiState.kt
    • Added KDoc for QuickSettingsUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for FocusedQuickSetting enum.
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
Contributor

@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 comprehensive KDoc documentation to numerous UI state classes, which is a great improvement for code clarity and maintainability. The added comments are clear and accurate. I've suggested a couple of minor enhancements to improve the robustness of the data classes by adding validation logic that aligns with the expectations set in the new documentation.

@temcguir
Copy link
Collaborator

temcguir commented Feb 5, 2026

/gemini review

Copy link
Contributor

@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 primarily focuses on improving code documentation by adding KDocs to numerous UI state classes in the ui/uistate/capture module. Additionally, it refactors SnackBarUiState and its adapter out of the capture-specific modules into more general ui/uistate and ui/uistateadapter modules. This is a good architectural change that decouples the postcapture feature from the capture feature. The new KDocs are clear and will significantly improve maintainability. I've found one issue with the package name of the moved adapter file, which should be corrected for consistency.

@davidjiagoogle davidjiagoogle enabled auto-merge (squash) February 7, 2026 01:33
davidjiagoogle and others added 9 commits February 18, 2026 14:35
…istate/capture/ImageWellUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/CaptureUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/CaptureUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/CaptureUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/CaptureUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/PreviewDisplayUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/compound/QuickSettingsUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
…istate/capture/FocusMeteringUiState.kt

Co-authored-by: Kimberly Crevecoeur <kcrevecoeur@google.com>
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.

3 participants