From 69a9ae4792de909016801a82423f708ca9d78e7a Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:36:48 -0800 Subject: [PATCH 01/55] docs: define Phase 2H editor workspace controls --- docs/PHASE_2H_EDITOR_WORKSPACE_CONTROLS.md | 196 +++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 docs/PHASE_2H_EDITOR_WORKSPACE_CONTROLS.md diff --git a/docs/PHASE_2H_EDITOR_WORKSPACE_CONTROLS.md b/docs/PHASE_2H_EDITOR_WORKSPACE_CONTROLS.md new file mode 100644 index 0000000..df4a8ae --- /dev/null +++ b/docs/PHASE_2H_EDITOR_WORKSPACE_CONTROLS.md @@ -0,0 +1,196 @@ +# Phase 2H β€” Editor Workspace Controls + +## Goal + +Move DroidUI from a component-preview editor toward a dependable visual Android UI authoring workspace while preserving the existing Expo/React Native + TypeScript architecture, local-first project model, Zustand editor store, and release inspection gates. + +This document records the implementation scope and acceptance criteria for the next editor milestone. It is not a claim that the features below are already implemented. + +## Verified baseline on main + +The current `main` branch already contains several capabilities that were not obvious in the mobile workspace: + +- Local project persistence through AsyncStorage (`projectStorage.ts`). +- Project listing, loading, saving, and deletion actions in the Zustand store. +- A Project Manager panel with a saved-project list and Load actions. +- A `.dui` project package parser/exporter. +- A `.dui` import panel that currently accepts pasted JSON. +- Existing code generators for React Native TSX, Jetpack Compose Kotlin, SVG, CSS-in-JS, JSON, tests, CI, and store metadata. +- A spacing/alignment panel for flex direction, alignment, padding, margin, and radius. +- Existing per-node animation metadata, but the current `AnimationSpec` is limited to a small set of entrance presets and duration/delay. + +The primary issue is therefore not that all these systems are absent. Several are implemented but are difficult to discover, are limited in workflow, or do not yet provide the complete behavior expected of a visual IDE. + +## Phase 2H priorities + +### H1. Make project open/discovery obvious + +- Add a visible **Open Project** action in the main application header. +- Route it directly to the existing Projects panel. +- Keep **Save** and **Open** available without requiring users to scroll through the lower tab strip. +- In the Projects panel, clearly distinguish the active project from other saved projects. +- Confirm before replacing a workspace that has unsaved changes. +- Show actionable error feedback if a project cannot be loaded. +- Preserve the current local project format and backward compatibility. + +Acceptance: +- A user can open the project browser from the main header in one tap. +- Selecting Load restores the component tree, theme, locale, splash configuration, and translations. +- Canceling an unsaved-change confirmation leaves the active workspace untouched. +- Loading an invalid project produces an understandable error rather than silently doing nothing. + +### H2. Canvas viewport controls + +Add a dedicated canvas viewport state that is separate from component styling and persisted project content. + +Required controls: +- Zoom in and zoom out. +- Fit to screen. +- Reset to 100%. +- Current zoom percentage. +- Grid visibility toggle. +- Configurable grid spacing, with 4dp and 8dp presets and a custom value. +- Snap-to-grid toggle. +- Pan/scroll support that remains usable on a phone. + +Implementation constraints: +- Use React Native dp as the editor coordinate unit. +- Zoom must not mutate component width, height, margin, padding, or position values. +- Grid and snapping are editor aids, not exported UI elements. +- Keep device preview dimensions independent of viewport zoom. +- Clamp zoom to a documented safe range and avoid creating excessively large native views. +- Grid rendering must be performant on the target Android device; avoid rendering thousands of individual line views. + +Acceptance: +- Zooming changes only the viewport scale. +- Fit-to-screen displays the full device artboard within the available workspace. +- Grid visibility and spacing work at multiple zoom levels. +- Snapping rounds eligible canvas placement coordinates to the configured grid increment. +- The preview remains scrollable and selectable at supported zoom levels. + +### H3. Animation target model + +The existing animation schema supports entrance presets only. Extend it in a backward-compatible way so animation describes both **which node** is animated and **which property** changes. + +Initial target properties: +- Text: opacity, translateX/Y, scale, rotation, text color. +- Image: opacity, translateX/Y, scale, rotation. +- SVG: opacity, translateX/Y, scale, rotation, fill/stroke where supported. +- Button: opacity, translateX/Y, scale, rotation, background color. +- Icon/badge: opacity, translateX/Y, scale, rotation, color. +- Container/card: opacity, translateX/Y, scale, rotation. +- Progress bar: progress value and fill color. + +Initial triggers: +- on mount +- on press +- on focus +- on state change + +Animation configuration: +- target property +- from/to values +- duration +- delay +- easing +- repeat count / infinite +- reverse / alternate +- enabled state + +Keep the first implementation to a reliable set of Reanimated-compatible scalar properties. Defer morphing, arbitrary SVG path interpolation, and Lottie runtime integration until there is a concrete renderer and dependency strategy. + +Acceptance: +- Selecting a node and opening Animation shows the selected node as the target. +- The user can choose an allowed target property based on node type. +- Animation configuration is saved in the project and restored after reopening. +- Existing legacy `preset/duration/delay` animations continue to load. +- Preview and export do not claim support for a property that the target exporter cannot implement. + +### H4. Real file export + +Current export generators produce source text and the app has clipboard support, but generated source must be savable as a file. + +Add a file-export adapter using Expo-supported APIs: +- Generate the selected output format. +- Derive a safe filename and extension. +- Write text to an app cache/document location. +- Use the native share sheet or document destination flow to let the user save/share it. +- Report success only after the write/share operation succeeds. +- Handle cancellation, unavailable storage, and write failures. +- Preserve clipboard export as a secondary option. + +Initial formats: +- `.tsx` React Native +- `.kt` Jetpack Compose +- `.svg` +- `.json` component AST +- `.dui` project package +- `.css` / CSS-in-JS only where the generated output is valid for that format + +Do not label a preview-only snippet as a complete Android application. The Android project bundle exporter remains the path for generating a full Android project. + +Acceptance: +- User selects a format and saves a real file with the correct extension. +- The saved file contains the exact generated source shown in preview. +- Large exports and Unicode text are preserved. +- Export errors are visible and do not crash the editor. + +## Follow-on milestones + +### Phase 2I β€” Animation timeline + +- Keyframe timeline and playback controls. +- Multiple animation tracks per component. +- Per-track easing and delay. +- Timeline preview and scrubber. +- Explicit reduced-motion preview option. + +### Phase 2J β€” Android component library + +Expand the component schema and renderer in tested groups: +- Layout: ScrollView, safe area, row/column, stack, divider. +- Text: rich text, typography variants. +- Controls: icon button, FAB, switch, checkbox, radio, chip. +- Inputs: text field, password, search, dropdown, date/time picker. +- Navigation: app bar, tabs, bottom navigation, drawer. +- Feedback: dialog, snackbar, progress, loading. +- Display: avatar, card, list item, image, video placeholder. +- Advanced: WebView and charts where export support is defined. + +Each component must define: +1. Typed props and defaults. +2. Canvas rendering behavior. +3. Inspector editing controls. +4. Validation and persistence behavior. +5. React Native and/or Jetpack Compose export behavior. +6. Accessibility semantics. +7. Unit or fixture coverage. + +Do not add a component to the visible toolbar until its rendering and export behavior are explicitly classified as supported, partial, or preview-only. + +## Quality gates + +Every phase must: +- Pass `npm ci`. +- Pass `npm run typecheck`. +- Pass the relevant validation scripts and QA runner. +- Pass Expo config validation. +- Pass the Android generated-build workflow. +- Preserve release-integrity and automatic version-tag gates. +- Include a test for project save/load round-trip when the schema changes. +- Include device verification for gestures, viewport controls, file access, and editor interaction. + +A green CI workflow is necessary but does not replace installation and manual testing on a physical Android device. + +## Non-goals for Phase 2H + +- No backend or paid cloud infrastructure. +- No mandatory account or login. +- No replacement of the current project storage format. +- No microservices. +- No arbitrary animation scripting. +- No claim that all Android widgets can be faithfully represented by one generic renderer. + +## Definition of done + +Phase 2H is complete only when project opening is obvious from the main header, viewport controls are usable on Android, animation target configuration is represented by a backward-compatible schema, generated source can be saved as an actual file, inspection gates pass, and a test APK is available for physical-device validation. From edb068dc4f25ec1010abc12a49d8758d83dcf1d2 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:37:08 -0800 Subject: [PATCH 02/55] feat: expose project save and open actions in header --- app/App.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/App.tsx b/app/App.tsx index badc1a1..f2de24a 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -12,7 +12,7 @@ import { generateGitHubActionsYAML } from './src/compiler/cicdPipelineGenerator' import { UnitTestGeneratorStudio } from './src/components/UnitTestGeneratorStudio'; import { generateJestTestSpec } from './src/compiler/jestTestGenerator'; import React, { useState } from 'react'; -import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView } from 'react-native'; +import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView, Alert } from 'react-native'; import { useEditorStore } from './src/store/useEditorStore'; import { CanvasRenderer } from './src/components/CanvasRenderer'; import { PropertyInspector } from './src/components/PropertyInspector'; @@ -49,6 +49,7 @@ export default function App() { i18nDict, currentProjectId, currentProjectName, + saveCurrentProject, undo, redo } = useEditorStore(); @@ -63,6 +64,16 @@ export default function App() { const currentVP = VIEWPORTS[activeViewport] || VIEWPORTS.galaxy_s24_ultra; + const handleSaveProject = async () => { + try { + await saveCurrentProject(currentProjectName); + Alert.alert('Project Saved', `\"${currentProjectName}\" was saved on this device.`); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + Alert.alert('Save Failed', message); + } + }; + const toggleThemeMode = () => { setTheme(isLightMode ? 'dark' : 'light'); }; @@ -92,6 +103,12 @@ export default function App() { + setActiveTab('projects')}> + πŸ“‚ Open + + + πŸ’Ύ Save + {/* Light / Dark UI Toggle Switch */} Date: Thu, 5 Nov 2026 10:41:36 -0800 Subject: [PATCH 03/55] feat: add IconGalleryStudio.tsx --- app/src/components/IconGalleryStudio.tsx | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 app/src/components/IconGalleryStudio.tsx diff --git a/app/src/components/IconGalleryStudio.tsx b/app/src/components/IconGalleryStudio.tsx new file mode 100644 index 0000000..f5d1405 --- /dev/null +++ b/app/src/components/IconGalleryStudio.tsx @@ -0,0 +1,68 @@ +import React, { useMemo, useState } from 'react'; +import { ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'; +import { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign } from '@expo/vector-icons'; +import { useEditorStore } from '../store/useEditorStore'; + +type IconFamily = 'MaterialCommunityIcons' | 'MaterialIcons' | 'Ionicons' | 'Feather' | 'FontAwesome5' | 'AntDesign'; +type IconItem = { name: string; tags: string }; +const FAMILIES: { id: IconFamily; label: string; Icon: any; names: string[] }[] = [ + { id:'MaterialCommunityIcons', label:'Material Community', Icon:MaterialCommunityIcons, names:[ + 'home','home-outline','account','account-circle','account-group','account-multiple','account-cog','menu','dots-horizontal','dots-vertical','arrow-left','arrow-right','arrow-up','arrow-down','chevron-left','chevron-right','chevron-up','chevron-down','close','check','plus','minus','pencil','delete','trash-can','content-save','folder','folder-open','file','file-document','file-code','magnify','filter','sort','tune','cog','wrench','tools','bell','bell-outline','heart','heart-outline','star','star-outline','bookmark','bookmark-outline','share-variant','link','open-in-new','download','upload','cloud','cloud-upload','cloud-download','image','image-multiple','camera','video','play','pause','stop','volume-high','volume-low','volume-off','microphone','music','headphones','palette','brush','vector-square','shape','layers','view-grid','view-list','grid','apps','cellphone','tablet','laptop','monitor','television','watch','battery','battery-charging','wifi','bluetooth','signal','bluetooth-connect','lock','lock-open','shield','shield-check','key','fingerprint','eye','eye-off','lightbulb','flash','flashlight','rocket','creation','auto-fix','magic-staff','fire','lightning-bolt','check-circle','alert-circle','alert','information','help-circle','clock','calendar','timer','map-marker','map','compass','navigation','crosshairs-gps','cart','basket','shopping','credit-card','cash','wallet','gift','trophy','medal','chart-bar','chart-line','chart-pie','trending-up','web','earth','email','message','chat','forum','phone','contacts','calendar-check','clipboard','clipboard-list','printer','qrcode','barcode','code-json','xml','database','server','api','bug','test-tube','cloud-check','refresh','sync','history','undo','redo','fullscreen','fullscreen-exit','magnify-plus','magnify-minus','gesture-tap','gesture-pinch','gesture-swipe','drag','cursor-move','target','crosshairs','format-text','format-bold','format-italic','format-color-text','format-size','border-color','opacity','rotate-right','rotate-left','crop','resize','ruler','ruler-square','ruler-square-compass','vector-line','animation','motion-play','timer-sand','progress-clock' + ]}, + { id:'MaterialIcons', label:'Material', Icon:MaterialIcons, names:['home','search','settings','person','people','menu','close','add','remove','edit','delete','check','arrow_back','arrow_forward','notifications','favorite','star','share','camera_alt','image','videocam','play_arrow','pause','stop','volume_up','mic','shopping_cart','payment','place','map','phone_android','tablet_android','laptop','watch','wifi','bluetooth','battery_full','lock','security','cloud','download','upload','refresh','info','warning','error','help','calendar_today','access_time','bar_chart','pie_chart','code','dashboard','widgets','view_quilt','apps','palette','brush','layers','animation','tune']}, + { id:'Ionicons', label:'Ionicons', Icon:Ionicons, names:['home','home-outline','person','person-outline','people','menu','close','add','remove','search','settings','heart','heart-outline','star','star-outline','notifications','camera','image','videocam','play','pause','stop','volume-high','mic','cart','card','location','map','phone-portrait','tablet-portrait','laptop','watch','wifi','bluetooth','battery-full','lock-closed','shield-checkmark','cloud','download','cloud-upload','refresh','information-circle','alert-circle','calendar','time','stats-chart','grid','apps','color-palette','layers','code-slash']}, + { id:'Feather', label:'Feather', Icon:Feather, names:['home','user','users','menu','x','plus','minus','search','settings','heart','star','bell','camera','image','video','play','pause','volume-2','mic','shopping-cart','map-pin','map','smartphone','tablet','monitor','watch','wifi','bluetooth','battery','lock','shield','cloud','download','upload','refresh-cw','info','alert-circle','calendar','clock','bar-chart-2','pie-chart','grid','layers','code','edit-2','trash-2','share-2','link','eye','eye-off','move','maximize','minimize','sliders','zap']}, + { id:'FontAwesome5', label:'Font Awesome', Icon:FontAwesome5, names:['home','user','users','bars','times','plus','minus','search','cog','heart','star','bell','camera','image','video','play','pause','volume-up','microphone','shopping-cart','map-marker-alt','map','mobile-alt','tablet-alt','laptop','clock','wifi','bluetooth','battery-full','lock','shield-alt','cloud','download','upload','sync','info-circle','exclamation-triangle','calendar','chart-bar','chart-pie','th-large','layer-group','code','edit','trash','share-alt','eye','palette','magic','rocket']}, + { id:'AntDesign', label:'Ant Design', Icon:AntDesign, names:['home','user','team','menu','close','plus','minus','search','setting','heart','star','bell','camera','picture','video-camera','play-circle','pause-circle','sound','shopping-cart','environment','mobile','tablet','laptop','wifi','lock','safety','cloud','download','upload','reload','info-circle','warning','calendar','clock-circle','bar-chart','pie-chart','appstore','appstore-o','code','edit','delete','share-alt','eye','skin','rocket'] + } +]; + +export function IconGalleryStudio() { + const { selectedNodeId, rootNode, addChildNode, updateProps } = useEditorStore(); + const [family, setFamily] = useState('MaterialCommunityIcons'); + const [query, setQuery] = useState(''); + const [selected, setSelected] = useState(null); + const [iconColor, setIconColor] = useState('#38bdf8'); + const [iconSize, setIconSize] = useState('28'); + const current = FAMILIES.find(f => f.id === family)!; + const filtered = useMemo(() => current.names.filter(n => n.toLowerCase().includes(query.trim().toLowerCase())), [current, query]); + const apply = (name: string) => { + setSelected(name); + const props = { iconName: name, iconLibrary: family, iconSymbol: name }; + const style = { color: iconColor, fontSize: Math.max(8, Math.min(128, Number(iconSize) || 28)) }; + if (selectedNodeId) { + updateProps(selectedNodeId, props); + useEditorStore.getState().updateStyle(selectedNodeId, style); + } else { + addChildNode(rootNode.id, 'Icon'); + const id = useEditorStore.getState().selectedNodeId; + if (id) { + useEditorStore.getState().updateProps(id, props); + useEditorStore.getState().updateStyle(id, style); + } + } + }; + return + DROIDUI ASSET WORKSPACEIcon GalleryBrowse, preview and apply scalable vector icons to your selected component. + + + {FAMILIES.map(f=>{setFamily(f.id);setQuery('');}} style={[s.family,f.id===family&&s.familyActive]}>{f.label})} + + + {selected ? : } + {selected || 'Choose an icon'}{family} Β· {filtered.length} results + selected&&apply(selected)} disabled={!selected}>Apply + + + ICON COLOR + SIZE (DP) + + {current.label} ({filtered.length}) + {filtered.map(name=>setSelected(name)} style={[s.tile,selected===name&&s.tileSelected]}>{name.replace(/-/g,' ')})} + {!filtered.length&&No icons match that search.} + Icon fonts are bundled with the app. Selected icon family, name, size and color are stored as component properties. Confirm font licensing and export mappings before shipping generated projects. + ; +} +const s=StyleSheet.create({ + root:{flex:1,backgroundColor:'#0b1220'},content:{padding:16,paddingBottom:32},hero:{padding:16,backgroundColor:'#15243a',borderWidth:1,borderColor:'#263b57',borderRadius:16,marginBottom:14},eyebrow:{fontSize:10,fontWeight:'800',letterSpacing:1.6,color:'#38bdf8'},title:{fontSize:24,fontWeight:'800',color:'#f8fafc',marginTop:5},subtitle:{fontSize:12,color:'#9fb0c7',marginTop:5,lineHeight:18},search:{backgroundColor:'#162338',borderColor:'#34465f',borderWidth:1,borderRadius:11,paddingHorizontal:14,paddingVertical:11,color:'#fff',marginBottom:10},familyRow:{gap:8,paddingBottom:12},family:{paddingHorizontal:13,paddingVertical:9,backgroundColor:'#17253a',borderRadius:20,borderWidth:1,borderColor:'#33445c'},familyActive:{backgroundColor:'#1d4ed8',borderColor:'#60a5fa'},familyText:{fontSize:11,color:'#b6c4d7',fontWeight:'700'},familyTextActive:{color:'#fff'},previewCard:{flexDirection:'row',alignItems:'center',gap:12,padding:12,backgroundColor:'#17263c',borderRadius:14,borderWidth:1,borderColor:'#314760'},previewIcon:{width:56,height:56,backgroundColor:'#0b1424',borderRadius:12,alignItems:'center',justifyContent:'center'},previewTitle:{fontSize:13,fontWeight:'800',color:'#fff'},previewMeta:{fontSize:10,color:'#94a3b8',marginTop:3},apply:{backgroundColor:'#2563eb',paddingHorizontal:14,paddingVertical:9,borderRadius:9},applyText:{color:'#fff',fontWeight:'800',fontSize:11},customRow:{flexDirection:'row',gap:10,marginTop:12,marginBottom:14},fieldLabel:{fontSize:9,color:'#8292aa',fontWeight:'800',letterSpacing:1,marginBottom:5},field:{backgroundColor:'#162338',borderColor:'#34465f',borderWidth:1,borderRadius:8,paddingHorizontal:10,paddingVertical:8,color:'#fff',fontSize:12},section:{fontSize:13,fontWeight:'800',color:'#e5edf8',marginBottom:10},count:{color:'#7f91aa',fontWeight:'500'},grid:{flexDirection:'row',flexWrap:'wrap',gap:8},tile:{width:'23%',minHeight:76,backgroundColor:'#15243a',borderWidth:1,borderColor:'#2c405a',borderRadius:11,alignItems:'center',justifyContent:'center',padding:6},tileSelected:{backgroundColor:'#1d4ed8',borderColor:'#60a5fa'},iconLabel:{fontSize:9,color:'#aebbd0',marginTop:6,textAlign:'center'},empty:{color:'#9fb0c7',textAlign:'center',padding:20},footnote:{fontSize:10,color:'#71839b',lineHeight:16,marginTop:18} +}); From ed90fdb385fa65ee140230fdb74fdfd46ccf6877 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:41:38 -0800 Subject: [PATCH 04/55] feat: add deviceProfile.ts --- app/src/device/deviceProfile.ts | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 app/src/device/deviceProfile.ts diff --git a/app/src/device/deviceProfile.ts b/app/src/device/deviceProfile.ts new file mode 100644 index 0000000..32757a7 --- /dev/null +++ b/app/src/device/deviceProfile.ts @@ -0,0 +1,56 @@ +import { Dimensions, PixelRatio, Platform } from 'react-native'; +import * as Device from 'expo-device'; +import { ViewportSpec } from '../components/ViewportSelector'; + +export interface DetectedDeviceProfile { + viewport: ViewportSpec; + brand: string; + manufacturer: string; + modelName: string; + modelId: string; + osVersion: string; + pixelRatio: number; + widthDp: number; + heightDp: number; + widthPx: number; + heightPx: number; + deviceType: string; + source: 'expo-device-and-window-metrics'; + detectedAt: string; +} + +export function detectCurrentDeviceProfile(): DetectedDeviceProfile { + const window = Dimensions.get('window'); + const screen = Dimensions.get('screen'); + const pixelRatio = PixelRatio.get(); + const widthDp = Math.round(window.width); + const heightDp = Math.round(window.height); + const widthPx = Math.round(screen.width * pixelRatio); + const heightPx = Math.round(screen.height * pixelRatio); + const modelName = Device.modelName || Device.deviceName || 'Android device'; + const viewport: ViewportSpec = { + id: 'detected_device' as any, + name: 'My Device', + deviceModel: modelName, + aspectRatio: widthDp >= heightDp ? 'Landscape' : 'Portrait', + width: widthDp, + height: heightDp, + icon: 'πŸ“±', + }; + return { + viewport, + brand: Device.brand || 'Unknown', + manufacturer: Device.manufacturer || 'Unknown', + modelName, + modelId: Device.modelId || 'Unavailable', + osVersion: Device.osVersion || Platform.Version.toString(), + pixelRatio, + widthDp, + heightDp, + widthPx, + heightPx, + deviceType: String(Device.deviceType ?? 'Unknown'), + source: 'expo-device-and-window-metrics', + detectedAt: new Date().toISOString(), + }; +} From 395c23194f56599c336cd1d0961e106d235fa2e5 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:41:41 -0800 Subject: [PATCH 05/55] feat: add DeviceDetectionStudio.tsx --- app/src/components/DeviceDetectionStudio.tsx | 59 ++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/src/components/DeviceDetectionStudio.tsx diff --git a/app/src/components/DeviceDetectionStudio.tsx b/app/src/components/DeviceDetectionStudio.tsx new file mode 100644 index 0000000..2c087b2 --- /dev/null +++ b/app/src/components/DeviceDetectionStudio.tsx @@ -0,0 +1,59 @@ +import React, { useState } from 'react'; +import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { detectCurrentDeviceProfile, DetectedDeviceProfile } from '../device/deviceProfile'; +import { useEditorStore } from '../store/useEditorStore'; + +export function DeviceDetectionStudio() { + const [profile, setProfile] = useState(null); + const [status, setStatus] = useState('Not detected yet'); + const createTemplate = () => { + try { + const detected = profile || detectCurrentDeviceProfile(); + const { createNewProject, addChildNode, updateStyle, updateProps } = useEditorStore.getState(); + const name = `${detected.brand} ${detected.modelName} Design`.trim(); + createNewProject(name); + const rootId = useEditorStore.getState().rootNode.id; + updateStyle(rootId, { width: detected.widthDp, minHeight: detected.heightDp, padding: 16, backgroundColor: '#0b1220' }); + addChildNode(rootId, 'Text'); + const headingId = useEditorStore.getState().selectedNodeId; + if (headingId) { + updateProps(headingId, { text: name }); + updateStyle(headingId, { fontSize: 22, fontWeight: '700', color: '#f8fafc', marginBottom: 12 }); + } + addChildNode(rootId, 'Text'); + const captionId = useEditorStore.getState().selectedNodeId; + if (captionId) { + updateProps(captionId, { text: `${detected.widthDp} Γ— ${detected.heightDp} dp Β· ${detected.pixelRatio}x density` }); + updateStyle(captionId, { fontSize: 12, color: '#94a3b8' }); + } + setStatus('Template created in the editor'); + Alert.alert('Design template created', `A new project sized for ${detected.modelName} is ready. Save it to keep it.`); + } catch (error) { + Alert.alert('Template creation failed', error instanceof Error ? error.message : String(error)); + } + }; + const detect = () => { + const next = detectCurrentDeviceProfile(); + setProfile(next); + setStatus('Device profile detected'); + }; + return + DEVICE INTELLIGENCEDetect & DesignRead the current Android device identity and live display metrics, then create a project canvas sized to its available screen in dp. + βŒ• Detect This Device + + {profile ? + DEVICE{profile.brand} {profile.modelName} + MANUFACTURER{profile.manufacturer} + MODEL ID{profile.modelId} + ANDROID / OS{profile.osVersion} + AVAILABLE WINDOW{profile.widthDp} Γ— {profile.heightDp} dp + SCREEN PIXELS{profile.widthPx} Γ— {profile.heightPx} px + PIXEL DENSITY{profile.pixelRatio}x + DEVICE TYPE{profile.deviceType} + οΌ‹ Create Design Template + : β–£No device profile yetTap Detect This Device to inspect model information and screen dimensions.} + {status} + Detection uses device metadata plus React Native window/screen metrics. Available window dp is the recommended initial design canvas; physical pixels are shown separately. Foldables and multi-window layouts should be re-detected when the display configuration changes. + ; +} +const s=StyleSheet.create({root:{flex:1,backgroundColor:'#0b1220',padding:14},hero:{backgroundColor:'#14243a',borderColor:'#2b4564',borderWidth:1,borderRadius:16,padding:16,marginBottom:12},kicker:{color:'#38bdf8',fontSize:10,fontWeight:'900',letterSpacing:1.5},title:{color:'#f8fafc',fontSize:23,fontWeight:'900',marginTop:6},copy:{color:'#9aacc4',fontSize:12,lineHeight:18,marginTop:7},primary:{backgroundColor:'#2563eb',borderRadius:10,padding:13,alignItems:'center',marginTop:14},primaryText:{color:'#fff',fontWeight:'900',fontSize:12},card:{backgroundColor:'#15243a',borderColor:'#2c405a',borderWidth:1,borderRadius:14,padding:14},row:{paddingVertical:8,borderBottomWidth:1,borderBottomColor:'#283a52'},label:{color:'#8295ae',fontSize:9,fontWeight:'900',letterSpacing:1},value:{color:'#f1f5f9',fontSize:12,fontWeight:'700',marginTop:3},empty:{alignItems:'center',padding:30,backgroundColor:'#14243a',borderRadius:14,borderWidth:1,borderColor:'#2b405c'},emptyIcon:{fontSize:34,color:'#38bdf8'},emptyTitle:{fontSize:15,fontWeight:'800',color:'#fff',marginTop:8},status:{color:'#38bdf8',fontSize:11,fontWeight:'700',marginTop:12},note:{color:'#71839b',fontSize:10,lineHeight:16,marginTop:14}}); From ab9cbde5637a3aebec98cd8fb482816b6c4a36b9 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:41:53 -0800 Subject: [PATCH 06/55] build: add vector icon and device metadata packages --- app/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/package.json b/app/package.json index 925cb2b..2611220 100644 --- a/app/package.json +++ b/app/package.json @@ -25,7 +25,9 @@ "react-native-reanimated": "~3.6.2", "react-native-svg": "14.1.0", "zustand": "^4.5.0", - "expo-clipboard": "~5.0.1" + "expo-clipboard": "~5.0.1", + "@expo/vector-icons": "^14.0.0", + "expo-device": "~5.9.3" }, "devDependencies": { "@babel/core": "^7.20.0", From 40839e895e8e027e91eb0a3ae9c1be5dab305a64 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:41:57 -0800 Subject: [PATCH 07/55] feat: add DroidUI icon and device workspaces --- app/App.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/App.tsx b/app/App.tsx index f2de24a..1a98018 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -12,6 +12,8 @@ import { generateGitHubActionsYAML } from './src/compiler/cicdPipelineGenerator' import { UnitTestGeneratorStudio } from './src/components/UnitTestGeneratorStudio'; import { generateJestTestSpec } from './src/compiler/jestTestGenerator'; import React, { useState } from 'react'; +import { IconGalleryStudio } from './src/components/IconGalleryStudio'; +import { DeviceDetectionStudio } from './src/components/DeviceDetectionStudio'; import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView, Alert } from 'react-native'; import { useEditorStore } from './src/store/useEditorStore'; import { CanvasRenderer } from './src/components/CanvasRenderer'; @@ -57,7 +59,7 @@ export default function App() { const theme = THEMES[currentTheme] || THEMES.dark; const isLightMode = currentTheme === 'light'; - const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io'>('inspector'); + const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io' | 'icons' | 'device'>('inspector'); const [activeViewport, setActiveViewport] = useState('galaxy_s24_ultra'); const [modalVisible, setModalVisible] = useState(false); const [codeOutput, setCodeOutput] = useState(''); @@ -96,7 +98,7 @@ export default function App() { {/* Studio Top Navigation Header Bar */} - πŸ“± Droid Mobile Studio + β—ˆ DroidUI Studio {currentProjectName} @@ -153,6 +155,8 @@ export default function App() { setActiveTab('deeplink')}> πŸ”— Deep Links & Icons + setActiveTab('icons')}>✣ Icon Gallery + setActiveTab('device')}>β–£ Detect Device setActiveTab('inspector')}> 🎨 Inspector @@ -233,6 +237,8 @@ export default function App() { + {activeTab === 'icons' && } + {activeTab === 'device' && } {activeTab === 'inspector' && } {activeTab === 'deeplink' && } {activeTab === 'release' && } From 0826063b546d67dfcd4f6004946d95b333f4356c Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:06 -0800 Subject: [PATCH 08/55] feat: render selected vector icon families on canvas --- app/src/components/CanvasRenderer.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/components/CanvasRenderer.tsx b/app/src/components/CanvasRenderer.tsx index 8a8a086..c09fd8f 100644 --- a/app/src/components/CanvasRenderer.tsx +++ b/app/src/components/CanvasRenderer.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { View, Text, TouchableOpacity, Image, StyleSheet } from 'react-native'; import { SvgXml } from 'react-native-svg'; +import { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign } from '@expo/vector-icons'; import { ComponentNode } from '../types/schema'; import { useEditorStore } from '../store/useEditorStore'; import { playSoundEffect } from '../audio/soundSynthesizer'; @@ -67,7 +68,16 @@ export const CanvasRenderer: React.FC = ({ node }) => { if (node.type === 'Image') return wrap(node.props?.imageUri ? : πŸ“· Image Placeholder, { borderRadius: node.style.borderRadius || 8, overflow: 'hidden', marginVertical: 4 }); - if (node.type === 'Icon') return wrap({node.props?.iconSymbol || '❖'}, { padding: 4, borderRadius: 6, marginVertical: 2 }); + if (node.type === 'Icon') { + const iconLibraries: Record = { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign }; + const IconSet = iconLibraries[node.props?.iconLibrary || 'MaterialCommunityIcons'] || MaterialCommunityIcons; + return wrap( + node.props?.iconName + ? + : {node.props?.iconSymbol || '❖'}, + { padding: 4, borderRadius: 6, marginVertical: 2 } + ); + } if (node.type === 'Button') return wrap({text(node.props?.label || 'Button', node.props?.i18nKey)}, styles.button); From 955638504d8c3370f6df17ed3d33fd02ae85a43e Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:23 -0800 Subject: [PATCH 09/55] style: organize DroidUI header for compact screens --- app/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/App.tsx b/app/App.tsx index 1a98018..d28c432 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -300,12 +300,12 @@ export default function App() { const styles = StyleSheet.create({ container: { flex: 1 }, - navbar: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', padding: 10, borderBottomWidth: 1 }, - brandGroup: { flexDirection: 'row', alignItems: 'center', gap: 8 }, - logoTitle: { fontSize: 15, fontWeight: 'bold' }, + navbar: { flexDirection: 'column', justifyContent: 'center', alignItems: 'stretch', paddingHorizontal: 12, paddingVertical: 10, borderBottomWidth: 1, gap: 8 }, + brandGroup: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 8, width: '100%' }, + logoTitle: { fontSize: 17, fontWeight: '900', letterSpacing: 0.3 }, projectBadge: { paddingHorizontal: 8, paddingVertical: 3, borderRadius: 12 }, projectBadgeText: { fontSize: 10, fontWeight: 'bold' }, - navActions: { flexDirection: 'row', alignItems: 'center', gap: 6 }, + navActions: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end', flexWrap: 'wrap', gap: 6, width: '100%' }, themeToggleBtn: { borderWidth: 1, paddingHorizontal: 10, paddingVertical: 5, borderRadius: 20 }, themeToggleText: { color: '#ffffff', fontSize: 11, fontWeight: 'bold' }, navBtn: { paddingHorizontal: 10, paddingVertical: 6, borderRadius: 6 }, From 3577e25a0dbdf2aa631d94d26dc04898e4bad96c Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:26 -0800 Subject: [PATCH 10/55] chore: apply DroidUI product identity to Expo app --- app/app.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.json b/app/app.json index 00117f7..836026f 100644 --- a/app/app.json +++ b/app/app.json @@ -1,7 +1,7 @@ { "expo": { - "name": "Droid Studio UI/UX", - "slug": "droid-studio-ui-ux", + "name": "DroidUI", + "slug": "droidui", "version": "7.0.0", "orientation": "portrait", "userInterfaceStyle": "dark", From ac619367ed1513fb496bd43ae0f0d2276fcd1ac8 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:34 -0800 Subject: [PATCH 11/55] fix: insert icons into selected layout without overwriting it --- app/src/components/IconGalleryStudio.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/src/components/IconGalleryStudio.tsx b/app/src/components/IconGalleryStudio.tsx index f5d1405..8422bc9 100644 --- a/app/src/components/IconGalleryStudio.tsx +++ b/app/src/components/IconGalleryStudio.tsx @@ -30,16 +30,19 @@ export function IconGalleryStudio() { setSelected(name); const props = { iconName: name, iconLibrary: family, iconSymbol: name }; const style = { color: iconColor, fontSize: Math.max(8, Math.min(128, Number(iconSize) || 28)) }; - if (selectedNodeId) { - updateProps(selectedNodeId, props); - useEditorStore.getState().updateStyle(selectedNodeId, style); - } else { - addChildNode(rootNode.id, 'Icon'); - const id = useEditorStore.getState().selectedNodeId; - if (id) { - useEditorStore.getState().updateProps(id, props); - useEditorStore.getState().updateStyle(id, style); - } + const findNode = (node: any, id: string): any => node.id === id ? node : (node.children || []).map((child: any) => findNode(child, id)).find(Boolean); + const selectedNode = selectedNodeId ? findNode(rootNode, selectedNodeId) : null; + const parentId = selectedNode && selectedNode.type !== 'Icon' ? selectedNode.id : rootNode.id; + if (selectedNode?.type === 'Icon') { + updateProps(selectedNode.id, props); + useEditorStore.getState().updateStyle(selectedNode.id, style); + return; + } + addChildNode(parentId, 'Icon'); + const id = useEditorStore.getState().selectedNodeId; + if (id) { + useEditorStore.getState().updateProps(id, props); + useEditorStore.getState().updateStyle(id, style); } }; return From ba73fda47f2e39d569246d1acf59f9f9e531ab17 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:52 -0800 Subject: [PATCH 12/55] feat: export vector icon nodes in React Native TSX --- app/src/compiler/codeExporter.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/compiler/codeExporter.ts b/app/src/compiler/codeExporter.ts index 723a4bf..be3f125 100644 --- a/app/src/compiler/codeExporter.ts +++ b/app/src/compiler/codeExporter.ts @@ -34,6 +34,13 @@ export const generateReactNativeTSX = (rootNode: ComponentNode): string => { return `${indent}\n${childrenCode}\n${indent}`; } + if (node.type === 'Icon') { + const family = ['MaterialCommunityIcons', 'MaterialIcons', 'Ionicons', 'Feather', 'FontAwesome5', 'AntDesign'].includes(node.props?.iconLibrary) ? node.props.iconLibrary : 'MaterialCommunityIcons'; + const name = String(node.props?.iconName || 'help-circle').replace(/"/g, '"'); + const color = String(node.style?.color || '#3b82f6').replace(/"/g, '"'); + return indent + '<' + family + ' name="' + name + '" size={' + (node.style?.fontSize || 28) + '} color="' + color + '" style={' + styleStr + '}' + accStr + ' />'; + } + if (node.type === 'Text') { return `${indent}${node.props?.text || 'Text'}`; } @@ -89,6 +96,7 @@ export const generateReactNativeTSX = (rootNode: ComponentNode): string => { return `import React from 'react'; import { View, Text, TouchableOpacity, TextInput, Switch, StyleSheet } from 'react-native'; import { SvgXml } from 'react-native-svg'; +import { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign } from '@expo/vector-icons'; import Animated, { FadeIn, SpringIn } from 'react-native-reanimated'; export default function ExportedUI() { From 6c944cdbf2ed3bf25cdf5f2c377b6fd0670e1558 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:13 -0800 Subject: [PATCH 13/55] feat: add detected phone to device viewport presets --- app/src/components/ViewportSelector.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/components/ViewportSelector.tsx b/app/src/components/ViewportSelector.tsx index 530393c..f87f933 100644 --- a/app/src/components/ViewportSelector.tsx +++ b/app/src/components/ViewportSelector.tsx @@ -9,7 +9,7 @@ export type ViewportMode = | 'pixel_tablet' | 'compact_phone' | 'wear_os_watch' - | 'android_tv'; + | 'android_tv'\n | 'detected_device'; export interface ViewportSpec { id: ViewportMode; @@ -21,7 +21,7 @@ export interface ViewportSpec { icon: string; } -export const VIEWPORTS: Record = { +export const VIEWPORTS: Record, ViewportSpec> = { galaxy_s24_ultra: { id: 'galaxy_s24_ultra', name: 'Galaxy S24 Ultra', @@ -102,7 +102,7 @@ interface Props { } export const ViewportSelector: React.FC = ({ activeViewport, onSelectViewport }) => { - const activeVP = VIEWPORTS[activeViewport] || VIEWPORTS.galaxy_s24_ultra; + const detected = activeViewport === 'detected_device';\n const activeVP = detected ? require('../device/deviceProfile').detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); return ( @@ -113,7 +113,7 @@ export const ViewportSelector: React.FC = ({ activeViewport, onSelectView - {(Object.keys(VIEWPORTS) as ViewportMode[]).map((mode) => { + onSelectViewport('detected_device')}>πŸ“²My Device\n {(Object.keys(VIEWPORTS) as Exclude[]).map((mode) => { const vp = VIEWPORTS[mode]; const isActive = activeViewport === mode; return ( From ca1665392676245f62b946c85b08cd15b91d62d9 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:23 -0800 Subject: [PATCH 14/55] refactor: avoid runtime viewport dependency in device profile --- app/src/device/deviceProfile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/device/deviceProfile.ts b/app/src/device/deviceProfile.ts index 32757a7..efce78e 100644 --- a/app/src/device/deviceProfile.ts +++ b/app/src/device/deviceProfile.ts @@ -1,6 +1,6 @@ import { Dimensions, PixelRatio, Platform } from 'react-native'; import * as Device from 'expo-device'; -import { ViewportSpec } from '../components/ViewportSelector'; +import type { ViewportSpec } from '../components/ViewportSelector'; export interface DetectedDeviceProfile { viewport: ViewportSpec; From 0f21f3ac4c0466de28c852e75ad37a671998c6f1 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:26 -0800 Subject: [PATCH 15/55] feat: show detected device dimensions in viewport selector --- app/src/components/ViewportSelector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/ViewportSelector.tsx b/app/src/components/ViewportSelector.tsx index f87f933..63f28c5 100644 --- a/app/src/components/ViewportSelector.tsx +++ b/app/src/components/ViewportSelector.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { detectCurrentDeviceProfile } from '../device/deviceProfile'; import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native'; export type ViewportMode = @@ -102,7 +103,7 @@ interface Props { } export const ViewportSelector: React.FC = ({ activeViewport, onSelectViewport }) => { - const detected = activeViewport === 'detected_device';\n const activeVP = detected ? require('../device/deviceProfile').detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); + const detected = activeViewport === 'detected_device';\n const activeVP = detected ? detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); return ( From d8fbf2dca478857a6ad0f9ff39aba9b18b625d91 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:28 -0800 Subject: [PATCH 16/55] feat: sync detected device profile with preview canvas --- app/src/components/DeviceDetectionStudio.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/components/DeviceDetectionStudio.tsx b/app/src/components/DeviceDetectionStudio.tsx index 2c087b2..f9a9311 100644 --- a/app/src/components/DeviceDetectionStudio.tsx +++ b/app/src/components/DeviceDetectionStudio.tsx @@ -3,7 +3,7 @@ import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { detectCurrentDeviceProfile, DetectedDeviceProfile } from '../device/deviceProfile'; import { useEditorStore } from '../store/useEditorStore'; -export function DeviceDetectionStudio() { +export function DeviceDetectionStudio({ onDetected }: { onDetected?: () => void }) { const [profile, setProfile] = useState(null); const [status, setStatus] = useState('Not detected yet'); const createTemplate = () => { @@ -35,7 +35,7 @@ export function DeviceDetectionStudio() { const detect = () => { const next = detectCurrentDeviceProfile(); setProfile(next); - setStatus('Device profile detected'); + setStatus('Device profile detected');\n onDetected?.(); }; return DEVICE INTELLIGENCEDetect & DesignRead the current Android device identity and live display metrics, then create a project canvas sized to its available screen in dp. From 8da0d8f08560a0c7657d3d05510afc478881ca93 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:30 -0800 Subject: [PATCH 17/55] feat: preview designs on detected device dimensions --- app/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/App.tsx b/app/App.tsx index d28c432..884b68f 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -64,7 +64,7 @@ export default function App() { const [modalVisible, setModalVisible] = useState(false); const [codeOutput, setCodeOutput] = useState(''); - const currentVP = VIEWPORTS[activeViewport] || VIEWPORTS.galaxy_s24_ultra; + const currentVP = activeViewport === 'detected_device' ? require('./src/device/deviceProfile').detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); const handleSaveProject = async () => { try { @@ -238,7 +238,7 @@ export default function App() { {activeTab === 'icons' && } - {activeTab === 'device' && } + {activeTab === 'device' && setActiveViewport('detected_device')} />} {activeTab === 'inspector' && } {activeTab === 'deeplink' && } {activeTab === 'release' && } From 0da22e4fe14635d5a608c3fd400e7e500b1259be Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:36 -0800 Subject: [PATCH 18/55] refactor: use typed device profile import for canvas preview --- app/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/App.tsx b/app/App.tsx index 884b68f..4c4625d 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -14,6 +14,7 @@ import { generateJestTestSpec } from './src/compiler/jestTestGenerator'; import React, { useState } from 'react'; import { IconGalleryStudio } from './src/components/IconGalleryStudio'; import { DeviceDetectionStudio } from './src/components/DeviceDetectionStudio'; +import { detectCurrentDeviceProfile } from './src/device/deviceProfile'; import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView, Alert } from 'react-native'; import { useEditorStore } from './src/store/useEditorStore'; import { CanvasRenderer } from './src/components/CanvasRenderer'; @@ -64,7 +65,7 @@ export default function App() { const [modalVisible, setModalVisible] = useState(false); const [codeOutput, setCodeOutput] = useState(''); - const currentVP = activeViewport === 'detected_device' ? require('./src/device/deviceProfile').detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); + const currentVP = activeViewport === 'detected_device' ? detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); const handleSaveProject = async () => { try { From 599d5fc9f377477071c74a68efd9b0fc7b75a15d Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:43:54 -0800 Subject: [PATCH 19/55] docs: define DroidUI identity icon gallery and device intelligence --- ...ENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md diff --git a/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md b/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md new file mode 100644 index 0000000..665c193 --- /dev/null +++ b/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md @@ -0,0 +1,103 @@ +# DroidUI Visual Identity, Icon Gallery, and Device Intelligence + +## Product identity + +The application is branded **DroidUI** (not Droid Mobile Studio). The interface should read as a focused mobile UI design environment, not a generic code dashboard. + +### Visual direction +- Deep ink/navy workspace surfaces with clear layered panels. +- Cyan/sky-blue interaction accent with restrained electric-blue primary actions. +- High-contrast neutral typography and consistent type scale. +- Rounded cards and controls with subtle borders; avoid excessive gradients, emoji-only navigation, or decorative clutter. +- Keep the device canvas visually dominant. +- Use concise labels, consistent iconography, clear active states, and meaningful empty/loading/error states. +- Header actions (Open, Save, theme, Undo/Redo, Export) must wrap or scroll safely on narrow phones. +- Organize the many specialist tools into discoverable workspaces; do not make users hunt through a long flat strip of tabs. + +### Interaction standards +- All interactive surfaces need pressed/selected/disabled feedback. +- Search controls should filter immediately and show an empty result state. +- Keep important actions reachable with one or two taps on a phone. +- Use native alerts or accessible in-app dialogs for destructive actions and failures. +- Maintain accessibility labels and touch targets suitable for Android. +- Do not sacrifice editor canvas space to oversized headers or permanently visible toolbars. + +## Icon Gallery Studio + +The Icon Gallery Studio introduces multiple bundled vector icon families: +- Material Community Icons +- Material Icons +- Ionicons +- Feather +- Font Awesome 5 +- Ant Design + +It provides: +- Search across the selected icon family. +- Family selection. +- Live icon preview. +- Editable color and size. +- Apply to the selected Icon node, or insert a new Icon child into the selected layout node. +- Persist icon family, glyph name, size, and color in the component properties/style. +- Canvas rendering through the same icon family used by the gallery. +- React Native TSX generator imports the supported icon families and emits the matching component. + +Icon data is bundled locally; browsing does not require network access. Validate every glyph against the installed package's glyph map before treating the catalog as exhaustive. Avoid claiming all glyph names are valid merely because they appear in the searchable list. + +### Licensing and export +The icon fonts have distinct licenses and attribution requirements. Before distribution, review each included family license and add required notices. Generated TSX uses `@expo/vector-icons`; a standalone exported Android project must include that dependency or map icons to native vector assets. Jetpack Compose and SVG icon export need dedicated mappings before claiming full fidelity. + +## Device Intelligence + +The Device Detection Studio uses: +- `expo-device` for brand, manufacturer, model name/model identifier, and OS version. +- React Native `Dimensions` for available window and screen dimensions. +- `PixelRatio` to distinguish logical dp from physical pixels. + +The profile exposes: +- Device brand/manufacturer/model. +- OS version. +- Window dimensions in dp (recommended design viewport). +- Screen dimensions in physical pixels. +- Pixel ratio. +- Device type. +- Detection timestamp and source. + +The detected device becomes a selectable **My Device** viewport and the canvas uses its current available window dimensions. The user can create a new local project template sized to those dimensions. + +### Accuracy boundaries +- The available window size is not necessarily the panel's physical resolution; status/navigation bars, display cutouts, multi-window, and edge-to-edge configuration affect the usable area. +- Re-detect after orientation, fold/unfold, or multi-window changes. +- Device metadata may be unavailable on simulators or privacy-restricted devices; always show a useful fallback. +- Device detection does not inspect or infer hardware characteristics that the OS does not expose. +- Store the detected profile with a generated template if reproducible device targeting is required; current detection timestamp is metadata, not a live hardware monitor. + +## Template workflow + +1. Open **Detect Device**. +2. Tap **Detect This Device**. +3. Review model identity, OS, dp viewport, physical pixels, and density. +4. Tap **Create Design Template**. +5. DroidUI creates a new local project, adds a starter heading and device metrics, and sets the canvas viewport to **My Device**. +6. Save the project. + +The template is a starting artboard and not a complete OEM skin or exact hardware frame. Device-specific cutouts, rounded corners, fold posture, and system bars are future enhancements. + +## Dependencies + +- `@expo/vector-icons` for bundled vector icon families. +- `expo-device` for device metadata. + +Keep dependency versions aligned with the project's Expo SDK and regenerate/commit the package lockfile through the repository's normal dependency workflow. + +## Quality gates + +- TypeScript typecheck. +- Expo configuration validation. +- Existing editor-state, project-validation, Android generation, static QA, and release-integrity checks. +- Verify all six icon family renderers and generated TSX on Android. +- Test device detection on a physical Android phone and simulator fallback. +- Test portrait/landscape and window-size changes. +- Confirm new icon properties survive project save/open round trips. +- Verify selected non-icon layout nodes are not overwritten when applying a gallery icon. +- Check icon-font licensing and dependency inclusion in exported projects. From 7ef85439e403f06aecb452471ddd9f09387a3a65 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:44:50 -0800 Subject: [PATCH 20/55] fix: avoid unnecessary Expo device dependency --- app/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 2611220..6f65d35 100644 --- a/app/package.json +++ b/app/package.json @@ -26,8 +26,7 @@ "react-native-svg": "14.1.0", "zustand": "^4.5.0", "expo-clipboard": "~5.0.1", - "@expo/vector-icons": "^14.0.0", - "expo-device": "~5.9.3" + "@expo/vector-icons": "^14.0.0" }, "devDependencies": { "@babel/core": "^7.20.0", From 8bdf99958d6d6f37f8927c142b24f2667a3bdf60 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:44:53 -0800 Subject: [PATCH 21/55] build: synchronize vector icon dependency lockfile --- app/package-lock.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/package-lock.json b/app/package-lock.json index fa1fca6..beeeedb 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -18,7 +18,8 @@ "react-native-reanimated": "~3.6.2", "react-native-svg": "14.1.0", "zustand": "^4.5.0", - "expo-clipboard": "~5.0.1" + "expo-clipboard": "~5.0.1", + "@expo/vector-icons": "^14.0.0" }, "devDependencies": { "@babel/core": "^7.20.0", From 74300a339d424820bf6bfa6e380d6d6c64ef6e1b Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:45:04 -0800 Subject: [PATCH 22/55] fix: detect Android identity from native platform constants --- app/src/device/deviceProfile.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/device/deviceProfile.ts b/app/src/device/deviceProfile.ts index efce78e..8e273b6 100644 --- a/app/src/device/deviceProfile.ts +++ b/app/src/device/deviceProfile.ts @@ -1,5 +1,5 @@ import { Dimensions, PixelRatio, Platform } from 'react-native'; -import * as Device from 'expo-device'; + import type { ViewportSpec } from '../components/ViewportSelector'; export interface DetectedDeviceProfile { @@ -15,7 +15,7 @@ export interface DetectedDeviceProfile { widthPx: number; heightPx: number; deviceType: string; - source: 'expo-device-and-window-metrics'; + source: 'react-native-platform-constants-and-window-metrics'; detectedAt: string; } @@ -27,7 +27,7 @@ export function detectCurrentDeviceProfile(): DetectedDeviceProfile { const heightDp = Math.round(window.height); const widthPx = Math.round(screen.width * pixelRatio); const heightPx = Math.round(screen.height * pixelRatio); - const modelName = Device.modelName || Device.deviceName || 'Android device'; + const native = Platform.constants as unknown as { Model?: string; Brand?: string; Manufacturer?: string; Release?: string; Fingerprint?: string };\n const modelName = native.Model || 'Android device'; const viewport: ViewportSpec = { id: 'detected_device' as any, name: 'My Device', @@ -39,18 +39,18 @@ export function detectCurrentDeviceProfile(): DetectedDeviceProfile { }; return { viewport, - brand: Device.brand || 'Unknown', - manufacturer: Device.manufacturer || 'Unknown', + brand: native.Brand || 'Unknown', + manufacturer: native.Manufacturer || 'Unknown', modelName, - modelId: Device.modelId || 'Unavailable', - osVersion: Device.osVersion || Platform.Version.toString(), + modelId: native.Fingerprint || native.Model || 'Unavailable', + osVersion: native.Release || Platform.Version.toString(), pixelRatio, widthDp, heightDp, widthPx, heightPx, - deviceType: String(Device.deviceType ?? 'Unknown'), - source: 'expo-device-and-window-metrics', + deviceType: Platform.OS, + source: 'react-native-platform-constants-and-window-metrics', detectedAt: new Date().toISOString(), }; } From 3c4be87486136dc05cedd7c201e7d1082532ff88 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:45:08 -0800 Subject: [PATCH 23/55] docs: align device detection with native platform constants --- ...ROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md b/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md index 665c193..890b54c 100644 --- a/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md +++ b/docs/DROIDUI_VISUAL_IDENTITY_ICON_GALLERY_DEVICE_INTELLIGENCE.md @@ -50,7 +50,7 @@ The icon fonts have distinct licenses and attribution requirements. Before distr ## Device Intelligence The Device Detection Studio uses: -- `expo-device` for brand, manufacturer, model name/model identifier, and OS version. +- React Native `Platform.constants` for Android brand, manufacturer, model, build fingerprint, and OS release where the OS exposes them. - React Native `Dimensions` for available window and screen dimensions. - `PixelRatio` to distinguish logical dp from physical pixels. @@ -86,7 +86,7 @@ The template is a starting artboard and not a complete OEM skin or exact hardwar ## Dependencies - `@expo/vector-icons` for bundled vector icon families. -- `expo-device` for device metadata. +- React Native `Platform.constants` and window metrics; no additional device package required. Keep dependency versions aligned with the project's Expo SDK and regenerate/commit the package lockfile through the repository's normal dependency workflow. From b9a250886d3d875c6c2e68f5c4605066a3422653 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:45:16 -0800 Subject: [PATCH 24/55] fix: correct device profile declaration formatting --- app/src/device/deviceProfile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/device/deviceProfile.ts b/app/src/device/deviceProfile.ts index 8e273b6..4e42dc9 100644 --- a/app/src/device/deviceProfile.ts +++ b/app/src/device/deviceProfile.ts @@ -27,7 +27,8 @@ export function detectCurrentDeviceProfile(): DetectedDeviceProfile { const heightDp = Math.round(window.height); const widthPx = Math.round(screen.width * pixelRatio); const heightPx = Math.round(screen.height * pixelRatio); - const native = Platform.constants as unknown as { Model?: string; Brand?: string; Manufacturer?: string; Release?: string; Fingerprint?: string };\n const modelName = native.Model || 'Android device'; + const native = Platform.constants as unknown as { Model?: string; Brand?: string; Manufacturer?: string; Release?: string; Fingerprint?: string }; + const modelName = native.Model || 'Android device'; const viewport: ViewportSpec = { id: 'detected_device' as any, name: 'My Device', From 02f26e3aa7d488909da9780033cc6d8e039a81bf Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:51:16 -0800 Subject: [PATCH 25/55] docs: specify interactive canvas color splash audio and event system --- ...ACTIVE_CANVAS_COLOR_SPLASH_AUDIO_EVENTS.md | 187 ++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 docs/PHASE_2I_INTERACTIVE_CANVAS_COLOR_SPLASH_AUDIO_EVENTS.md diff --git a/docs/PHASE_2I_INTERACTIVE_CANVAS_COLOR_SPLASH_AUDIO_EVENTS.md b/docs/PHASE_2I_INTERACTIVE_CANVAS_COLOR_SPLASH_AUDIO_EVENTS.md new file mode 100644 index 0000000..76364ac --- /dev/null +++ b/docs/PHASE_2I_INTERACTIVE_CANVAS_COLOR_SPLASH_AUDIO_EVENTS.md @@ -0,0 +1,187 @@ +# DroidUI Phase 2I β€” Interactive Canvas, Color, Splash, Audio & Events + +## Current baseline (verified from branch source) +The editor already contains: +- `SplashScreenStudio`, `SplashScreenConfig`, and a splash preview overlay. +- `SoundEffectsStudio`, `SoundEffectSpec`, a sound synthesizer, and sound playback on component press. +- `PressStateSpec` and a Press States workspace. +- `TransitionsStudio` and transition metadata. +- A component tree with nested Container/Card children, layer reordering, and Zustand editor history. +- `ComponentStyle` based on React Native ViewStyle/TextStyle/ImageStyle. + +These are useful foundations, but they are not yet a complete interaction authoring system. The existing splash editor is a first version with symbol/color presets and config preview; the sound editor currently focuses on synthesized presets; and click currently selects a node and plays its attached sound rather than executing a configurable event workflow. + +## Product goal +Make DroidUI a mobile-first visual Android UI authoring environment. A designer should be able to place and style components, configure their behavior, preview it, and export usable project source without hand-editing generated code. + +## A. Canvas manipulation and placement system + +### Interaction model +Support two placement modes: +1. **Flow mode (default):** components participate in their parent Container/Card layout. Dragging reorders or reparents components and does not silently convert the whole screen into absolute positioning. +2. **Freeform mode (opt-in per parent/container):** child elements use canvas coordinates and may overlap. Store coordinates in a dedicated editor layout field, not as arbitrary React Native style values. + +### Gestures +- Drag an existing selected element to move it. +- Drag a component from the toolbar onto the canvas to insert at the drop target. +- Long-press to begin dragging on touch devices; provide an explicit Move action for accessibility and devices where gesture conflicts occur. +- Selection handles support resize where the component type allows it. +- Pan and pinch-to-zoom apply to the canvas viewport, not to component geometry. +- Multi-select and group movement are later enhancements. + +### Placement placeholders / smart guides +While dragging, render contextual drop targets: +- Before/after sibling insertion slots. +- Inside eligible Container/Card targets. +- Top, bottom, leading, trailing, and center anchors for freeform containers. +- Grid-cell targets when grid mode is enabled. + +Display alignment guides, spacing measurements, container bounds, and an invalid-drop state. A drop target must be validated against the component's parent/child constraints. Do not show a location that would create an invalid tree (for example, nesting a screen-level element inside a non-container). + +### Data contract +Keep layout metadata separate from style: +```ts +type EditorLayoutMode = 'flow' | 'freeform' | 'grid'; +interface EditorPlacement { + mode?: EditorLayoutMode; + x?: number; + y?: number; + width?: number; + height?: number; + gridColumn?: number; + gridRow?: number; + anchor?: 'top' | 'bottom' | 'leading' | 'trailing' | 'center'; +} +``` +Add optional `placement` to ComponentNode. Coordinates use logical dp relative to the parent content box. Store parent layout mode and grid configuration in the parent node. Migrate older projects with missing placement metadata to flow mode without changing their appearance. + +### Grid and snap +- Grid visibility toggle, configurable cell size, and snap enable/disable. +- Default snap step 8 dp; allow 4/8/16 dp presets and custom spacing. +- Smart snapping to sibling edges, centers, baselines, and equal spacing. +- Snap tolerance should be zoom-aware. +- Respect parent padding and safe-area guides. +- Grid is an editor overlay; never export grid lines as UI elements. + +### Zoom and viewport +- Pinch zoom and +/- controls with fit-to-screen and 100% actions. +- Pan canvas when zoomed. +- Keep the inspector and toolbars stationary while canvas content transforms. +- Clamp zoom to a practical range and preserve the focal point during pinch. +- Ensure drag coordinates are converted from screen coordinates to canvas dp using the current zoom and pan transform. + +## B. RGB Spectrum Color Studio + +Create a reusable `ColorPickerStudio` control that can edit any supported color property: +- Two-dimensional saturation/value field and hue spectrum. +- Alpha/opacity slider. +- RGB integer inputs (0–255). +- HEX input with validation. +- HSL and HSV representations. +- Recent colors and project palette. +- Eyedropper only where a platform-supported implementation is available; otherwise disable it with an explanation. +- Optional gradient editor (linear angle, ordered color stops, stop positions) in a later increment. + +Store colors in standard CSS-compatible hex/rgba strings supported by React Native. Validate and normalize input before writing it into the project. Do not introduce a heavyweight color dependency if a small local conversion utility is sufficient. Use the same picker for text, background, border, icon, SVG, shadow, splash, and sound-independent visual properties. + +## C. Splash Screen Studio β€” complete the existing first version +Extend the existing studio rather than creating a duplicate: +- Import logo/image assets; control fit, position, size, and safe-area placement. +- Background solid color or gradient. +- Title/subtitle typography and alignment. +- Animation target selection (logo, title, subtitle, spinner, background). +- Per-target entrance animation, duration, delay, easing, and optional exit transition. +- Static Android launch-screen export plus a separate in-app animated intro screen. +- Live device preview across the supported Android viewport presets. +- Validate Android launch-screen constraints. Android's native splash screen is platform controlled; complex multi-element animations should be implemented as an in-app intro after launch, not promised as native system splash behavior. + +## D. Sound and audio assets +Extend the existing sound effects studio: +- Sound node/asset type for imported audio (MP3, WAV, OGG where supported). +- Project asset metadata and file references; do not embed large audio binaries in JSON project files. +- Preview, play/pause, stop, volume, mute, loop, and trim metadata. +- Attach audio to click, long press, focus, success, error, or screen lifecycle events. +- Keep synthesized UI sound presets as lightweight offline defaults. +- Respect Android audio focus and lifecycle; never autoplay background audio unexpectedly. +- Export/copy referenced assets into generated Android project assets and include licensing/source metadata. + +## E. Event & Action Designer + +Add an explicit `events` map to ComponentNode, separate from style, sound, and press-state data. + +Initial event triggers: +- onPress / onClick +- onLongPress +- onFocus / onBlur +- onValueChange (inputs, switches, sliders) +- onScreenEnter / onScreenExit + +Initial action types: +- navigateToScreen +- playSound / stopSound +- setText +- setVisibility +- setEnabled +- setValue +- showAlert / showDialog +- openUrl (allowlisted URL schemes; validate URLs) +- startAnimation +- setTheme + +Each action has a stable ID and typed configuration. Events may contain ordered actions and simple conditions. Add validation for missing targets, invalid values, navigation destinations, and unsupported action/component combinations. + +### Preview safety and execution +- Build a small deterministic preview event interpreter; never use eval or execute arbitrary JavaScript supplied by a project. +- Preview actions that can be safely simulated in the editor. +- Clearly label actions that require a generated app runtime or backend and cannot be fully simulated inside the editor. +- External navigation must require an explicit click and use React Native Linking after URL validation. +- Keep preview state isolated from the saved design unless the user explicitly commits changes. + +### Export +React Native TSX export should generate real callbacks and required imports for supported actions. Jetpack Compose export must either generate equivalent behavior or mark unsupported actions in a validation report; never silently drop configured events. Include a generated action registry/runtime helper where multiple screens/actions need shared state. + +## F. Accessibility and mobile usability +- Provide non-gesture Move Up/Move Down and Move Into actions. +- Support screen-reader labels for canvas elements, placement targets, and handles. +- Ensure touch targets are comfortably sized. +- Add keyboard/DPAD focus support where practical. +- Expose a reduced-motion option for animation previews. + +## G. Recommended delivery sequence + +### Phase 2I-A β€” data model and interaction safety +- Placement schema and project migration. +- Typed event/action schema and validation. +- Define container/child eligibility rules. +- Add tests for save/open round trips and undo/redo. + +### Phase 2I-B β€” canvas gestures and smart placement +- PanResponder/Gesture Handler implementation for drag, pan, pinch, and resize. +- Contextual drop placeholders, guides, grid, and snap. +- Flow reorder/reparent and opt-in freeform positioning. +- Verify touch handling does not break tap-to-select or nested scrolling. + +### Phase 2I-C β€” color and splash experience +- Reusable RGB/HEX/HSL/HSV/alpha picker. +- Apply shared color control throughout inspector and Splash Screen Studio. +- Complete splash asset and animation target controls. +- Validate native splash versus in-app intro export. + +### Phase 2I-D β€” audio and events +- Imported audio asset pipeline. +- Event & Action Designer. +- Preview interpreter and sound-event binding. +- React Native export with working callbacks; Compose parity report. + +## Quality gates +- Existing TypeScript, static QA, editor-state, project validation, Android generation, and release-integrity scripts all pass. +- Migration tests preserve older project layouts. +- Gesture tests cover nested containers, scroll conflicts, invalid drops, undo/redo, and zoom-adjusted coordinates. +- Color tests cover valid/invalid HEX, RGB bounds, alpha, and conversion round trips. +- Event tests cover action ordering, missing targets, safe URL validation, preview isolation, and export output. +- Audio tests cover missing assets, unsupported formats, mute, volume bounds, lifecycle, and export inclusion. +- Build and install a debug APK; test on a physical Android phone in portrait and landscape. +- Do not mark the phase complete until actual APK interaction and generated-project compilation have been verified. + +## Scope discipline +Keep the current Expo SDK / React Native version and existing dependencies unless a concrete compatibility need is demonstrated. Prefer existing React Native Gesture Handler/Reanimated already in the project. Avoid introducing large libraries for color picking, audio, or state management without a measured need. Keep all new capabilities modular and feature-gated so the editor remains responsive on modest Android hardware. From 4f64d763895dae8d073cbf70574537493fb49a2a Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:54:49 -0800 Subject: [PATCH 26/55] feat: allow starting a project from a complete design preset --- app/src/store/useEditorStore.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/store/useEditorStore.ts b/app/src/store/useEditorStore.ts index 69beb8a..153b232 100644 --- a/app/src/store/useEditorStore.ts +++ b/app/src/store/useEditorStore.ts @@ -168,6 +168,7 @@ interface EditorState { updateTransition: (id: string, transition: TransitionSpec) => void; addChildNode: (parentId: string, type: ComponentNode['type']) => void; insertTemplate: (parentId: string, templateNode: ComponentNode) => void; + applyTemplateAsProject: (templateNode: ComponentNode, projectName: string) => void; moveChildNode: (parentId: string, fromIndex: number, toIndex: number) => void; deleteNode: (id: string) => void; undo: () => void; @@ -458,6 +459,19 @@ export const useEditorStore = create((set, get) => ({ }); }, + applyTemplateAsProject: (templateNode, projectName) => { + const { rootNode, history } = get(); + const clonedTemplate = randomizeIds(templateNode); + set({ + rootNode: clonedTemplate, + selectedNodeId: clonedTemplate.id, + currentProjectId: null, + currentProjectName: projectName, + history: [...history, rootNode], + future: [], + }); + }, + insertTemplate: (parentId, templateNode) => { const { rootNode, history } = get(); const clonedTemplate = randomizeIds(templateNode); From 3831a3238302f321a011b15aa378d40cbfa2b5e0 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:55:31 -0800 Subject: [PATCH 27/55] feat: add complete editable screens and reusable design kits --- app/src/templates/designPresets.ts | 188 +++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 app/src/templates/designPresets.ts diff --git a/app/src/templates/designPresets.ts b/app/src/templates/designPresets.ts new file mode 100644 index 0000000..ee7e639 --- /dev/null +++ b/app/src/templates/designPresets.ts @@ -0,0 +1,188 @@ +import { ComponentNode } from '../types/schema'; + +export type DesignPresetCategory = 'Complete Screens' | 'Component Kits' | 'Navigation' | 'Forms' | 'Cards & Content'; +export interface DesignPreset { + id: string; + name: string; + category: DesignPresetCategory; + description: string; + styleName: string; + node: ComponentNode; +} + +const text = (id: string, value: string, size: number, color: string, weight: 'normal' | 'bold' = 'normal'): ComponentNode => ({ + id, type: 'Text', props: { text: value }, style: { fontSize: size, color, fontWeight: weight, marginBottom: 6 }, +}); +const button = (id: string, label: string, backgroundColor: string, color = '#ffffff'): ComponentNode => ({ + id, type: 'Button', props: { label }, style: { backgroundColor, color, paddingVertical: 13, paddingHorizontal: 16, borderRadius: 12, alignItems: 'center', marginVertical: 5 }, +}); +const card = (id: string, children: ComponentNode[], backgroundColor = '#ffffff', borderColor = '#e2e8f0'): ComponentNode => ({ + id, type: 'Card', style: { padding: 16, backgroundColor, borderRadius: 18, borderWidth: 1, borderColor, marginVertical: 7 }, children, +}); +const input = (id: string, placeholder: string): ComponentNode => ({ + id, type: 'Input', props: { placeholder }, style: { backgroundColor: '#f1f5f9', color: '#0f172a', padding: 14, borderRadius: 11, borderWidth: 1, borderColor: '#cbd5e1', marginVertical: 5 }, +}); +const root = (id: string, children: ComponentNode[], backgroundColor = '#f8fafc'): ComponentNode => ({ + id, type: 'Container', style: { flexDirection: 'column', padding: 16, backgroundColor, borderRadius: 0, minHeight: 640 }, children, +}); + +export const DESIGN_PRESETS: DesignPreset[] = [ + { + id: 'screen_finance_dashboard', name: 'Fintech Dashboard', category: 'Complete Screens', + description: 'A polished finance overview with balance, quick actions, spending progress and recent activity.', + styleName: 'Clean Fintech', + node: root('finance_screen', [ + text('finance_greeting', 'Good morning, Alex', 14, '#64748b'), + text('finance_heading', 'Your finances', 28, '#0f172a', 'bold'), + card('finance_balance', [text('balance_label', 'TOTAL BALANCE', 11, '#cbd5e1', 'bold'), text('balance_value', '$24,680.50', 32, '#ffffff', 'bold'), text('balance_change', '+8.4% this month', 13, '#86efac')], '#172554', '#1e40af'), + { id: 'finance_actions', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-between', gap: 8 }, children: [ + button('finance_send', 'Send', '#2563eb'), button('finance_add', 'Add money', '#0f766e'), button('finance_more', 'More', '#475569'), + ]}, + text('finance_activity_title', 'Spending overview', 19, '#0f172a', 'bold'), + card('finance_spend', [text('spend_value', '$2,450 of $4,000', 21, '#0f172a', 'bold'), { id: 'finance_progress', type: 'ProgressBar', props: { label: 'Monthly budget', progress: 61, barColor: '#2563eb' }, style: {} }]), + text('finance_recent_title', 'Recent activity', 19, '#0f172a', 'bold'), + card('finance_tx_1', [text('tx1_name', 'Grocery Market', 14, '#0f172a', 'bold'), text('tx1_meta', 'Today Β· Shopping', 11, '#64748b'), text('tx1_amount', '-$84.25', 15, '#dc2626', 'bold')]), + card('finance_tx_2', [text('tx2_name', 'Monthly salary', 14, '#0f172a', 'bold'), text('tx2_meta', 'Yesterday Β· Income', 11, '#64748b'), text('tx2_amount', '+$3,850.00', 15, '#059669', 'bold')]), + ]), + }, + { + id: 'screen_storefront', name: 'Modern Storefront', category: 'Complete Screens', + description: 'Shopping home screen with search, category chips, featured offer and product cards.', + styleName: 'Commerce Light', + node: root('store_screen', [ + text('store_brand', 'NOVA / STORE', 13, '#7c3aed', 'bold'), + text('store_title', 'Discover your next favorite.', 27, '#18181b', 'bold'), + input('store_search', 'Search products and brands'), + { id: 'store_categories', type: 'Container', style: { flexDirection: 'row', gap: 7 }, children: [ + { id: 'cat_all', type: 'Badge', props: { text: 'All' }, style: { backgroundColor: '#7c3aed', padding: 9, borderRadius: 16 }}, + { id: 'cat_style', type: 'Badge', props: { text: 'Style' }, style: { backgroundColor: '#ede9fe', color: '#5b21b6', padding: 9, borderRadius: 16 }}, + { id: 'cat_tech', type: 'Badge', props: { text: 'Tech' }, style: { backgroundColor: '#ede9fe', color: '#5b21b6', padding: 9, borderRadius: 16 }}, + ]}, + card('store_feature', [text('store_feature_tag', 'LIMITED DROP', 10, '#ddd6fe', 'bold'), text('store_feature_title', 'The new season starts here.', 23, '#ffffff', 'bold'), text('store_feature_sub', 'Fresh picks selected for you.', 13, '#e9d5ff'), button('store_feature_cta', 'Explore collection', '#ffffff', '#5b21b6')], '#5b21b6', '#7c3aed'), + text('store_products_title', 'Trending now', 20, '#18181b', 'bold'), + { id: 'store_product_grid', type: 'Container', style: { flexDirection: 'row', gap: 10 }, children: [ + card('store_product_1', [text('product_1_emoji', 'β—ˆ', 34, '#7c3aed', 'bold'), text('product_1_name', 'Studio Headphones', 13, '#18181b', 'bold'), text('product_1_price', '$129.00', 15, '#7c3aed', 'bold')], '#ffffff'), + card('store_product_2', [text('product_2_emoji', 'β—‡', 34, '#ea580c', 'bold'), text('product_2_name', 'Everyday Pack', 13, '#18181b', 'bold'), text('product_2_price', '$74.00', 15, '#7c3aed', 'bold')], '#ffffff'), + ]}, + ]), + }, + { + id: 'screen_social_profile', name: 'Creator Profile', category: 'Complete Screens', + description: 'Social creator profile with identity, follow action, statistics, bio and content tabs.', + styleName: 'Creator Social', + node: root('creator_profile', [ + text('profile_cover', '✦ CREATOR SPACE', 13, '#a78bfa', 'bold'), + { id: 'profile_avatar', type: 'Icon', props: { iconSymbol: 'β—‰' }, style: { fontSize: 58, color: '#7c3aed', alignSelf: 'center' }}, + text('profile_name', 'Jordan Rivera', 25, '#111827', 'bold'), + text('profile_handle', '@jordan.creates', 13, '#7c3aed'), + text('profile_bio', 'Designer, maker and visual storyteller. Sharing ideas in progress.', 14, '#4b5563'), + button('profile_follow', 'οΌ‹ Follow creator', '#7c3aed'), + { id: 'profile_stats', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-around', padding: 12 }, children: [ + text('profile_posts', '128 Posts', 12, '#111827', 'bold'), text('profile_followers', '24.8K Followers', 12, '#111827', 'bold'), text('profile_following', '412 Following', 12, '#111827', 'bold'), + ]}, + text('profile_content_heading', 'Latest creations', 19, '#111827', 'bold'), + { id: 'profile_content', type: 'Container', style: { flexDirection: 'row', gap: 8 }, children: [ + card('profile_post_1', [text('post1', '✧', 32, '#7c3aed'), text('post1_caption', 'Visual study', 11, '#374151')]), + card('profile_post_2', [text('post2', 'β—ˆ', 32, '#0891b2'), text('post2_caption', 'New direction', 11, '#374151')]), + card('profile_post_3', [text('post3', '✺', 32, '#ea580c'), text('post3_caption', 'Color play', 11, '#374151')]), + ]}, + ]), + }, + { + id: 'screen_login', name: 'Premium Login & Signup', category: 'Complete Screens', + description: 'Complete authentication screen with brand header, email/password fields, social sign-in placeholders and CTA.', + styleName: 'Midnight Premium', + node: root('auth_screen', [ + text('auth_mark', '✦ NORTHSTAR', 14, '#a5b4fc', 'bold'), + text('auth_heading', 'Welcome back.', 31, '#ffffff', 'bold'), + text('auth_subtitle', 'Sign in to continue to your workspace.', 14, '#94a3b8'), + text('auth_email_label', 'EMAIL ADDRESS', 10, '#cbd5e1', 'bold'), + input('auth_email', 'you@example.com'), + text('auth_password_label', 'PASSWORD', 10, '#cbd5e1', 'bold'), + input('auth_password', 'Enter your password'), + text('auth_forgot', 'Forgot password?', 12, '#a5b4fc', 'bold'), + button('auth_submit', 'Sign in', '#6366f1'), + text('auth_or', '──────── OR CONTINUE WITH ────────', 10, '#64748b'), + button('auth_google', 'Continue with Google', '#334155'), + text('auth_signup', "New here? Create an account", 13, '#c7d2fe'), + ], '#0f172a'), + }, + { + id: 'screen_settings', name: 'Settings & Preferences', category: 'Complete Screens', + description: 'Settings screen with grouped account, notification, privacy and support rows.', + styleName: 'System Clean', + node: root('settings_screen', [ + text('settings_title', 'Settings', 28, '#111827', 'bold'), + text('settings_sub', 'Manage your account and app preferences.', 13, '#64748b'), + text('settings_account', 'ACCOUNT', 11, '#2563eb', 'bold'), + card('settings_account_card', [ + text('settings_profile', 'Personal information β€Ί', 15, '#111827', 'bold'), + text('settings_security', 'Password & security β€Ί', 15, '#111827'), + text('settings_devices', 'Connected devices β€Ί', 15, '#111827'), + ]), + text('settings_preferences', 'PREFERENCES', 11, '#2563eb', 'bold'), + card('settings_preferences_card', [ + { id: 'settings_dark', type: 'Switch', props: { label: 'Dark appearance', value: false }, style: {} }, + { id: 'settings_push', type: 'Switch', props: { label: 'Push notifications', value: true }, style: {} }, + { id: 'settings_email', type: 'Switch', props: { label: 'Email updates', value: false }, style: {} }, + ]), + text('settings_support', 'SUPPORT', 11, '#2563eb', 'bold'), + card('settings_support_card', [text('settings_help', 'Help center β€Ί', 14, '#111827'), text('settings_about', 'About this app β€Ί', 14, '#111827')]), + button('settings_logout', 'Sign out', '#fee2e2', '#b91c1c'), + ]), + }, + { + id: 'kit_app_header', name: 'Modern App Title Bar', category: 'Navigation', + description: 'Reusable header with back affordance, title and action slot.', + styleName: 'Soft Surface', + node: { id: 'kit_header', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', padding: 14, backgroundColor: '#ffffff', borderBottomWidth: 1, borderBottomColor: '#e2e8f0' }, children: [ + text('header_back', 'β€Ή', 28, '#334155', 'bold'), text('header_title', 'Screen title', 18, '#0f172a', 'bold'), text('header_action', 'β‹―', 24, '#334155', 'bold'), + ]}, + }, + { + id: 'kit_search_field', name: 'Search Textbox', category: 'Forms', + description: 'Rounded search field with search affordance and placeholder.', + styleName: 'Soft Surface', + node: { id: 'kit_search', type: 'Container', style: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 12, backgroundColor: '#f1f5f9', borderRadius: 14, borderWidth: 1, borderColor: '#cbd5e1' }, children: [ + text('search_icon', 'βŒ•', 22, '#64748b'), { ...input('search_text', 'Search anything'), style: { flex: 1, borderWidth: 0, backgroundColor: 'transparent' } }, + ]}, + }, + { + id: 'kit_input_group', name: 'Labeled Input Group', category: 'Forms', + description: 'Label, editable field and helper text as a reusable form pattern.', + styleName: 'Clean Form', + node: { id: 'kit_input_group', type: 'Container', style: { padding: 10 }, children: [ + text('field_label', 'Email address', 12, '#334155', 'bold'), input('field_value', 'name@example.com'), text('field_hint', 'We will never share your email.', 11, '#64748b'), + ]}, + }, + { + id: 'kit_primary_button', name: 'Primary & Secondary Actions', category: 'Component Kits', + description: 'Paired primary and secondary call-to-action buttons.', + styleName: 'Action Set', + node: { id: 'kit_actions', type: 'Container', style: { flexDirection: 'column', padding: 8 }, children: [ + button('kit_primary', 'Continue', '#2563eb'), { ...button('kit_secondary', 'Cancel', '#e2e8f0', '#334155'), style: { backgroundColor: '#e2e8f0', color: '#334155', padding: 12, borderRadius: 12, alignItems: 'center', marginVertical: 5 }}, + ]}, + }, + { + id: 'kit_info_card', name: 'Rich Information Card', category: 'Cards & Content', + description: 'Eyebrow, headline, supporting text and action in a styled card.', + styleName: 'Elevated Card', + node: card('kit_info', [text('info_eyebrow', 'FEATURED', 10, '#2563eb', 'bold'), text('info_heading', 'A clearer way to work.', 21, '#0f172a', 'bold'), text('info_body', 'Bring your tools and ideas together in one simple workspace.', 13, '#64748b'), button('info_action', 'Learn more', '#2563eb')]), + }, + { + id: 'kit_bottom_nav', name: 'Bottom Navigation Bar', category: 'Navigation', + description: 'Four-item bottom navigation pattern with active destination.', + styleName: 'Navigation Surface', + node: { id: 'kit_bottom_nav', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center', padding: 12, backgroundColor: '#ffffff', borderTopWidth: 1, borderTopColor: '#e2e8f0' }, children: [ + text('nav_home', 'βŒ‚ Home', 11, '#2563eb', 'bold'), text('nav_search', 'βŒ• Search', 11, '#64748b'), text('nav_saved', 'β™‘ Saved', 11, '#64748b'), text('nav_profile', 'β—‰ Profile', 11, '#64748b'), + ]}, + }, + { + id: 'kit_glass_card', name: 'Glassmorphism Panel', category: 'Cards & Content', + description: 'Translucent dark panel with subtle border and luminous accent.', + styleName: 'Glass Dark', + node: card('kit_glass', [text('glass_tag', 'INSIGHT', 10, '#67e8f9', 'bold'), text('glass_title', 'Your next idea starts here.', 21, '#ffffff', 'bold'), text('glass_body', 'A reusable glass-style panel for modern interfaces.', 13, '#cbd5e1')], 'rgba(15, 23, 42, 0.92)', '#475569'), + }, +]; + +export const DESIGN_PRESET_CATEGORIES: DesignPresetCategory[] = ['Complete Screens', 'Component Kits', 'Navigation', 'Forms', 'Cards & Content']; From 78cae7ccab5d01d2e20e70d3abec3c3a62f94bbc Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:55:52 -0800 Subject: [PATCH 28/55] feat: add searchable preset catalog with full-screen apply workflow --- app/src/templates/TemplateLibrary.tsx | 105 +++++++++++++++++--------- 1 file changed, 71 insertions(+), 34 deletions(-) diff --git a/app/src/templates/TemplateLibrary.tsx b/app/src/templates/TemplateLibrary.tsx index 0824f91..3b4781e 100644 --- a/app/src/templates/TemplateLibrary.tsx +++ b/app/src/templates/TemplateLibrary.tsx @@ -1,7 +1,8 @@ -import React from 'react'; +import React, { useMemo, useState } from 'react'; import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native'; import { useEditorStore } from '../store/useEditorStore'; import { ComponentNode } from '../types/schema'; +import { DESIGN_PRESETS, DESIGN_PRESET_CATEGORIES } from './designPresets'; export const PREBUILT_TEMPLATES: { id: string; name: string; deviceTag: string; description: string; icon: string; node: ComponentNode }[] = [ { @@ -146,35 +147,67 @@ export const PREBUILT_TEMPLATES: { id: string; name: string; deviceTag: string; }, ]; +type CatalogItem = { id: string; name: string; deviceTag?: string; description: string; icon?: string; category: string; node: ComponentNode }; + export const TemplateLibrary = () => { - const { selectedNodeId, rootNode, insertTemplate } = useEditorStore(); + const { selectedNodeId, rootNode, insertTemplate, applyTemplateAsProject } = useEditorStore(); + const [activeCategory, setActiveCategory] = useState('All'); + const [search, setSearch] = useState(''); const targetParentId = selectedNodeId || rootNode.id; + const catalog: CatalogItem[] = useMemo(() => [ + ...PREBUILT_TEMPLATES.map((item, index) => ({ + ...item, + category: index < 2 ? 'Component Kits' : 'Complete Screens', + })), + ...DESIGN_PRESETS.map((item) => ({ ...item, icon: '✦', deviceTag: item.styleName })), + ], []); + const categories = ['All', ...DESIGN_PRESET_CATEGORIES]; + const filtered = catalog.filter((item) => + (activeCategory === 'All' || item.category === activeCategory) && + (item.name + ' ' + item.description + ' ' + item.category).toLowerCase().includes(search.toLowerCase()) + ); return ( - Device-Tailored Component Templates - Target Container: [{targetParentId}] - - - {PREBUILT_TEMPLATES.map((item) => ( - insertTemplate(targetParentId, item.node)} - > + Design Presets & UI Kits + Start a complete design or insert a reusable component kit into [{targetParentId}] + + + {categories.map((category) => ( + setActiveCategory(category)} style={[styles.categoryChip, activeCategory === category && styles.categoryActive]}> + {category} + + ))} + + {filtered.length} PRELOADED DESIGNS & COMPONENT KITS + + {filtered.map((item) => ( + - {item.icon} + {item.icon || '✦'} {item.name} - Tag: {item.deviceTag} + {item.category} Β· {item.deviceTag || 'Universal'} {item.description} - - + Insert Template + + insertTemplate(targetParentId, item.node)}> + οΌ‹ Insert into canvas + + applyTemplateAsProject(item.node, item.name)}> + Use as starting design + - + ))} + {filtered.length === 0 && No matching presets. Try another search or category.} ); @@ -182,22 +215,26 @@ export const TemplateLibrary = () => { const styles = StyleSheet.create({ container: { flex: 1, padding: 12 }, - title: { fontSize: 14, fontWeight: 'bold', color: '#f8fafc' }, - subtitle: { fontSize: 11, color: '#38bdf8', marginBottom: 6 }, - card: { - backgroundColor: '#1e293b', - padding: 12, - borderRadius: 10, - marginBottom: 10, - borderWidth: 1, - borderColor: '#334155', - }, - cardHeader: { flexDirection: 'row', alignItems: 'center', gap: 8, marginBottom: 4 }, - cardIcon: { fontSize: 20 }, + title: { fontSize: 17, fontWeight: '900', color: '#f8fafc', letterSpacing: 0.2 }, + subtitle: { fontSize: 11, color: '#94a3b8', marginTop: 4, marginBottom: 8, lineHeight: 16 }, + search: { backgroundColor: '#0f172a', color: '#f8fafc', borderWidth: 1, borderColor: '#334155', borderRadius: 10, paddingHorizontal: 12, paddingVertical: 10, fontSize: 12 }, + categoryRow: { flexDirection: 'row', gap: 7, paddingVertical: 10 }, + categoryChip: { borderWidth: 1, borderColor: '#475569', borderRadius: 18, paddingHorizontal: 11, paddingVertical: 7, backgroundColor: '#1e293b' }, + categoryActive: { backgroundColor: '#2563eb', borderColor: '#60a5fa' }, + categoryText: { color: '#cbd5e1', fontSize: 10, fontWeight: '600' }, + categoryTextActive: { color: '#ffffff' }, + resultCount: { color: '#38bdf8', fontSize: 9, fontWeight: '800', letterSpacing: 0.8, marginTop: 2 }, + card: { backgroundColor: '#1e293b', padding: 13, borderRadius: 13, marginBottom: 10, borderWidth: 1, borderColor: '#334155' }, + cardHeader: { flexDirection: 'row', alignItems: 'center', gap: 9, marginBottom: 5 }, + cardIcon: { fontSize: 23, width: 30, textAlign: 'center' }, cardMeta: { flex: 1 }, - cardTitle: { fontSize: 13, fontWeight: 'bold', color: '#ffffff' }, - deviceTag: { fontSize: 10, color: '#38bdf8', fontWeight: '600' }, - cardDesc: { fontSize: 11, color: '#94a3b8', marginBottom: 8 }, - insertBtn: { backgroundColor: '#2563eb', paddingVertical: 6, paddingHorizontal: 10, borderRadius: 6, alignSelf: 'flex-start' }, - insertBtnText: { color: '#ffffff', fontSize: 11, fontWeight: 'bold' }, + cardTitle: { fontSize: 13, fontWeight: '800', color: '#ffffff' }, + deviceTag: { fontSize: 9, color: '#38bdf8', fontWeight: '700', marginTop: 3 }, + cardDesc: { fontSize: 11, color: '#cbd5e1', marginBottom: 10, lineHeight: 16 }, + actionRow: { flexDirection: 'row', flexWrap: 'wrap', gap: 7 }, + insertBtn: { backgroundColor: '#2563eb', paddingVertical: 9, paddingHorizontal: 11, borderRadius: 8, flexGrow: 1, alignItems: 'center' }, + insertBtnText: { color: '#ffffff', fontSize: 10, fontWeight: '800' }, + startBtn: { backgroundColor: '#334155', paddingVertical: 9, paddingHorizontal: 11, borderRadius: 8, flexGrow: 1, alignItems: 'center', borderWidth: 1, borderColor: '#64748b' }, + startBtnText: { color: '#e2e8f0', fontSize: 10, fontWeight: '800' }, + empty: { color: '#94a3b8', textAlign: 'center', padding: 24, fontSize: 12 }, }); From fefeaccfe67abf59b2606d41b3bbb3b4972e8b2e Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:56:09 -0800 Subject: [PATCH 29/55] fix: import preset catalog search input --- app/src/templates/TemplateLibrary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/templates/TemplateLibrary.tsx b/app/src/templates/TemplateLibrary.tsx index 3b4781e..bc843f0 100644 --- a/app/src/templates/TemplateLibrary.tsx +++ b/app/src/templates/TemplateLibrary.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useState } from 'react'; -import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native'; +import { StyleSheet, Text, View, TouchableOpacity, ScrollView, TextInput } from 'react-native'; import { useEditorStore } from '../store/useEditorStore'; import { ComponentNode } from '../types/schema'; import { DESIGN_PRESETS, DESIGN_PRESET_CATEGORIES } from './designPresets'; From 4bf452e7a31f04eacc87af7efe33e1ac24b77b7d Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:56:11 -0800 Subject: [PATCH 30/55] feat: add reusable rich visual style presets --- app/src/templates/visualStylePresets.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/src/templates/visualStylePresets.ts diff --git a/app/src/templates/visualStylePresets.ts b/app/src/templates/visualStylePresets.ts new file mode 100644 index 0000000..e49c886 --- /dev/null +++ b/app/src/templates/visualStylePresets.ts @@ -0,0 +1,19 @@ +import { ComponentStyle } from '../types/schema'; + +export interface VisualStylePreset { + id: string; + label: string; + description: string; + style: Partial; +} + +export const VISUAL_STYLE_PRESETS: VisualStylePreset[] = [ + { id: 'soft_surface', label: 'Soft Surface', description: 'Quiet neutral surface with generous rounding.', style: { backgroundColor: '#f1f5f9', borderColor: '#e2e8f0', borderWidth: 1, borderRadius: 16, padding: 14 } }, + { id: 'elevated_card', label: 'Elevated Card', description: 'Bright card with subtle elevation.', style: { backgroundColor: '#ffffff', borderColor: '#e2e8f0', borderWidth: 1, borderRadius: 18, padding: 16, elevation: 4, shadowColor: '#0f172a', shadowOpacity: 0.12, shadowRadius: 10, shadowOffset: { width: 0, height: 4 } } }, + { id: 'glass_dark', label: 'Glass Dark', description: 'Translucent dark glass-like surface.', style: { backgroundColor: 'rgba(15, 23, 42, 0.92)', borderColor: '#475569', borderWidth: 1, borderRadius: 18, padding: 16 } }, + { id: 'neon_edge', label: 'Neon Edge', description: 'Dark surface with bright cyan accent border.', style: { backgroundColor: '#0f172a', borderColor: '#22d3ee', borderWidth: 1.5, borderRadius: 14, padding: 14, shadowColor: '#22d3ee', shadowOpacity: 0.25, shadowRadius: 8, shadowOffset: { width: 0, height: 0 } } }, + { id: 'outline', label: 'Outline', description: 'Minimal transparent surface with a clear border.', style: { backgroundColor: 'transparent', borderColor: '#64748b', borderWidth: 1.5, borderRadius: 10, padding: 12 } }, + { id: 'pill', label: 'Pill', description: 'Rounded capsule treatment for compact controls.', style: { backgroundColor: '#2563eb', borderColor: '#2563eb', borderWidth: 1, borderRadius: 999, paddingHorizontal: 18, paddingVertical: 10 } }, + { id: 'midnight', label: 'Midnight', description: 'Deep navy surface with cool blue contrast.', style: { backgroundColor: '#172554', borderColor: '#1d4ed8', borderWidth: 1, borderRadius: 14, padding: 14 } }, + { id: 'warm_editorial', label: 'Warm Editorial', description: 'Warm paper-like surface with understated brown border.', style: { backgroundColor: '#fff7ed', borderColor: '#fed7aa', borderWidth: 1, borderRadius: 12, padding: 16 } }, +]; From 681d4b1aaf02946bdbc669525136ff54787fcf4f Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:56:18 -0800 Subject: [PATCH 31/55] feat: add one-tap rich visual styles to component inspector --- app/src/components/PropertyInspector.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/components/PropertyInspector.tsx b/app/src/components/PropertyInspector.tsx index 9500579..ca2c5a5 100644 --- a/app/src/components/PropertyInspector.tsx +++ b/app/src/components/PropertyInspector.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View, TouchableOpacity, TextInput, ScrollView } from 'react-native'; import { useEditorStore } from '../store/useEditorStore'; +import { VISUAL_STYLE_PRESETS } from '../templates/visualStylePresets'; export const PropertyInspector = () => { const { rootNode, selectedNodeId, updateStyle, updateProps, addChildNode } = useEditorStore(); @@ -219,6 +220,18 @@ export const PropertyInspector = () => { )} + + Quick Visual Styles + Apply a coordinated surface treatment, then customize individual properties below. + + {VISUAL_STYLE_PRESETS.map((preset) => ( + updateStyle(selectedNode.id, preset.style)}> + {preset.label} + + ))} + + + {/* Style Editors */} Spacing & Padding @@ -245,7 +258,7 @@ const styles = StyleSheet.create({ header: { fontSize: 14, fontWeight: 'bold', color: '#f8fafc' }, typeTag: { fontSize: 11, color: '#3b82f6', marginBottom: 12 }, section: { marginBottom: 16 }, - sectionTitle: { fontSize: 12, fontWeight: '600', color: '#cbd5e1', marginBottom: 8 }, + sectionTitle: { fontSize: 12, fontWeight: '600', color: '#cbd5e1', marginBottom: 8 },\n helperText: { fontSize: 10, color: '#94a3b8', marginBottom: 8, lineHeight: 14 }, addBtnGrid: { flexDirection: 'row', gap: 6, flexWrap: 'wrap' }, addBtn: { backgroundColor: '#334155', padding: 8, borderRadius: 6, flex: 1, minWidth: '45%', alignItems: 'center' }, addBtnText: { color: '#ffffff', fontSize: 11, fontWeight: 'bold' }, From bd3b0506776f2538feaf2d67e1a828e76452419b Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:56:37 -0800 Subject: [PATCH 32/55] docs: define editable design presets and rich styling system --- ...PRESETS_COMPONENT_KITS_AND_RICH_STYLING.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/DESIGN_PRESETS_COMPONENT_KITS_AND_RICH_STYLING.md diff --git a/docs/DESIGN_PRESETS_COMPONENT_KITS_AND_RICH_STYLING.md b/docs/DESIGN_PRESETS_COMPONENT_KITS_AND_RICH_STYLING.md new file mode 100644 index 0000000..7782dc4 --- /dev/null +++ b/docs/DESIGN_PRESETS_COMPONENT_KITS_AND_RICH_STYLING.md @@ -0,0 +1,121 @@ +# DroidUI Design Presets, Complete Screens & Rich UI Styling + +## Product objective +Ship a substantial, locally bundled starter library so users can start from a complete screen, a reusable component kit, or a single component pattern, then customize and save their own variations. + +The preset library is a first-class editor workspace, not a static demo gallery. + +## Three levels of reusable design + +### 1. Component presets +Examples: +- App title bars and screen headers. +- Text fields, search fields, password fields, labeled form groups. +- Primary, secondary, destructive, icon and floating action buttons. +- Badges, chips, tabs, segmented controls and bottom navigation. +- Cards, information panels, KPI tiles, list rows and empty states. +- Dialogs, confirmation panels, switches, sliders, checkboxes and progress indicators. + +Each component preset must be independently editable, with stable properties and child nodes. + +### 2. Component kits +Coordinated collections of reusable components with a shared type scale, spacing, color palette, corner radius and interaction treatment. Examples: authentication kit, commerce kit, dashboard kit, settings kit, creator profile kit and navigation kit. + +### 3. Complete screen designs +Complete starting screens users can apply as the root canvas: +- Fintech dashboard. +- Commerce storefront. +- Creator/social profile. +- Login and signup. +- Settings and preferences. +- Analytics and operations dashboard. +- Messaging/inbox. +- Booking/service discovery. +- Media player. +- Onboarding/welcome. + +Each screen should contain meaningful placeholder content, realistic component hierarchy and coherent visual styling. Screen presets should be device-responsive and editable, not flattened screenshots. + +## User workflows + +Each catalog item supports two distinct actions: + +**Insert into canvas** +- Clone the selected preset subtree. +- Generate unique IDs for every descendant. +- Insert into the selected eligible Container/Card. +- Preserve the existing screen and other components. +- Select the inserted root so users can immediately edit it. + +**Use as starting design** +- Replace the current root canvas with a cloned complete design. +- Create a new unsaved project with the preset name. +- Preserve undo history so the user can undo the replacement. +- Generate unique IDs for every node. +- Do not delete any previously saved project; this action only replaces the current in-memory canvas. + +The UI must clearly distinguish these actions and should warn before replacing a non-empty unsaved canvas if the current project contains meaningful work. + +## Catalog experience +- Search by name, category, component type, and descriptive keywords. +- Categories: Complete Screens, Component Kits, Navigation, Forms, Cards & Content, Buttons & Actions, Data & Charts, Device-Specific. +- Preview thumbnail or live miniature rendered from the component tree. +- Show device suitability, style family, component count and short description. +- Favorite, recently used and user-created presets. +- Duplicate a preset into a user collection and edit the copy. +- Save current selection or complete screen as a reusable preset. +- Import/export preset packs using a versioned schema. +- Bundled presets must work offline. + +## Rich style system + +DroidUI is an Expo/React Native editor. The source of truth is a typed cross-platform style-token model; React Native exports use `StyleSheet`/style objects. Do not promise browser CSS compatibility or emit web-only CSS properties in Android exports. + +Provide one-tap visual treatments: +- Soft Surface. +- Elevated Card. +- Glass Dark. +- Neon Edge. +- Outline. +- Pill. +- Midnight. +- Warm Editorial. + +The shared style model should cover: +- Color and alpha. +- Background and supported gradients. +- Borders and corner radii. +- Padding, margins and gaps. +- Typography, line height, letter spacing and alignment. +- Elevation and shadow. +- Opacity and transforms. +- State styles for pressed, focused, disabled and selected states. + +Use design tokens so a user can apply a theme across a whole screen and then override individual components. Preserve per-component overrides when switching themes unless the user explicitly chooses to replace all styles. + +### Platform mapping +- Map common visual tokens to React Native ViewStyle/TextStyle/ImageStyle. +- Implement gradients through an explicit supported renderer/dependency, not by passing a CSS gradient string to React Native backgroundColor. +- Map shadows carefully to Android elevation and supported shadow properties. +- Produce a validation report for unsupported style properties in each export target. +- Keep style tokens serializable in DroidUI project files. + +## Implementation currently committed +The development branch now contains: +- A catalog of five complete starter screens: fintech dashboard, storefront, creator profile, login/signup and settings. +- Reusable title bar, search field, labeled input group, action button pair, information card, bottom navigation and glass panel presets. +- Existing prebuilt templates combined into the searchable categorized catalog. +- Search and category filtering. +- Separate **Insert into canvas** and **Use as starting design** actions. +- Store action that replaces the current root canvas with a cloned preset and records undo history. +- Unique descendant IDs through the existing recursive clone mechanism. +- Eight quick visual style treatments exposed in the Property Inspector. + +## Follow-up enhancements +- Add live thumbnail rendering for every preset. +- Add richer preset coverage for messaging, media, onboarding, bookings, charts, lists, tabs, dialogs, empty states and responsive navigation. +- Add theme tokens and global theme application. +- Add save-as-preset and custom preset folders. +- Add confirmation before replacing unsaved work. +- Add automated tests for unique IDs, root replacement, insert target validity, undo/redo and save/open round trips. +- Validate that every preset renders and compiles to generated Android source. From ec6b729c55a4dcafcf66b7298171aa66c5619f7a Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:11:43 -0800 Subject: [PATCH 33/55] feat: persist user-created design presets locally --- app/src/templates/customPresetStorage.ts | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/src/templates/customPresetStorage.ts diff --git a/app/src/templates/customPresetStorage.ts b/app/src/templates/customPresetStorage.ts new file mode 100644 index 0000000..25926a2 --- /dev/null +++ b/app/src/templates/customPresetStorage.ts @@ -0,0 +1,53 @@ +import AsyncStorage from '@react-native-async-storage/async-storage'; +import { ComponentNode } from '../types/schema'; + +const KEY = '@droidui_custom_design_presets_v1'; +export interface SavedDesignPreset { + id: string; + name: string; + description: string; + category: string; + createdAt: string; + node: ComponentNode; +} +const validNode = (node: any): node is ComponentNode => + !!node && typeof node.id === 'string' && typeof node.type === 'string' && + !!node.style && typeof node.style === 'object' && + (!node.children || (Array.isArray(node.children) && node.children.every(validNode))); + +export const listCustomDesignPresets = async (): Promise => { + const raw = await AsyncStorage.getItem(KEY); + if (!raw) return []; + try { + const parsed = JSON.parse(raw); + return Array.isArray(parsed) ? parsed.filter(item => + item && typeof item.id === 'string' && typeof item.name === 'string' && validNode(item.node) + ) : []; + } catch { + return []; + } +}; + +export const saveCustomDesignPreset = async ( + name: string, node: ComponentNode, description = 'Saved from the DroidUI editor' +): Promise => { + const cleanName = name.trim(); + if (!cleanName) throw new Error('Enter a name for this preset.'); + if (!validNode(node)) throw new Error('The selected design cannot be saved as a preset.'); + const presets = await listCustomDesignPresets(); + const preset: SavedDesignPreset = { + id: 'custom_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 8), + name: cleanName, + description, + category: 'My Presets', + createdAt: new Date().toISOString(), + node: JSON.parse(JSON.stringify(node)), + }; + await AsyncStorage.setItem(KEY, JSON.stringify([preset, ...presets])); + return preset; +}; + +export const deleteCustomDesignPreset = async (id: string): Promise => { + const presets = await listCustomDesignPresets(); + await AsyncStorage.setItem(KEY, JSON.stringify(presets.filter(item => item.id !== id))); +}; From 30d97cc445d2e63a6603f10c6b373a09ff347a07 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:12:25 -0800 Subject: [PATCH 34/55] feat: add live preset previews and personal preset saving --- app/src/templates/TemplateLibrary.tsx | 39 ++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/app/src/templates/TemplateLibrary.tsx b/app/src/templates/TemplateLibrary.tsx index bc843f0..1587508 100644 --- a/app/src/templates/TemplateLibrary.tsx +++ b/app/src/templates/TemplateLibrary.tsx @@ -1,8 +1,9 @@ -import React, { useMemo, useState } from 'react'; -import { StyleSheet, Text, View, TouchableOpacity, ScrollView, TextInput } from 'react-native'; +import React, { useEffect, useMemo, useState } from 'react'; +import { StyleSheet, Text, View, TouchableOpacity, ScrollView, TextInput, Alert } from 'react-native'; import { useEditorStore } from '../store/useEditorStore'; import { ComponentNode } from '../types/schema'; import { DESIGN_PRESETS, DESIGN_PRESET_CATEGORIES } from './designPresets'; +import { SavedDesignPreset, listCustomDesignPresets, saveCustomDesignPreset, deleteCustomDesignPreset } from './customPresetStorage'; export const PREBUILT_TEMPLATES: { id: string; name: string; deviceTag: string; description: string; icon: string; node: ComponentNode }[] = [ { @@ -153,6 +154,12 @@ export const TemplateLibrary = () => { const { selectedNodeId, rootNode, insertTemplate, applyTemplateAsProject } = useEditorStore(); const [activeCategory, setActiveCategory] = useState('All'); const [search, setSearch] = useState(''); + const [customPresets, setCustomPresets] = useState([]); + const [presetName, setPresetName] = useState(''); + useEffect(() => { listCustomDesignPresets().then(setCustomPresets).catch(() => Alert.alert('Preset library', 'Could not load saved presets.')); }, []); + const findNode = (node: ComponentNode, id: string): ComponentNode | null => { if (node.id === id) return node; for (const child of node.children || []) { const found = findNode(child, id); if (found) return found; } return null; }; + const selectedNode = selectedNodeId ? findNode(rootNode, selectedNodeId) : rootNode; + const saveCurrentPreset = async () => { if (!presetName.trim()) { Alert.alert('Name your preset', 'Enter a name before saving.'); return; } if (!selectedNode) { Alert.alert('Nothing selected', 'Select a component or use the full screen to save a preset.'); return; } try { const saved = await saveCustomDesignPreset(presetName, selectedNode); setCustomPresets(current => [saved, ...current]); setPresetName(''); Alert.alert('Preset saved', 'Available in My Presets on this device.'); } catch (error) { Alert.alert('Could not save preset', error instanceof Error ? error.message : 'Please try again.'); } }; const targetParentId = selectedNodeId || rootNode.id; const catalog: CatalogItem[] = useMemo(() => [ ...PREBUILT_TEMPLATES.map((item, index) => ({ @@ -160,8 +167,9 @@ export const TemplateLibrary = () => { category: index < 2 ? 'Component Kits' : 'Complete Screens', })), ...DESIGN_PRESETS.map((item) => ({ ...item, icon: '✦', deviceTag: item.styleName })), - ], []); - const categories = ['All', ...DESIGN_PRESET_CATEGORIES]; + ...customPresets.map(item => ({ ...item, icon: 'β˜…', deviceTag: 'Saved on this device' })), + ], [customPresets]); + const categories = ['All', ...DESIGN_PRESET_CATEGORIES, ...(customPresets.length ? ['My Presets'] : [])]; const filtered = catalog.filter((item) => (activeCategory === 'All' || item.category === activeCategory) && (item.name + ' ' + item.description + ' ' + item.category).toLowerCase().includes(search.toLowerCase()) @@ -185,10 +193,11 @@ export const TemplateLibrary = () => { ))} - {filtered.length} PRELOADED DESIGNS & COMPONENT KITS + Save your own variationβ˜† Save selection as preset + {filtered.length} DESIGNS & COMPONENT KITS {filtered.map((item) => ( - + {item.icon || '✦'} @@ -204,6 +213,7 @@ export const TemplateLibrary = () => { applyTemplateAsProject(item.node, item.name)}> Use as starting design + {item.category === 'My Presets' && Alert.alert('Delete preset?', item.name, [{ text: 'Cancel', style: 'cancel' }, { text: 'Delete', style: 'destructive', onPress: () => deleteCustomDesignPreset(item.id).then(() => setCustomPresets(items => items.filter(p => p.id !== item.id))) }])}>Delete saved preset} ))} @@ -215,6 +225,12 @@ export const TemplateLibrary = () => { const styles = StyleSheet.create({ container: { flex: 1, padding: 12 }, + savePanel: { backgroundColor: '#0f172a', borderColor: '#334155', borderWidth: 1, borderRadius: 12, padding: 10, gap: 7, marginTop: 8 }, + saveTitle: { color: '#e2e8f0', fontSize: 11, fontWeight: '800' }, + saveBtn: { backgroundColor: '#0f766e', padding: 10, borderRadius: 8, alignItems: 'center' }, + previewFrame: { height: 112, overflow: 'hidden', backgroundColor: '#f8fafc', borderRadius: 8, padding: 7, marginBottom: 9 }, + deleteBtn: { padding: 7 }, + deleteText: { color: '#fca5a5', fontSize: 10, fontWeight: '700' }, title: { fontSize: 17, fontWeight: '900', color: '#f8fafc', letterSpacing: 0.2 }, subtitle: { fontSize: 11, color: '#94a3b8', marginTop: 4, marginBottom: 8, lineHeight: 16 }, search: { backgroundColor: '#0f172a', color: '#f8fafc', borderWidth: 1, borderColor: '#334155', borderRadius: 10, paddingHorizontal: 12, paddingVertical: 10, fontSize: 12 }, @@ -238,3 +254,14 @@ const styles = StyleSheet.create({ startBtnText: { color: '#e2e8f0', fontSize: 10, fontWeight: '800' }, empty: { color: '#94a3b8', textAlign: 'center', padding: 24, fontSize: 12 }, }); + + +const PresetMiniPreview: React.FC<{ node: ComponentNode }> = ({ node }) => { + const children = node.children || []; const style: any = node.style || {}; + const simple = node.type === 'Text' || node.type === 'Button' || children.length === 0; + const label = node.props?.text || node.props?.label || node.props?.placeholder || node.type; + return + {simple && {String(label)}} + {children.slice(0, 5).map(child => )} + ; +}; From 566d2175efd172a11f41695098d8cd527a36ca16 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:15:52 -0800 Subject: [PATCH 35/55] feat: add visual design system studio --- app/src/components/DesignSystemStudio.tsx | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 app/src/components/DesignSystemStudio.tsx diff --git a/app/src/components/DesignSystemStudio.tsx b/app/src/components/DesignSystemStudio.tsx new file mode 100644 index 0000000..c38e4db --- /dev/null +++ b/app/src/components/DesignSystemStudio.tsx @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { Alert, ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'; +import { ComponentNode } from '../types/schema'; +import { useEditorStore } from '../store/useEditorStore'; + +type Tokens = { primary: string; surface: string; canvas: string; text: string; muted: string; radius: number; spacing: number; fontSize: number }; +const PRESETS: Array<{ name: string; tokens: Tokens }> = [ + { name:'Midnight Blue',tokens:{primary:'#3b82f6',surface:'#1e293b',canvas:'#0f172a',text:'#f8fafc',muted:'#94a3b8',radius:12,spacing:16,fontSize:16}}, + { name:'Emerald',tokens:{primary:'#10b981',surface:'#064e3b',canvas:'#022c22',text:'#ecfdf5',muted:'#a7f3d0',radius:14,spacing:16,fontSize:16}}, + { name:'Warm Editorial',tokens:{primary:'#b45309',surface:'#fffbeb',canvas:'#fef3c7',text:'#292524',muted:'#78716c',radius:8,spacing:20,fontSize:17}}, + { name:'Violet Glass',tokens:{primary:'#a78bfa',surface:'#272044',canvas:'#120d24',text:'#f5f3ff',muted:'#c4b5fd',radius:18,spacing:18,fontSize:16}} +]; +const HEX=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; +const transformTree=(node:ComponentNode,t:Tokens):ComponentNode=>{ + const style:Record={...node.style,borderRadius:t.radius}; + if(node.type==='Container'){style.backgroundColor=t.canvas;style.padding=t.spacing;} + if(node.type==='Card'){style.backgroundColor=t.surface;style.padding=t.spacing;} + if(node.type==='Button'||node.type==='Badge')style.backgroundColor=t.primary; + if(node.type==='Text'){style.color=t.text;style.fontSize=t.fontSize;} + if(node.type==='Input'){style.backgroundColor=t.surface;style.color=t.text;} + return {...node,style,children:node.children?.map(child=>transformTree(child,t))}; +}; +export const DesignSystemStudio=()=>{ + const [tokens,setTokens]=useState(PRESETS[0].tokens); + const [presetName,setPresetName]=useState(PRESETS[0].name); + const valid=[tokens.primary,tokens.surface,tokens.canvas,tokens.text,tokens.muted].every(v=>HEX.test(v)); + const update=(key:keyof Tokens,value:string)=>setTokens(current=>({...current,[key]:['radius','spacing','fontSize'].includes(key)?Number(value):value})); + const apply=()=>{ + if(!valid){Alert.alert('Invalid color','Use a valid 3- or 6-digit HEX color.');return;} + if(!Number.isFinite(tokens.radius)||tokens.radius<0||tokens.radius>48||!Number.isFinite(tokens.spacing)||tokens.spacing<0||tokens.spacing>64||!Number.isFinite(tokens.fontSize)||tokens.fontSize<8||tokens.fontSize>48){Alert.alert('Invalid dimensions','Use radius 0–48, spacing 0–64, and font size 8–48.');return;} + const state=useEditorStore.getState(); + useEditorStore.setState({history:[...state.history,state.rootNode],future:[],rootNode:transformTree(state.rootNode,tokens)}); + Alert.alert('Design system applied','Mapped component styles were updated. One Undo restores the previous canvas.'); + }; + const fields:Array<[keyof Tokens,string]>=[['primary','Primary / action'],['surface','Card / input surface'],['canvas','Container background'],['text','Primary text'],['muted','Secondary text']]; + return + Design System Studio + Create a consistent visual language, preview it, then explicitly apply it to the current screen. Mapped component colors and dimensions will be replaced; unrelated properties are preserved. + Starter systems{PRESETS.map(p=>{setTokens(p.tokens);setPresetName(p.name);}} style={[styles.preset,presetName===p.name&&styles.selected]}>{p.name})} + Color tokens (HEX){fields.map(([key,label])=>{label}update(key,v)} style={styles.input}/>)} + Typography & shape{(['fontSize','radius','spacing'] as const).map(key=>{key==='fontSize'?'Base text size':key==='radius'?'Corner radius':'Container padding'}update(key,v)} style={styles.input}/>)} + Live token previewYour screen titleSupporting text and descriptionsContent cardPrimary action + Apply design system to current canvas + Mapping: Container = canvas; Card = surface; Button and Badge = primary; Input = surface and text; Text = primary text and base size. All mapped nodes receive the selected corner radius. Save or export the project to preserve applied styles. + ; +}; +const styles=StyleSheet.create({container:{padding:14},title:{fontSize:18,fontWeight:'800',color:'#f8fafc'},help:{fontSize:11,lineHeight:17,color:'#94a3b8',marginTop:6,marginBottom:14},heading:{fontSize:13,fontWeight:'700',color:'#38bdf8',marginTop:14,marginBottom:8},row:{flexDirection:'row',flexWrap:'wrap',gap:8},preset:{width:'48%',padding:10,borderRadius:8,borderWidth:1,borderColor:'#475569',backgroundColor:'#1e293b'},selected:{borderColor:'#3b82f6',borderWidth:2},swatches:{flexDirection:'row',gap:6,marginBottom:7},dot:{width:18,height:18,borderRadius:9,borderWidth:1,borderColor:'#64748b'},presetText:{fontSize:11,color:'#f8fafc',fontWeight:'600'},field:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:8},label:{flex:1,fontSize:11,color:'#cbd5e1'},input:{width:104,backgroundColor:'#0f172a',color:'#f8fafc',padding:8,borderRadius:6,borderWidth:1,borderColor:'#475569',fontSize:12},sample:{width:28,height:28,borderRadius:6,borderWidth:1,borderColor:'#64748b'},preview:{padding:14,borderWidth:1,borderColor:'#475569',marginTop:4},previewCard:{marginTop:12},previewButton:{alignSelf:'flex-start',paddingHorizontal:14,paddingVertical:9,marginTop:12},apply:{marginTop:16,padding:13,backgroundColor:'#2563eb',borderRadius:8,alignItems:'center'},applyText:{color:'#fff',fontSize:12,fontWeight:'800'},note:{fontSize:10,color:'#94a3b8',lineHeight:15,marginTop:8}}); From 1593f450b50357606ca80afe8ce6610c1728602d Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:15:54 -0800 Subject: [PATCH 36/55] feat: expose design system studio in editor navigation --- app/App.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/App.tsx b/app/App.tsx index 4c4625d..08e61d6 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -22,6 +22,7 @@ import { PropertyInspector } from './src/components/PropertyInspector'; import { LayerReorderManager } from './src/components/LayerReorderManager'; import { TemplateLibrary } from './src/templates/TemplateLibrary'; import { ThemeManager } from './src/components/ThemeManager'; +import { DesignSystemStudio } from './src/components/DesignSystemStudio'; import { ProjectManager } from './src/components/ProjectManager'; import { AssetPickerStudio } from './src/components/AssetPickerStudio'; import { ViewportSelector, VIEWPORTS, ViewportMode } from './src/components/ViewportSelector'; @@ -60,7 +61,7 @@ export default function App() { const theme = THEMES[currentTheme] || THEMES.dark; const isLightMode = currentTheme === 'light'; - const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io' | 'icons' | 'device'>('inspector'); + const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io' | 'design_system' | 'icons' | 'device'>('inspector'); const [activeViewport, setActiveViewport] = useState('galaxy_s24_ultra'); const [modalVisible, setModalVisible] = useState(false); const [codeOutput, setCodeOutput] = useState(''); @@ -236,6 +237,9 @@ export default function App() { setActiveTab('theme')}> βš™οΈ Theme + setActiveTab('design_system')}> + 🎨 Design System + {activeTab === 'icons' && } @@ -267,6 +271,7 @@ export default function App() { {activeTab === 'projects' && } {activeTab === 'layers' && } {activeTab === 'theme' && } + {activeTab === 'design_system' && } From 682bd7acc34659954cd90ed050403caa5e7144be Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:15:57 -0800 Subject: [PATCH 37/55] docs: describe design system studio --- docs/DESIGN_SYSTEM_STUDIO.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/DESIGN_SYSTEM_STUDIO.md diff --git a/docs/DESIGN_SYSTEM_STUDIO.md b/docs/DESIGN_SYSTEM_STUDIO.md new file mode 100644 index 0000000..0fc3c4e --- /dev/null +++ b/docs/DESIGN_SYSTEM_STUDIO.md @@ -0,0 +1,25 @@ +# DroidUI Design System Studio + +## Purpose +A screen-level visual consistency tool that allows creators to preview and deliberately apply a coherent design language. + +## Included +- Four starter systems: Midnight Blue, Emerald, Warm Editorial, and Violet Glass. +- Editable HEX tokens for primary actions, surfaces, canvas/container backgrounds, primary text, and secondary text. +- Editable base text size, corner radius, and container padding. +- Live preview of title, supporting copy, content card, and primary action. +- Explicit apply action that updates supported component types in the current tree. +- One undo checkpoint before applying. + +## Apply mapping +- Container: canvas background and spacing. +- Card: surface background and spacing. +- Button and Badge: primary action color. +- Input: surface background and primary text. +- Text: primary text color and base font size. +- All mapped nodes receive the selected corner radius. + +Applying a system intentionally replaces mapped colors and dimensions while preserving unrelated style properties and component props. Numeric bounds: radius 0–48, spacing 0–64, font size 8–48. HEX accepts 3- or 6-digit values. + +## Persistence +Applied values are stored in the component tree and therefore flow through existing project save and .dui export workflows. Reusable user-defined token libraries and project-level named theme persistence remain future work. From 098e6ee3be7632d3c4206a3623065cec71c5faf2 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:18:59 -0800 Subject: [PATCH 38/55] feat: add premium component preset collection --- app/src/templates/designPresets.ts | 99 +++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/app/src/templates/designPresets.ts b/app/src/templates/designPresets.ts index ee7e639..6694d08 100644 --- a/app/src/templates/designPresets.ts +++ b/app/src/templates/designPresets.ts @@ -1,6 +1,6 @@ import { ComponentNode } from '../types/schema'; -export type DesignPresetCategory = 'Complete Screens' | 'Component Kits' | 'Navigation' | 'Forms' | 'Cards & Content'; +export type DesignPresetCategory = 'Complete Screens' | 'Component Kits' | 'Navigation' | 'Forms' | 'Cards & Content' | 'Premium Components'; export interface DesignPreset { id: string; name: string; @@ -183,6 +183,101 @@ export const DESIGN_PRESETS: DesignPreset[] = [ styleName: 'Glass Dark', node: card('kit_glass', [text('glass_tag', 'INSIGHT', 10, '#67e8f9', 'bold'), text('glass_title', 'Your next idea starts here.', 21, '#ffffff', 'bold'), text('glass_body', 'A reusable glass-style panel for modern interfaces.', 13, '#cbd5e1')], 'rgba(15, 23, 42, 0.92)', '#475569'), }, + + { + id: 'premium_creator_hero', name: 'Creator Spotlight Hero', category: 'Premium Components', + description: 'Editorial creator header with portrait placeholder, verification mark, stats and follow action.', + styleName: 'Creator Spotlight', + node: card('premium_creator_hero', [ + { id: 'creator_cover', type: 'Container', style: { height: 74, backgroundColor: '#312e81', borderRadius: 14, justifyContent: 'center', alignItems: 'center' }, children: [text('creator_cover_mark', '✦ CREATOR SPOTLIGHT', 11, '#e0e7ff', 'bold')] }, + { id: 'creator_identity', type: 'Container', style: { flexDirection: 'row', alignItems: 'center', gap: 10, marginTop: 10 }, children: [ + { id: 'creator_avatar', type: 'Icon', props: { iconSymbol: 'β—‰' }, style: { fontSize: 42, color: '#818cf8' } }, + { id: 'creator_name_group', type: 'Container', style: { flex: 1 }, children: [text('creator_name', 'Alex Morgan βœ“', 17, '#0f172a', 'bold'), text('creator_handle', '@alexcreates', 12, '#64748b')] }, + ]}, + text('creator_bio', 'Designer β€’ storyteller β€’ building what is next.', 13, '#475569'), + { id: 'creator_stats', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-around', paddingVertical: 10 }, children: [text('creator_posts', '128 posts', 11, '#334155', 'bold'), text('creator_followers', '24.8K followers', 11, '#334155', 'bold'), text('creator_likes', '96K likes', 11, '#334155', 'bold')] }, + button('creator_follow_action', 'οΌ‹ Follow creator', '#4f46e5'), + ], '#ffffff', '#e0e7ff'), + }, + { + id: 'premium_pricing', name: 'SaaS Pricing Selector', category: 'Premium Components', + description: 'Three-tier pricing presentation with a highlighted recommended plan.', + styleName: 'Product Pricing', + node: { id: 'premium_pricing', type: 'Container', style: { padding: 12, backgroundColor: '#f8fafc' }, children: [ + text('pricing_heading', 'Choose your plan', 23, '#0f172a', 'bold'), + card('pricing_basic', [text('pricing_basic_name', 'STARTER', 11, '#64748b', 'bold'), text('pricing_basic_price', '$0 / month', 24, '#0f172a', 'bold'), text('pricing_basic_desc', 'Explore the essentials.', 12, '#64748b'), button('pricing_basic_cta', 'Get started', '#334155')]), + card('pricing_pro', [text('pricing_pro_badge', 'MOST POPULAR', 10, '#c4b5fd', 'bold'), text('pricing_pro_name', 'PRO', 12, '#ffffff', 'bold'), text('pricing_pro_price', '$19 / month', 26, '#ffffff', 'bold'), text('pricing_pro_desc', 'More power for growing teams.', 12, '#e0e7ff'), button('pricing_pro_cta', 'Start free trial', '#8b5cf6')], '#312e81', '#6366f1'), + card('pricing_team', [text('pricing_team_name', 'TEAM', 11, '#64748b', 'bold'), text('pricing_team_price', '$49 / month', 24, '#0f172a', 'bold'), text('pricing_team_desc', 'Collaboration at scale.', 12, '#64748b'), button('pricing_team_cta', 'Contact sales', '#0f766e')]), + ]}, + }, + { + id: 'premium_media_player', name: 'Media Player Card', category: 'Premium Components', + description: 'Compact audio/video player treatment with cover placeholder, timeline and playback controls.', + styleName: 'Media Studio', + node: card('premium_media_player', [ + { id: 'media_cover', type: 'Container', style: { height: 110, backgroundColor: '#172554', borderRadius: 12, justifyContent: 'center', alignItems: 'center' }, children: [text('media_cover_symbol', 'β™«', 42, '#bfdbfe', 'bold')] }, + text('media_title', 'Midnight Sessions', 17, '#0f172a', 'bold'), text('media_artist', 'Original audio β€’ 03:42', 11, '#64748b'), + { id: 'media_progress', type: 'ProgressBar', props: { label: '01:24 / 03:42', progress: 38, barColor: '#6366f1' }, style: { marginVertical: 8 } }, + { id: 'media_controls', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center' }, children: [text('media_prev', 'β—€β—€', 16, '#475569'), text('media_play', 'β–Ά', 25, '#4f46e5', 'bold'), text('media_next', 'β–Άβ–Ά', 16, '#475569')] }, + ]), + }, + { + id: 'premium_stats_glass', name: 'Glass Analytics KPI', category: 'Premium Components', + description: 'Dark glass-inspired metric card with trend indicator, value and progress visualization.', + styleName: 'Glass Analytics', + node: card('premium_stats_glass', [ + text('stats_label', 'TOTAL REVENUE', 10, '#a5b4fc', 'bold'), text('stats_value', '$128,450', 30, '#ffffff', 'bold'), + text('stats_trend', 'β†— +18.6% vs last month', 12, '#6ee7b7', 'bold'), + { id: 'stats_chart', type: 'Graph', props: { title: 'Performance trend', values: [24, 32, 28, 45, 42, 61, 74] }, style: { height: 90 } }, + ], '#111827', '#3730a3'), + }, + { + id: 'premium_notification', name: 'Smart Notification Toast', category: 'Premium Components', + description: 'Compact notification with icon, message, timestamp and action affordance.', + styleName: 'Notification Surface', + node: card('premium_notification', [ + { id: 'notification_row', type: 'Container', style: { flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [ + { id: 'notification_icon', type: 'Icon', props: { iconSymbol: '✦' }, style: { fontSize: 25, color: '#4f46e5' } }, + { id: 'notification_copy', type: 'Container', style: { flex: 1 }, children: [text('notification_title', 'Your design is ready', 13, '#0f172a', 'bold'), text('notification_body', 'Your latest export finished successfully.', 11, '#64748b')] }, + text('notification_time', 'now', 10, '#94a3b8'), + ]}, + text('notification_action', 'View export β†’', 11, '#4f46e5', 'bold'), + ]), + }, + { + id: 'premium_profile_completion', name: 'Profile Completion Panel', category: 'Premium Components', + description: 'Onboarding progress card with completion meter and next-step action.', + styleName: 'Onboarding Pro', + node: card('premium_profile_completion', [ + text('completion_label', 'YOUR WORKSPACE', 10, '#64748b', 'bold'), text('completion_title', 'Complete your profile', 19, '#0f172a', 'bold'), + { id: 'completion_progress', type: 'ProgressBar', props: { label: '3 of 5 steps completed', progress: 60, barColor: '#0d9488' }, style: { marginVertical: 8 } }, + text('completion_tip', 'Add a profile image and connect your social accounts to finish setup.', 12, '#64748b'), + button('completion_action', 'Continue setup', '#0f766e'), + ]), + }, + { + id: 'premium_social_post', name: 'Social Post Composer', category: 'Premium Components', + description: 'Social content composer with avatar, text entry placeholder, media action row and publish CTA.', + styleName: 'Social Creator', + node: card('premium_social_post', [ + { id: 'social_author', type: 'Container', style: { flexDirection: 'row', alignItems: 'center', gap: 8 }, children: [{ id: 'social_avatar', type: 'Icon', props: { iconSymbol: 'β—‰' }, style: { fontSize: 32, color: '#7c3aed' } }, text('social_author_name', 'Your creator profile', 13, '#0f172a', 'bold')] }, + text('social_prompt', 'What would you like to share with your community?', 14, '#475569'), + { id: 'social_media_actions', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-around', paddingVertical: 8 }, children: [text('social_photo', 'β–§ Photo', 11, '#0d9488'), text('social_video', 'β–· Video', 11, '#7c3aed'), text('social_tag', '@ Mention', 11, '#2563eb')] }, + button('social_publish', 'Prepare post', '#7c3aed'), + ]), + }, + { + id: 'premium_feature_comparison', name: 'Feature Comparison Table', category: 'Premium Components', + description: 'Plan comparison layout with feature rows and highlighted recommended tier.', + styleName: 'Comparison Grid', + node: card('premium_feature_comparison', [ + text('compare_title', 'Compare plans', 20, '#0f172a', 'bold'), + { id: 'compare_header', type: 'Container', style: { flexDirection: 'row', justifyContent: 'space-between' }, children: [text('compare_feature', 'FEATURE', 10, '#64748b', 'bold'), text('compare_free', 'FREE', 10, '#64748b', 'bold'), text('compare_pro', 'PRO', 10, '#4f46e5', 'bold')] }, + ...['Projects 3 Unlimited','Cloud assets β€” βœ“','Premium kits β€” βœ“','Priority export β€” βœ“'].map((line,i)=>text('compare_row_'+i,line,11,'#334155')), + button('compare_action', 'Choose Pro', '#4f46e5'), + ]), + }, + ]; -export const DESIGN_PRESET_CATEGORIES: DesignPresetCategory[] = ['Complete Screens', 'Component Kits', 'Navigation', 'Forms', 'Cards & Content']; +export const DESIGN_PRESET_CATEGORIES: DesignPresetCategory[] = ['Complete Screens', 'Component Kits', 'Navigation', 'Forms', 'Cards & Content', 'Premium Components']; From b72a936259aaad5259bf95693e324fafa4aab061 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:19:34 -0800 Subject: [PATCH 39/55] docs: plan premium studio feature expansion --- docs/PREMIUM_STUDIO_EXPANSION_ROADMAP.md | 146 +++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 docs/PREMIUM_STUDIO_EXPANSION_ROADMAP.md diff --git a/docs/PREMIUM_STUDIO_EXPANSION_ROADMAP.md b/docs/PREMIUM_STUDIO_EXPANSION_ROADMAP.md new file mode 100644 index 0000000..e5cec2a --- /dev/null +++ b/docs/PREMIUM_STUDIO_EXPANSION_ROADMAP.md @@ -0,0 +1,146 @@ +# DroidUI Premium Studio Expansion Roadmap + +## Product direction +DroidUI is evolving from a component-based mobile UI editor into a mobile-first app design and asset-production studio. The expansion is organized into independent modules so each can be implemented, tested, and shipped without pretending that a visual mockup is a working platform integration. + +## 1. Premium component collection + +### First delivered collection +The Template Library now includes a **Premium Components** category with eight reusable, editable component-tree presets: +- Creator Spotlight Hero +- SaaS Pricing Selector +- Media Player Card +- Glass Analytics KPI +- Smart Notification Toast +- Profile Completion Panel +- Social Post Composer +- Feature Comparison Table + +These are real ComponentNode trees built from the schema's currently supported primitives. They can be inserted and customized like other design presets. They are not yet new native runtime component types. + +### Next premium packs +- Commerce: product cards, cart summary, checkout steps, product gallery, review summary. +- Communication: chat bubbles, inbox rows, message composer, call controls. +- Data: KPI dashboards, charts, filter panels, empty states, loading skeletons. +- Identity: profile cards, verification marks, creator badges, membership tiers. +- Navigation: tab bars, drawers, breadcrumbs, segmented controls. +- Subscription: paywall, trial banner, entitlement card, plan selector. +- Accessibility: large-touch controls, high-contrast presets, accessible form groups. + +## 2. Special elements + +Build these as explicit schema types only when their rendering and export contracts exist: +- Lottie/vector animation player with reduced-motion fallback. +- Video and audio player controls with local asset references. +- Maps/location preview with permission-aware runtime behavior. +- QR/barcode generator and scanner surfaces. +- Charts, gauges, timers, countdowns and progress rings. +- Rich text, markdown, code blocks and syntax-highlighted panels. +- Web content/embed frame with domain allow-list and external-open fallback. +- Camera/media capture affordances with permission states. +- Haptics and sound action bindings. +- Gesture surfaces, swipe actions and draggable cards. + +Each special element needs a typed props schema, editor inspector, preview behavior, React Native generator mapping, Android generator mapping or a clear unsupported-target diagnostic, accessibility behavior, and tests. A visual placeholder alone must not be represented as a functional feature. + +## 3. Social media integration + +### Editor-side features +- Platform-specific preview presets for Instagram posts/stories/reels, TikTok vertical video, YouTube thumbnails/banners, Facebook posts/covers, and X posts. +- Social profile, follow, share, embed, post composer, media carousel and engagement component kits. +- Safe share-sheet action and copy-link actions. +- Content dimension presets and crop-safe guides. + +### Account integrations +Actual account linking requires provider-approved OAuth flows and a secure backend. Do not put provider client secrets or long-lived access tokens in the mobile app. Use server-side token exchange, encrypted token storage, revocation, minimum scopes, audit logs and explicit user consent. Publishing APIs differ by platform and account type; ship each provider as a separate adapter after its current API requirements are verified. Do not promise arbitrary cross-platform auto-publishing. + +## 4. Built-in web browser + +Create a browser workspace with: +- URL/address input, back/forward, reload and home. +- Loading/progress and network error states. +- Page preview inside a sandboxed WebView. +- Open externally, copy URL and add current page as a design reference. +- Optional desktop/mobile viewport toggle for responsive inspection. + +Security requirements: +- Restrict navigation to HTTP/HTTPS and block dangerous schemes. +- Handle external links with explicit confirmation or system browser handoff. +- Disable file access, universal file access, mixed content and JavaScript bridges unless a reviewed feature requires them. +- Do not inject credentials or expose app internals to page scripts. +- Treat downloaded HTML and page content as untrusted. +- Provide clear privacy messaging; do not silently collect browsing history. + +Implementation choice: evaluate a compatible React Native WebView package for the app's Expo SDK 50 / React Native 0.73 baseline. Confirm native config-plugin/prebuild compatibility before adding it. A lightweight external-browser handoff can ship earlier than embedded browsing. + +## 5. App Icon Maker + +Dedicated icon workspace: +- Square canvas with safe-zone guides and live rounded-mask previews. +- Background color/gradient, image import, SVG/vector placement, text, shapes, layers and alignment. +- Preset visual directions and brand palettes. +- Android adaptive icon foreground/background and monochrome layer support where target SDK permits. +- Export Android density assets and adaptive icon resources, plus iOS AppIcon catalog assets. +- Validate dimensions, transparency, contrast, safe area and missing variants. +- Bundle generated assets into Android project export; provide a preview sheet before export. + +Do not claim platform-compliant icon generation until all required output sizes and manifest/catalog references are validated. + +## 6. Materials importing / asset manager + +Support import flows for: +- Raster images: PNG, JPG/JPEG, WebP, GIF (with animation support status shown). +- Vector: SVG with sanitization and size limits. +- Fonts: TTF/OTF with license/source metadata. +- Audio: MP3, M4A, WAV, AAC. +- Video: MP4 and MOV where device codecs support them. +- JSON/Lottie animation files after schema validation. +- Project resources and bundled asset packs. + +Requirements: +- Native document picker and file-system integration; inspect MIME type, extension, actual file signature, file size and dimensions. +- Preview before importing; rename, categorize, tag, replace and remove. +- Stable asset IDs, deduplication, usage counts, missing-reference diagnostics and project-relative references. +- Never trust filenames or MIME declarations alone. +- Avoid embedding large base64 assets in project JSON. Prefer managed file URIs and portable asset bundles with explicit export/import handling. +- Show license/source fields and warn that imported assets may have usage restrictions. + +## Delivery sequence + +### Phase A β€” Premium library (started) +- [x] Add eight Premium Components presets using current supported node primitives. +- [ ] Add Commerce, Communication, Data and Identity packs. +- [ ] Add visual preview cards and tags for platform, use case and complexity. +- [ ] Add snapshot tests for preset node trees and insertion behavior. + +### Phase B β€” Materials pipeline +- [ ] Add document picker and file-system dependencies compatible with the current Expo SDK. +- [ ] Centralize asset import, validation, metadata, preview, persistence and export. +- [ ] Migrate large embedded image payloads to managed asset references without breaking existing projects. +- [ ] Add font/audio/video import and format-specific previews. + +### Phase C β€” App Icon Maker +- [ ] Create editable icon canvas and layer model. +- [ ] Generate Android adaptive icon assets and iOS icon catalog. +- [ ] Add export diagnostics and fixture tests. + +### Phase D β€” Social Studio +- [ ] Add platform format presets and safe-zone previews. +- [ ] Add share-sheet and deep-link actions. +- [ ] Add server-side OAuth provider adapters only after API and policy review. + +### Phase E β€” Browser workspace +- [ ] First deliver external browser handoff and responsive URL preview. +- [ ] Add embedded WebView only after Expo/native compatibility and security review. +- [ ] Add responsive capture/reference workflow. + +### Phase F β€” Special elements +- [ ] Add typed element contracts and renderer support incrementally. +- [ ] Gate unsupported code-generation targets with explicit diagnostics. +- [ ] Add accessibility, permissions, security and automated validation for each element. + +## Current dependency baseline +The app currently declares Expo ~50.0.0 and React Native 0.73.2. The package manifest includes Expo ImagePicker, Clipboard, AsyncStorage, SVG, and vector icons. It does not currently declare a document picker, file-system, sharing, or WebView dependency. Any dependency additions must be checked against this Expo SDK baseline rather than installing latest package versions blindly. + +## Definition of done +A feature is complete only when its editor UI, typed data model, persisted project representation, renderer/preview, export behavior, error handling, accessibility, documentation and relevant automated tests are implemented. OAuth/API integrations and embedded browsing also require security review. CI green and a real Android device test are required before calling a release ready. From 1e22a7e249c9a85fa73d635b0ee9621c2f070eee Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:19:57 -0800 Subject: [PATCH 40/55] fix: remove literal newline escape from TypeScript source --- app/src/components/DeviceDetectionStudio.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/DeviceDetectionStudio.tsx b/app/src/components/DeviceDetectionStudio.tsx index f9a9311..c1be367 100644 --- a/app/src/components/DeviceDetectionStudio.tsx +++ b/app/src/components/DeviceDetectionStudio.tsx @@ -35,7 +35,8 @@ export function DeviceDetectionStudio({ onDetected }: { onDetected?: () => void const detect = () => { const next = detectCurrentDeviceProfile(); setProfile(next); - setStatus('Device profile detected');\n onDetected?.(); + setStatus('Device profile detected'); + onDetected?.(); }; return DEVICE INTELLIGENCEDetect & DesignRead the current Android device identity and live display metrics, then create a project canvas sized to its available screen in dp. From b39bcab314d41078cdaad72dee581b4818d6fa18 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:19:59 -0800 Subject: [PATCH 41/55] fix: remove literal newline escape from TypeScript source --- app/src/components/PropertyInspector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/PropertyInspector.tsx b/app/src/components/PropertyInspector.tsx index ca2c5a5..b2a4c4c 100644 --- a/app/src/components/PropertyInspector.tsx +++ b/app/src/components/PropertyInspector.tsx @@ -258,7 +258,8 @@ const styles = StyleSheet.create({ header: { fontSize: 14, fontWeight: 'bold', color: '#f8fafc' }, typeTag: { fontSize: 11, color: '#3b82f6', marginBottom: 12 }, section: { marginBottom: 16 }, - sectionTitle: { fontSize: 12, fontWeight: '600', color: '#cbd5e1', marginBottom: 8 },\n helperText: { fontSize: 10, color: '#94a3b8', marginBottom: 8, lineHeight: 14 }, + sectionTitle: { fontSize: 12, fontWeight: '600', color: '#cbd5e1', marginBottom: 8 }, + helperText: { fontSize: 10, color: '#94a3b8', marginBottom: 8, lineHeight: 14 }, addBtnGrid: { flexDirection: 'row', gap: 6, flexWrap: 'wrap' }, addBtn: { backgroundColor: '#334155', padding: 8, borderRadius: 6, flex: 1, minWidth: '45%', alignItems: 'center' }, addBtnText: { color: '#ffffff', fontSize: 11, fontWeight: 'bold' }, From 52fea7da7feaa5a3bea70153ed148237ae29634b Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:20:02 -0800 Subject: [PATCH 42/55] fix: remove literal newline escape from TypeScript source --- app/src/components/ViewportSelector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/ViewportSelector.tsx b/app/src/components/ViewportSelector.tsx index 63f28c5..7324051 100644 --- a/app/src/components/ViewportSelector.tsx +++ b/app/src/components/ViewportSelector.tsx @@ -10,7 +10,8 @@ export type ViewportMode = | 'pixel_tablet' | 'compact_phone' | 'wear_os_watch' - | 'android_tv'\n | 'detected_device'; + | 'android_tv' + | 'detected_device'; export interface ViewportSpec { id: ViewportMode; From fa31c69cfa77f4458371604e01f79effe80dcfb7 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:20:05 -0800 Subject: [PATCH 43/55] fix: remove literal newline escape from TypeScript source --- app/src/components/ViewportSelector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/components/ViewportSelector.tsx b/app/src/components/ViewportSelector.tsx index 7324051..f2e486b 100644 --- a/app/src/components/ViewportSelector.tsx +++ b/app/src/components/ViewportSelector.tsx @@ -104,7 +104,8 @@ interface Props { } export const ViewportSelector: React.FC = ({ activeViewport, onSelectViewport }) => { - const detected = activeViewport === 'detected_device';\n const activeVP = detected ? detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); + const detected = activeViewport === 'detected_device'; + const activeVP = detected ? detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude] || VIEWPORTS.galaxy_s24_ultra); return ( From be8398ada2e7c7170a53c81fbd59a4f4bcbf7405 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:32:56 -0800 Subject: [PATCH 44/55] ci: run inspection gates on DroidUI editor feature branch --- .github/workflows/inspection-gates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inspection-gates.yml b/.github/workflows/inspection-gates.yml index 552f2ec..bdbbf46 100644 --- a/.github/workflows/inspection-gates.yml +++ b/.github/workflows/inspection-gates.yml @@ -2,7 +2,7 @@ name: DroidUI Inspection Gates on: pull_request: - branches: [main] + branches: [main, feat/phase-2h-editor-workspace-controls] push: branches: [main] workflow_dispatch: From eee10466cd18b74b837fab2ff4b3041fc026b42f Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:32:58 -0800 Subject: [PATCH 45/55] ci: run Android fixture build on DroidUI editor feature branch --- .github/workflows/android-generated-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-generated-build.yml b/.github/workflows/android-generated-build.yml index 9d635a8..5ff92ee 100644 --- a/.github/workflows/android-generated-build.yml +++ b/.github/workflows/android-generated-build.yml @@ -2,7 +2,7 @@ name: DroidUI Generated Android Build on: pull_request: - branches: [main] + branches: [main, feat/phase-2h-editor-workspace-controls] push: branches: [main] workflow_dispatch: From a1857caf56bdef0daec800eac826b1b29c1776b0 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:33:01 -0800 Subject: [PATCH 46/55] ci: enable DroidUI feature branch APK build and repair verification step --- .github/workflows/droidui-dev-apk.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/droidui-dev-apk.yml b/.github/workflows/droidui-dev-apk.yml index 3510e88..f0b3c22 100644 --- a/.github/workflows/droidui-dev-apk.yml +++ b/.github/workflows/droidui-dev-apk.yml @@ -3,13 +3,14 @@ name: DroidUI Real Android Dev APK on: workflow_dispatch: pull_request: - branches: [main] + branches: [main, feat/phase-2h-editor-workspace-controls] paths: - 'app/**' - '.github/workflows/droidui-dev-apk.yml' push: branches: - 'feat/phase-2g-release-integrity' + - 'feat/phase-2h-editor-workspace-controls' permissions: contents: read @@ -90,13 +91,7 @@ jobs: BADGING="$("$AAPT" dump badging "$APK")" grep -F "package: name='com.codephrex.droidstudio'" <<< "$BADGING" grep -F "application-label:'Droid Studio UI/UX'" <<< "$BADGING" - unzip -l "$APK" | grep -E 'assets/index.android.bundle uses: actions/upload-artifact@v4 - with: - name: droidui-real-dev-apk-${{ github.sha }} - path: app/android/app/build/outputs/apk/debug/app-debug.apk - if-no-files-found: error - retention-days: 14 - + unzip -l "$APK" | grep -q 'assets/index.android.bundle' echo "Verified: this artifact is the DroidUI application, not the generated test fixture." - name: Upload real DroidUI development APK From b4cbde341922f057bc36d59ce75bdfae9e48254b Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:33:19 -0800 Subject: [PATCH 47/55] ci: execute DroidUI validation on editor feature branch pushes --- .github/workflows/inspection-gates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inspection-gates.yml b/.github/workflows/inspection-gates.yml index bdbbf46..e73ad7f 100644 --- a/.github/workflows/inspection-gates.yml +++ b/.github/workflows/inspection-gates.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [main, feat/phase-2h-editor-workspace-controls] push: - branches: [main] + branches: [main, feat/phase-2h-editor-workspace-controls] workflow_dispatch: permissions: From 482d73a1e02ad307cfb8cac4ce8635d55f5a5298 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:33:22 -0800 Subject: [PATCH 48/55] ci: execute DroidUI validation on editor feature branch pushes --- .github/workflows/android-generated-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-generated-build.yml b/.github/workflows/android-generated-build.yml index 5ff92ee..7f2afca 100644 --- a/.github/workflows/android-generated-build.yml +++ b/.github/workflows/android-generated-build.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [main, feat/phase-2h-editor-workspace-controls] push: - branches: [main] + branches: [main, feat/phase-2h-editor-workspace-controls] workflow_dispatch: permissions: From eda873111face5bad1ebeb3198a4c8bb89a9947c Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:34:23 -0800 Subject: [PATCH 49/55] fix: use Expo Android resource helper for splash background --- app/plugins/withAndroidSplashBackground.js | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/app/plugins/withAndroidSplashBackground.js b/app/plugins/withAndroidSplashBackground.js index 612dbe1..3216b30 100644 --- a/app/plugins/withAndroidSplashBackground.js +++ b/app/plugins/withAndroidSplashBackground.js @@ -1,24 +1,20 @@ 'use strict'; -const { withAndroidColors } = require('@expo/config-plugins'); +const { AndroidConfig, withAndroidColors } = require('@expo/config-plugins'); + +const SPLASH_BACKGROUND_COLOR = '#080D1F'; +const SPLASH_BACKGROUND_RESOURCE = 'splashscreen_background'; module.exports = function withAndroidSplashBackground(config) { return withAndroidColors(config, (modConfig) => { - const resources = modConfig.modResults.resources || []; - const existing = resources.find( - (resource) => resource.$ && resource.$.name === 'splashscreen_background' + modConfig.modResults = AndroidConfig.Colors.assignColorValue( + modConfig.modResults, + { + name: SPLASH_BACKGROUND_RESOURCE, + value: SPLASH_BACKGROUND_COLOR + } ); - if (existing) { - existing._ = '#0B1020'; - } else { - resources.push({ - $: { name: 'splashscreen_background' }, - _: '#0B1020' - }); - } - - modConfig.modResults.resources = resources; return modConfig; }); }; From d3f93d60389153a3a012caed90df4f54d2dbf10b Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:34:25 -0800 Subject: [PATCH 50/55] ci: use supported Expo prebuild flags --- .github/workflows/droidui-dev-apk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/droidui-dev-apk.yml b/.github/workflows/droidui-dev-apk.yml index f0b3c22..34e3bf5 100644 --- a/.github/workflows/droidui-dev-apk.yml +++ b/.github/workflows/droidui-dev-apk.yml @@ -50,7 +50,7 @@ jobs: - name: Generate native Android project working-directory: app - run: npx expo prebuild --platform android --non-interactive --no-install + run: npx expo prebuild --platform android --no-install - name: Set up JDK 17 uses: actions/setup-java@v4 From a02cf116e8990207b431f7eb3af7df1ca9e26012 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:34:42 -0800 Subject: [PATCH 51/55] ci: verify APK label against DroidUI app identity --- .github/workflows/droidui-dev-apk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/droidui-dev-apk.yml b/.github/workflows/droidui-dev-apk.yml index 34e3bf5..691a826 100644 --- a/.github/workflows/droidui-dev-apk.yml +++ b/.github/workflows/droidui-dev-apk.yml @@ -90,7 +90,7 @@ jobs: AAPT="$ANDROID_HOME/build-tools/34.0.0/aapt" BADGING="$("$AAPT" dump badging "$APK")" grep -F "package: name='com.codephrex.droidstudio'" <<< "$BADGING" - grep -F "application-label:'Droid Studio UI/UX'" <<< "$BADGING" + grep -F "application-label:'DroidUI'" <<< "$BADGING" unzip -l "$APK" | grep -q 'assets/index.android.bundle' echo "Verified: this artifact is the DroidUI application, not the generated test fixture." From 6b5969cb716d0afdf690eeadf54e47ac30e61f90 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:09:39 -0800 Subject: [PATCH 52/55] ci: increase Gradle heap and limit Android build workers --- .github/workflows/droidui-dev-apk.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/droidui-dev-apk.yml b/.github/workflows/droidui-dev-apk.yml index 691a826..1260580 100644 --- a/.github/workflows/droidui-dev-apk.yml +++ b/.github/workflows/droidui-dev-apk.yml @@ -68,6 +68,33 @@ jobs: with: gradle-version: '8.6' + - name: Configure Gradle memory for Android CI + working-directory: app/android + shell: bash + run: | + python3 - <<'PY' + from pathlib import Path + import re + + path = Path("gradle.properties") + content = path.read_text() if path.exists() else "" + heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" + if re.search(r"(?m)^org\\.gradle\\.jvmargs=.*$", content): + content = re.sub(r"(?m)^org\\.gradle\\.jvmargs=.*$", heap, content) + else: + content = content.rstrip() + "\\n" + heap + "\\n" + settings = { + "org.gradle.parallel": "false", + "org.gradle.workers.max": "2", + } + for key, value in settings.items(): + content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content) + if not re.search(rf"(?m)^{re.escape(key)}=", content): + content = content.rstrip() + f"\\n{key}={value}\\n" + path.write_text(content) + print(path.read_text()) + PY + - name: Build real DroidUI debug APK working-directory: app/android run: gradle --no-daemon assembleDebug From 8f52f48ac3dd766afd90a29946ad7983354551b7 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:09:41 -0800 Subject: [PATCH 53/55] ci: increase Gradle heap and limit Android build workers --- .github/workflows/android-generated-build.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/android-generated-build.yml b/.github/workflows/android-generated-build.yml index 7f2afca..5ef7a86 100644 --- a/.github/workflows/android-generated-build.yml +++ b/.github/workflows/android-generated-build.yml @@ -73,6 +73,33 @@ jobs: with: gradle-version: '8.7' + - name: Configure Gradle memory for Android CI + working-directory: app/android + shell: bash + run: | + python3 - <<'PY' + from pathlib import Path + import re + + path = Path("gradle.properties") + content = path.read_text() if path.exists() else "" + heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" + if re.search(r"(?m)^org\\.gradle\\.jvmargs=.*$", content): + content = re.sub(r"(?m)^org\\.gradle\\.jvmargs=.*$", heap, content) + else: + content = content.rstrip() + "\\n" + heap + "\\n" + settings = { + "org.gradle.parallel": "false", + "org.gradle.workers.max": "2", + } + for key, value in settings.items(): + content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content) + if not re.search(rf"(?m)^{re.escape(key)}=", content): + content = content.rstrip() + f"\\n{key}={value}\\n" + path.write_text(content) + print(path.read_text()) + PY + - name: Build generated debug and release APKs working-directory: ${{ runner.temp }}/droidui-generated-android run: gradle --no-daemon assembleDebug assembleRelease From a2c50934470c8aeb99198e46dc2294aadb904db5 Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:10:00 -0800 Subject: [PATCH 54/55] fix: correct Gradle memory configuration in Android CI --- .github/workflows/droidui-dev-apk.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/droidui-dev-apk.yml b/.github/workflows/droidui-dev-apk.yml index 1260580..37ed10e 100644 --- a/.github/workflows/droidui-dev-apk.yml +++ b/.github/workflows/droidui-dev-apk.yml @@ -79,10 +79,10 @@ jobs: path = Path("gradle.properties") content = path.read_text() if path.exists() else "" heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" - if re.search(r"(?m)^org\\.gradle\\.jvmargs=.*$", content): - content = re.sub(r"(?m)^org\\.gradle\\.jvmargs=.*$", heap, content) + if re.search(r"(?m)^org\.gradle\.jvmargs=.*$", content): + content = re.sub(r"(?m)^org\.gradle\.jvmargs=.*$", heap, content) else: - content = content.rstrip() + "\\n" + heap + "\\n" + content = content.rstrip() + "\n" + heap + "\n" settings = { "org.gradle.parallel": "false", "org.gradle.workers.max": "2", @@ -90,7 +90,7 @@ jobs: for key, value in settings.items(): content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content) if not re.search(rf"(?m)^{re.escape(key)}=", content): - content = content.rstrip() + f"\\n{key}={value}\\n" + content = content.rstrip() + f"\n{key}={value}\n" path.write_text(content) print(path.read_text()) PY From e3278c2949e1d6920a14bbaaef75e2b5437f36da Mon Sep 17 00:00:00 2001 From: l2uler <335852737+CodePhrex@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:10:02 -0800 Subject: [PATCH 55/55] fix: correct Gradle memory configuration in Android CI --- .github/workflows/android-generated-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android-generated-build.yml b/.github/workflows/android-generated-build.yml index 5ef7a86..0381686 100644 --- a/.github/workflows/android-generated-build.yml +++ b/.github/workflows/android-generated-build.yml @@ -74,7 +74,7 @@ jobs: gradle-version: '8.7' - name: Configure Gradle memory for Android CI - working-directory: app/android + working-directory: ${{ runner.temp }}/droidui-generated-android shell: bash run: | python3 - <<'PY' @@ -84,10 +84,10 @@ jobs: path = Path("gradle.properties") content = path.read_text() if path.exists() else "" heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" - if re.search(r"(?m)^org\\.gradle\\.jvmargs=.*$", content): - content = re.sub(r"(?m)^org\\.gradle\\.jvmargs=.*$", heap, content) + if re.search(r"(?m)^org\.gradle\.jvmargs=.*$", content): + content = re.sub(r"(?m)^org\.gradle\.jvmargs=.*$", heap, content) else: - content = content.rstrip() + "\\n" + heap + "\\n" + content = content.rstrip() + "\n" + heap + "\n" settings = { "org.gradle.parallel": "false", "org.gradle.workers.max": "2", @@ -95,7 +95,7 @@ jobs: for key, value in settings.items(): content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content) if not re.search(rf"(?m)^{re.escape(key)}=", content): - content = content.rstrip() + f"\\n{key}={value}\\n" + content = content.rstrip() + f"\n{key}={value}\n" path.write_text(content) print(path.read_text()) PY