Skip to content

Add an intent to import a brush directly to Brush Graph#79

Open
maxmmitchell wants to merge 4 commits into
mainfrom
intent
Open

Add an intent to import a brush directly to Brush Graph#79
maxmmitchell wants to merge 4 commits into
mainfrom
intent

Conversation

@maxmmitchell
Copy link
Copy Markdown
Contributor

@maxmmitchell maxmmitchell commented Jun 3, 2026

Adds the com.example.cahier.intent.action.IMPORT_BRUSH intent, which takes a uri as an input, and:

  • Attempts to decode it as a BrushFamily
  • If successful, loads the new BrushFamily into the active brush slot and the __autosave__ slot in the custom brush store
  • Navigates to Brush Graph for immediate editing of this brush

This is useful for workstation custom brush creation, to enable quickly sending a .brushfamily file created in a developer's workstation over to Cahier for rapid iteration. As we explore new flows for brush design, this intent is a helpful utility.

Note that the 10 MB limit for .brushfamily files is arbitrary, but should be more than enough (Shading Pencil is our largest annotated brush, and is 373 KB -- most are under 1 KB).

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 introduces the ability to import custom brushes from a URI via a new intent filter. It updates MainActivity to handle the import intent, decode and save the brush, and navigate to the Brush Graph screen. The review feedback highlights a bug where configuration changes trigger duplicate imports, a potential OutOfMemoryError vulnerability when reading unlimited stream bytes, and an ignored return value when loading the imported brush family.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread app/src/main/java/com/example/cahier/MainActivity.kt
Comment thread app/src/main/java/com/example/cahier/MainActivity.kt
Comment thread app/src/main/java/com/example/cahier/MainActivity.kt
@maxmmitchell maxmmitchell marked this pull request as ready for review June 3, 2026 19:38
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.

1 participant