Skip to content

Container exe picker utkarsh#212

Merged
utkarshdalal merged 3 commits intomasterfrom
container-exe-picker-utkarsh
Oct 28, 2025
Merged

Container exe picker utkarsh#212
utkarshdalal merged 3 commits intomasterfrom
container-exe-picker-utkarsh

Conversation

@utkarshdalal
Copy link
Owner

@utkarshdalal utkarshdalal commented Oct 28, 2025

Summary by CodeRabbit

  • New Features

    • Added executable path dropdown selector in container configuration with automatic scanning and prioritization of commonly used game executables.
  • Refactor

    • Improved internal container data retrieval and management for enhanced stability.

@utkarshdalal utkarshdalal merged commit abe0b4d into master Oct 28, 2025
@utkarshdalal utkarshdalal deleted the container-exe-picker-utkarsh branch October 28, 2025 10:23
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request disables native C++ build configuration, introduces an executable path dropdown with file system scanning in the container configuration dialog, and refactors XServerScreen to retrieve the container once at screen creation instead of per-event.

Changes

Cohort / File(s) Summary
Build Configuration
app/build.gradle.kts
Disabled external native build for CMakeLists.txt by commenting out the externalNativeBuild block.
Executable Path Selection
app/src/main/java/app/gamenative/ui/component/dialog/ContainerConfigDialog.kt
Added ExecutablePathDropdown composable that scans A: drive recursively for .exe files, prioritizes common game executables, and displays results in a searchable dropdown. Replaced inline text field with dropdown in General and Drives sections. Includes helper functions for path derivation, executable prioritization, and system utility filtering.
Container State Management
app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt
Moved container retrieval from per-event handlers to screen creation time. Updated gameExe computation to use container.executablePath instead of dynamic lookup during window unmapping.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Dialog as ContainerConfigDialog
    participant Scan as scanExecutablesInADrive
    participant Dropdown as ExecutablePathDropdown
    
    User->>Dialog: Opens container config
    Dialog->>Dialog: LaunchedEffect triggered
    activate Dialog
    Dialog->>Scan: scanExecutablesInADrive(drives)
    activate Scan
    Scan->>Scan: Recursively scan A: drive
    Scan->>Scan: Filter .exe files
    Scan->>Scan: Prioritize common executables
    Scan-->>Dialog: Return sorted list
    deactivate Scan
    Dialog->>Dropdown: Display dropdown with options
    deactivate Dialog
    User->>Dropdown: Select executable
    Dropdown-->>Dialog: Update selection
Loading
sequenceDiagram
    participant Screen as XServerScreen
    participant Utils as ContainerUtils
    participant Handler as Event Handler
    
    Screen->>Utils: getContainer(context, appId)
    Utils-->>Screen: Return container instance
    activate Screen
    Note over Screen: Container held in scope
    Screen->>Screen: Event: onUpdateWindowContent
    Screen->>Screen: Use captured container ref
    deactivate Screen
    Screen->>Screen: Event: onUnmapWindow
    Screen->>Screen: Use container.executablePath
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Scanning logic: Review the recursive file system traversal in scanExecutablesInADrive for correctness, path handling, and performance on potentially large directory trees.
  • Prioritization heuristics: Verify getExecutablePriority logic and isSystemExecutable filtering are accurate and won't exclude legitimate game executables.
  • Compose dropdown integration: Confirm proper integration of Material 3 dropdown components and LaunchedEffect lifecycle management.
  • Container state refactoring: Validate that consolidating container retrieval to screen creation doesn't introduce stale state issues or race conditions in event handlers.

Possibly related PRs

Poem

🐰 A dropdown blooms where text fields were,
Scanning drives with exec-scanner's blur,
Container held and reused with care,
No more retrievals here and there! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch container-exe-picker-utkarsh

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2ac1c3 and 7e06bea.

📒 Files selected for processing (3)
  • app/build.gradle.kts (1 hunks)
  • app/src/main/java/app/gamenative/ui/component/dialog/ContainerConfigDialog.kt (3 hunks)
  • app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants