feat: PROJ_BOX — App Project Creation screen#12
Merged
Conversation
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/62dadffd-f358-4d25-97fe-5a208497ec0e Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/62dadffd-f358-4d25-97fe-5a208497ec0e Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Flynn013
May 19, 2026 20:08
View session
There was a problem hiding this comment.
Pull request overview
Adds a new PROJ_BOX OS module that provides a structured “App Project Creation” UI (working title, UI theme, references, and a nested feature tree) and wires it into the main CLU/BOX drawer navigation so users can generate a planning prompt and return to CHAT_BOX.
Changes:
- Introduces
AppProjectCreationScreenwithAppConfig/FeatureNodemodels, reference list management, and recursive feature tree editing UI. - Adds a pure immutable helper (
updateFeatureTree) to insert sub-features by parent ID. - Registers
PROJ_BOXinGalleryAppand builds/logs a planning prompt before switching back toCHAT_BOX.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/osmodules/AppProjectCreationScreen.kt | New PROJ_BOX screen UI, data models, recursive feature rendering, and immutable tree update helper. |
| Android/src/app/src/main/java/com/google/ai/edge/gallery/GalleryApp.kt | Adds PROJ_BOX module entry and routes it to AppProjectCreationScreen, generating a planning prompt on submit. |
Comments suppressed due to low confidence (2)
Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/osmodules/AppProjectCreationScreen.kt:311
- Child feature cards are rendered via
feature.subFeatures.forEach { ... }without keys. Since eachFeatureCardhasrememberstate, adding/removing/reordering sub-features can shift composition slots and mis-associate UI state between siblings. Wrap each child inkey(sub.id) { ... }(or render children via a keyed list) to keep state stable.
// Render children recursively with a slightly darker card surface.
feature.subFeatures.forEach { sub ->
FeatureCard(
feature = sub,
depth = depth + 1,
cyanAccent = cyanAccent,
cardColor = BgColor,
textColor = textColor,
onAddSubFeature = onAddSubFeature,
)
}
Android/src/app/src/main/java/com/google/ai/edge/gallery/ui/osmodules/AppProjectCreationScreen.kt:256
showAddRootFeatureis remembered inside aLazyColumnitem. Lazy list items can be disposed when scrolled off-screen, which can reset this state and unexpectedly dismiss the dialog. Hoist this state to the screen level (outsideLazyColumn) or use a stable keyed holder so the dialog state survives scrolling/recomposition.
item {
var showAddRootFeature by remember { mutableStateOf(false) }
if (showAddRootFeature) {
FeatureInputDialog(
onDismiss = { showAddRootFeature = false },
onConfirm = { name, desc ->
features = features + FeatureNode(name = name, description = desc)
showAddRootFeature = false
},
)
}
OutlinedButton(
onClick = { showAddRootFeature = true },
modifier = Modifier.fillMaxWidth(),
colors = ButtonDefaults.outlinedButtonColors(contentColor = CyanAccent),
) {
Icon(Icons.Default.Add, contentDescription = "Add Feature")
Spacer(Modifier.width(8.dp))
Text("Add Root Feature")
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+221
to
+232
| items(features) { feature -> | ||
| FeatureCard( | ||
| feature = feature, | ||
| depth = 0, | ||
| cyanAccent = CyanAccent, | ||
| cardColor = CardColor, | ||
| textColor = TextColor, | ||
| onAddSubFeature = { parentId, newSubFeature -> | ||
| features = updateFeatureTree(features, parentId, newSubFeature) | ||
| }, | ||
| ) | ||
| } |
Comment on lines
+85
to
+88
| private val BgColor = Color(0xFF121212) | ||
| private val CardColor = Color(0xFF1E1E1E) | ||
| private val CyanAccent = Color(0xFF00E5FF) | ||
| private val TextColor = Color(0xFFE0E0E0) |
Comment on lines
+393
to
+404
| /** Recursively inserts [newChild] under the node with [targetId]. */ | ||
| fun updateFeatureTree( | ||
| nodes: List<FeatureNode>, | ||
| targetId: String, | ||
| newChild: FeatureNode, | ||
| ): List<FeatureNode> = nodes.map { node -> | ||
| if (node.id == targetId) { | ||
| node.copy(subFeatures = node.subFeatures + newChild) | ||
| } else { | ||
| node.copy(subFeatures = updateFeatureTree(node.subFeatures, targetId, newChild)) | ||
| } | ||
| } |
Comment on lines
+351
to
+352
| // Log the planning config; the user can paste it into the chat agent. | ||
| android.util.Log.d("PROJ_BOX", "Planning session:\n$prompt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
AppProjectCreationScreenarchitecture as a new PROJ_BOX OS module — a structured app planning UI with a nested feature tree builder wired into the CLU/BOX drawer navigation.Changes
New:
ui/osmodules/AppProjectCreationScreen.ktFeatureNode— recursive data model, UUID-keyed, with nestedsubFeaturesAppConfig— top-level project config (working title, UI theme, references, feature tree)AppProjectCreationScreen— fullScaffoldwithTopAppBar, "Generate Planning Session" FAB, and aLazyColumnwith four sections:FeatureCard— recursively rendersFeatureNodetrees with depth-based indentation; each node has an inline + Add Sub-Feature triggerFeatureInputDialog—AlertDialogfor creating features/sub-featurescluTextFieldColors— usesOutlinedTextFieldDefaults.colors(non-deprecated Material3 API) with Flynn Dark + Electric Cyan themingupdateFeatureTree— pure immutable recursive tree update (inserts a child under any node by ID)Modified:
GalleryApp.ktIcons.Outlined.RocketLaunchimportPROJ_BOX("PROJ_BOX", Icons.Outlined.RocketLaunch)to theOsModuleenum (betweenLNK_BOXandVENDING_MACHINE)PROJ_BOX → AppProjectCreationScreenin thewhen(activeModule)block:onGeneratePlanningSessionbuilds a structured planning prompt from theAppConfig, logs it, and switches back toCHAT_BOXonCancelreturns toCHAT_BOX