Skip to content

[BrushGraph 3/7] Add ViewModel and state management#62

Merged
cka-dev merged 7 commits into
brush-graph/2-persistencefrom
brush-graph/3-viewmodel
May 14, 2026
Merged

[BrushGraph 3/7] Add ViewModel and state management#62
cka-dev merged 7 commits into
brush-graph/2-persistencefrom
brush-graph/3-viewmodel

Conversation

@maxmmitchell
Copy link
Copy Markdown
Contributor

Description

This is the third PR in the Brush Graph stack. It introduces the state management layer that bridges the data layer with the upcoming UI.

Details

  • BrushGraphUiState: Holds the current graph, selected nodes, camera position, and tutorial state.
  • A tutorial state machine, managed by TutorialManager, listens to user actions (like adding a node) and advances the tutorial state automatically.

Dependencies

  • Target: brush-graph/2-persistence

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 BrushGraphViewModel and TutorialManager to handle the logic for a brush graph editor, including node/edge management, tutorial progression, and brush palette persistence. Feedback focuses on optimizing the brush StateFlow to prevent unnecessary re-calculations during UI interactions, improving encapsulation by making internal dependencies private, and removing unused parameters. Additionally, the reviewer suggested replacing println with proper Android logging and simplifying the palette API by removing redundant parameters.

@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from 5a37541 to a4e196f Compare April 27, 2026 13:24
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch 4 times, most recently from 4f5748b to bd61e05 Compare April 28, 2026 05:00
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from a4e196f to e17146a Compare April 28, 2026 05:53
@maxmmitchell maxmmitchell marked this pull request as ready for review April 28, 2026 07:58
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from bd61e05 to da9bc38 Compare April 30, 2026 14:28
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from e17146a to cc0aecc Compare April 30, 2026 14:54
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 with comments

@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from 257bd46 to c7b9a0d Compare May 1, 2026 19:34
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch 2 times, most recently from 8157b89 to 4f012bf Compare May 4, 2026 18:28
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch 3 times, most recently from 9abf30a to ee09998 Compare May 5, 2026 14:46
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from 4f012bf to 4ebcb7e Compare May 5, 2026 20:08
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from e495c28 to 00509d6 Compare May 7, 2026 14:41
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from 4ebcb7e to 282d91d Compare May 7, 2026 14:45
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from 00509d6 to 63fe7f0 Compare May 11, 2026 17:37
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from 282d91d to 881a338 Compare May 11, 2026 18:04
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from 63fe7f0 to 7c0f476 Compare May 11, 2026 19:40
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from 881a338 to e62dda8 Compare May 11, 2026 19:41
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch from 7c0f476 to 578f8bc Compare May 11, 2026 20:12
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch 2 times, most recently from 8e16658 to db2b224 Compare May 11, 2026 20:15
@maxmmitchell maxmmitchell force-pushed the brush-graph/2-persistence branch 2 times, most recently from 388004f to 3e5b8c2 Compare May 12, 2026 17:58
@maxmmitchell maxmmitchell force-pushed the brush-graph/3-viewmodel branch from db2b224 to ca83e1f Compare May 12, 2026 17:59
@cka-dev cka-dev merged commit 4966d4b into brush-graph/2-persistence May 14, 2026
1 check 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