Skip to content

Merge the rest of brush graph code into main#73

Merged
cka-dev merged 58 commits into
mainfrom
brush-graph/2-persistence
May 14, 2026
Merged

Merge the rest of brush graph code into main#73
cka-dev merged 58 commits into
mainfrom
brush-graph/2-persistence

Conversation

@maxmmitchell
Copy link
Copy Markdown
Contributor

@maxmmitchell maxmmitchell commented May 14, 2026

Already reviewed in #61, #62, #63, #64, #65, and #66. This is just to get the code into main (previous merging just condensed the code into a subset of the existing branches. Now it is all on brush-graph/2-persistence, and this puts it in main for real).

maxmmitchell and others added 21 commits May 12, 2026 18:40
Rebasing this through the branches proved to be incredibly painful, so it's all in one commit at the top.
clientBrushFamilyId is a non-public field, so we shouldn't support editing it. Leaving in the field in familyNodeData to support round-tripping of proto files to/from brush graph. Tests were broken by a previous change to how texture store was passed around.
Smaller display QOL adjustments (larger node headers, scrollable test canvas menu) + fix a bug which overwrote test brush color on screen rotate.
Fix a myriad of texture store bugs. Be more consistent overall about using the CompositionLocal model. Update CanvasStrokeRenderer when a new texture is loaded, fixing a bug where replacing the bitmap for a texture ID fails to update in the renderer by forcing cache eviction. Fix other bugs around textures for custom brushes in the palette, so they appear properly in the drawing canvas/preview.
[BrushGraph 3/7] Add ViewModel and state management
[BrushGraph 5/7] Add complex node fields
[BrushGraph 7/7] Integrate Brush Graph into the app
@maxmmitchell maxmmitchell changed the title Merge brush-graph/2 persistence into main Merge brush-graph/2 persistence and brush-graph/3-viewmodel into main May 14, 2026
@maxmmitchell maxmmitchell changed the title Merge brush-graph/2 persistence and brush-graph/3-viewmodel into main Merge the rest of brush graph code into main May 14, 2026
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 implements the core architecture for the Brush Graph feature, including the BrushGraphViewModel, BrushGraphRepository, and conversion utilities for transforming between graph models and BrushFamily protocols. It also introduces an auto-save mechanism, a tutorial management system, and shared test infrastructure. The review feedback highlights the use of Thread.sleep in BrushGraphViewModelTest.kt, which should be replaced with more robust coroutine testing utilities like advanceUntilIdle() to prevent test flakiness.

viewModel.saveToPalette(brushName)

// Wait for the IO coroutine to finish on the device
Thread.sleep(500)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using Thread.sleep in tests is a bad practice as it makes tests flaky and slow. Instead, consider using a TestDispatcher or runTest with advanceUntilIdle() to wait for coroutines to complete.

viewModel.deleteFromPalette(brushName)

// Wait for the IO coroutine to finish on the device
Thread.sleep(500)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using Thread.sleep in tests is a bad practice as it makes tests flaky and slow. Instead, consider using a TestDispatcher or runTest with advanceUntilIdle() to wait for coroutines to complete.

…h/5-complex-fields, effectively)

Add nodes and complex fields to corpus of brush graph code
…ph/7-integration, effectively)

Merge canvas and integration code into corpus of brush graph code
Copy link
Copy Markdown
Contributor

@cka-dev cka-dev left a comment

Choose a reason for hiding this comment

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

lgtm

@cka-dev cka-dev merged commit 05ab440 into main May 14, 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