Skip to content

add custom brush data layer for brush designer#50

Merged
cka-dev merged 2 commits intomainfrom
add-brush-data-layer
Mar 24, 2026
Merged

add custom brush data layer for brush designer#50
cka-dev merged 2 commits intomainfrom
add-brush-data-layer

Conversation

@cka-dev
Copy link
Copy Markdown
Contributor

@cka-dev cka-dev commented Mar 17, 2026

New files:

  • developer/brushdesigner/data/CustomBrushEntity.kt
  • developer/brushdesigner/data/CustomBrushDao.kt
  • developer/brushdesigner/data/BrushDesignerRepository.kt

Build config:

  • settings.gradle.kts: include :ink-proto module
  • build.gradle.kts: add ink-proto + protobuf-javalite deps
  • libs.versions.toml: add protobufJavalite version
  • ink-proto: add build.gradle.kts + proto source files for Brush Family

New files:
  - developer/brushdesigner/data/CustomBrushEntity.kt
  - developer/brushdesigner/data/CustomBrushDao.kt
  - developer/brushdesigner/data/BrushDesignerRepository.kt

Build config:
  - settings.gradle.kts: include :ink-proto module
  - build.gradle.kts: add ink-proto + protobuf-javalite deps
  - libs.versions.toml: add protobufJavalite version
  - ink-proto: add build.gradle.kts + proto source files for Brush Family
@cka-dev cka-dev requested a review from romanofranz as a code owner March 17, 2026 18:57
@gemini-code-assist
Copy link
Copy Markdown
Contributor

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 significantly enhances the application's brush designer functionality by introducing a robust data persistence layer for custom brushes. It establishes the necessary database entities, data access objects, and a repository to manage custom brush configurations. Furthermore, it integrates Protobuf for defining complex brush properties, ensuring a structured and extensible way to store and retrieve brush data. These changes lay the groundwork for users to create, save, and manage their own unique brush styles within the application.

Highlights

  • Custom Brush Data Layer: Introduced a new data layer for custom brushes, including CustomBrushEntity for Room persistence, CustomBrushDao for database operations, and BrushDesignerRepository to manage brush data and state.
  • Database Migration: Implemented MIGRATION_8_9 to create the custom_brushes table in the Room database, ensuring schema evolution for storing custom brush configurations.
  • Protobuf Integration: Added a new ink-proto Gradle module and integrated Protobuf dependencies to define and handle BrushFamily and Color schemas, enabling structured storage of complex brush properties.
  • Build Configuration Updates: Modified app/build.gradle.kts, gradle/libs.versions.toml, and settings.gradle.kts to include the new ink-proto module and Protobuf-related dependencies.
  • CustomBrush Data Model Enhancement: Updated the CustomBrush data class to include an isRemovable property, providing more control over custom brush management.

🧠 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
  • app/build.gradle.kts
    • Added Protobuf dependencies for ink-proto project and protobuf-javalite.
  • app/src/main/java/com/example/cahier/core/data/CustomBrush.kt
    • Added isRemovable property with a default value of false.
  • app/src/main/java/com/example/cahier/core/data/DatabaseMigration.kt
    • Added MIGRATION_8_9 to create the custom_brushes table.
  • app/src/main/java/com/example/cahier/core/data/NoteDatabase.kt
    • Updated database version to 9.
    • Added CustomBrushEntity to the list of database entities.
    • Added an abstract function customBrushDao() to expose the new DAO.
  • app/src/main/java/com/example/cahier/core/di/AppModule.kt
    • Imported MIGRATION_8_9 and CustomBrushDao.
    • Added MIGRATION_8_9 to the database migration list.
    • Provided CustomBrushDao as a singleton using Dagger Hilt.
  • app/src/main/java/com/example/cahier/developer/brushdesigner/data/BrushDesignerRepository.kt
    • Added new file BrushDesignerRepository.kt.
    • Implemented a singleton repository for brush designer data.
    • Initialized activeBrushProto with a default ProtoBrushFamily configuration.
    • Exposed activeBrushProto and testStrokes as MutableStateFlow.
  • app/src/main/java/com/example/cahier/developer/brushdesigner/data/CustomBrushDao.kt
    • Added new file CustomBrushDao.kt.
    • Defined a Room DAO interface for CustomBrushEntity.
    • Included methods to getAllCustomBrushes, saveCustomBrush, and deleteCustomBrush.
  • app/src/main/java/com/example/cahier/developer/brushdesigner/data/CustomBrushEntity.kt
    • Added new file CustomBrushEntity.kt.
    • Defined a Room entity CustomBrushEntity with name as primary key and brushBytes as a BLOB.
  • gradle/libs.versions.toml
    • Added protobufJavalite version definition.
    • Added protobuf-javalite library entry.
  • ink-proto/.gitignore
    • Added new file .gitignore.
    • Included /build to ignore build artifacts.
  • ink-proto/build.gradle.kts
    • Added new file build.gradle.kts.
    • Configured java-library and com.google.protobuf plugins.
    • Set Java source and target compatibility to version 17.
    • Added protobuf-javalite as an implementation dependency.
    • Configured Protobuf to generate Java lite code.
  • ink-proto/src/main/proto/brush_family.proto
    • Added new file brush_family.proto.
    • Defined Protobuf messages for BrushFamily, BrushCoat, BrushTip, BrushPaint, BrushBehavior, ColorFunction, and various enums related to brush properties and behaviors.
  • ink-proto/src/main/proto/color.proto
    • Added new file color.proto.
    • Defined a simple Protobuf message Color with red, green, blue, and alpha float fields.
  • settings.gradle.kts
    • Included the new :ink-proto module in the project.
Activity
  • No specific pull request activity (comments, reviews) was detected in the provided context.
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
Copy Markdown
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 sets up the data layer for a new brush designer feature, including a new ink-proto module for protobuf definitions, database entities, DAOs, and migrations. The changes are well-structured. I've identified a few issues: a critical one with a Gradle plugin version that will likely break the build, a couple of high-severity issues related to dependency versioning and data class correctness that could lead to build or runtime problems, and a medium-severity issue regarding state management in the new repository. Addressing these will improve the robustness and maintainability of the new feature.

Comment thread ink-proto/build.gradle.kts
Comment thread gradle/libs.versions.toml
@cka-dev cka-dev merged commit d0ca231 into main Mar 24, 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.

2 participants