Skip to content

feat: PROJ_BOX — App Project Creation screen#12

Merged
Flynn013 merged 2 commits into
mainfrom
copilot/implement-ui-project-architecture
May 20, 2026
Merged

feat: PROJ_BOX — App Project Creation screen#12
Flynn013 merged 2 commits into
mainfrom
copilot/implement-ui-project-architecture

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Summary

Implements the AppProjectCreationScreen architecture 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.kt

  • FeatureNode — recursive data model, UUID-keyed, with nested subFeatures
  • AppConfig — top-level project config (working title, UI theme, references, feature tree)
  • AppProjectCreationScreen — full Scaffold with TopAppBar, "Generate Planning Session" FAB, and a LazyColumn with four sections:
    • Working Title
    • UI Theme (multi-line)
    • References (dynamic add-from-input list)
    • App Features (nested tree builder)
  • FeatureCard — recursively renders FeatureNode trees with depth-based indentation; each node has an inline + Add Sub-Feature trigger
  • FeatureInputDialogAlertDialog for creating features/sub-features
  • cluTextFieldColors — uses OutlinedTextFieldDefaults.colors (non-deprecated Material3 API) with Flynn Dark + Electric Cyan theming
  • updateFeatureTree — pure immutable recursive tree update (inserts a child under any node by ID)

Modified: GalleryApp.kt

  • Added Icons.Outlined.RocketLaunch import
  • Added PROJ_BOX("PROJ_BOX", Icons.Outlined.RocketLaunch) to the OsModule enum (between LNK_BOX and VENDING_MACHINE)
  • Wired PROJ_BOX → AppProjectCreationScreen in the when(activeModule) block:
    • onGeneratePlanningSession builds a structured planning prompt from the AppConfig, logs it, and switches back to CHAT_BOX
    • onCancel returns to CHAT_BOX

Copilot AI and others added 2 commits May 18, 2026 16:12
Copilot AI requested a review from Flynn013 May 19, 2026 20:08
@Flynn013 Flynn013 marked this pull request as ready for review May 20, 2026 02:27
Copilot AI review requested due to automatic review settings May 20, 2026 02:27
@Flynn013 Flynn013 merged commit c0849d3 into main May 20, 2026
3 checks passed
@Flynn013 Flynn013 deleted the copilot/implement-ui-project-architecture branch May 20, 2026 02:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 AppProjectCreationScreen with AppConfig/FeatureNode models, reference list management, and recursive feature tree editing UI.
  • Adds a pure immutable helper (updateFeatureTree) to insert sub-features by parent ID.
  • Registers PROJ_BOX in GalleryApp and builds/logs a planning prompt before switching back to CHAT_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 each FeatureCard has remember state, adding/removing/reordering sub-features can shift composition slots and mis-associate UI state between siblings. Wrap each child in key(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

  • showAddRootFeature is remembered inside a LazyColumn item. 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 (outside LazyColumn) 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")
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.

3 participants