Skip to content

Conversation

Copy link

Copilot AI commented Oct 31, 2025

  • Investigate the issue and locate the problematic code
  • Fix the macOS Configure Bundler dialog to add text input fields
  • Review code and address feedback
  • Remove formatting-only changes
  • Keep iOS code unchanged
  • Final security check
  • Complete implementation

Issue Summary

The "Configure Bundler" screen in the dev menu was missing text input fields on macOS. The iOS version properly creates an alert with three text fields for IP, port, and entrypoint, but the macOS version only showed a simple alert with a message and a "Use bundled JS" button without any input fields.

Changes Made

Updated the macOS implementation in RCTDevMenu.mm to:

  • ✅ Add three NSTextField inputs for IP address, port, and entrypoint using NSAlert's accessoryView property
  • ✅ Implement proper button handlers for "Apply Changes", "Reset to Default", and "Cancel"
  • ✅ Match the iOS functionality for configuring the bundler location exactly
  • ✅ Keep iOS code section completely unchanged from original
  • ✅ Only modify the macOS section within the #else // [macOS block

Implementation Details

The implementation follows the same pattern used in RCTAlertManager.mm for adding text fields to NSAlert dialogs on macOS:

  1. Creates an NSView as an accessory view with frame 300x90 points
  2. Adds three NSTextField instances stacked vertically (30 points apart)
  3. Sets appropriate placeholders ("0.0.0.0", "8081", "index") matching iOS
  4. Handles three button responses (Apply Changes, Reset to Default, Cancel)
  5. Uses the same validation and configuration logic as iOS (inline in macOS section)

Code Organization

  • iOS section: Completely unchanged from original implementation
  • macOS section: New implementation with text input fields matching iOS behavior
  • Both platforms have their own inline logic to maintain clear separation

Testing

This is a UI-only change that requires manual testing on macOS. The expected behavior is:

  1. Open the dev menu (Cmd+D or shake gesture)
  2. Select "Configure Bundler"
  3. Verify three text input fields are displayed with placeholders
  4. Test "Apply Changes" button with various inputs
  5. Test "Reset to Default" button
  6. Test "Cancel" button

Security

Original prompt

This section details on the original issue you should resolve

<issue_title>[Dev Menu] TextInputs missing from "Configure Bundler" screen of dev menu</issue_title>
<issue_description>This is what the configure bundler screen looks like:

Image

There should be text inputs for "Input Packager IP", "port and entrypoint".. so something went wrong. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add text inputs to configure bundler screen Fix missing text inputs in macOS Configure Bundler dialog Oct 31, 2025
Copilot AI requested a review from Saadnajmi October 31, 2025 21:47
Copilot finished work on behalf of Saadnajmi October 31, 2025 21:47
@Saadnajmi
Copy link
Collaborator

@copilot Can you take out formatting only changes?

Copy link
Author

Copilot AI commented Oct 31, 2025

@copilot Can you take out formatting only changes?

Done. Removed the formatting change to line 130 that was unrelated to the feature. See commit 507e6f2.

Copilot finished work on behalf of Saadnajmi October 31, 2025 22:07
@Saadnajmi
Copy link
Collaborator

@copilot can we move around the ifdefs to share more code and put similar blocks of iOS and macOS code together?

Copy link
Author

Copilot AI commented Nov 1, 2025

@copilot can we move around the ifdefs to share more code and put similar blocks of iOS and macOS code together?

Refactored the code to extract the shared bundler configuration logic into a common applyBundlerConfig block. Now iOS and macOS share the same validation and configuration logic (lines 346-374), with only the UI presentation code being platform-specific. This reduces code duplication by ~40 lines. See commit e0824a4.

Copilot finished work on behalf of Saadnajmi November 1, 2025 00:06
@Saadnajmi
Copy link
Collaborator

@copilot No this edited the iOS portion of the ifdef. We need to keep the iOS part of the ifdef as unedited as possible

Copy link
Author

Copilot AI commented Nov 1, 2025

@copilot No this edited the iOS portion of the ifdef. We need to keep the iOS part of the ifdef as unedited as possible

Reverted the iOS section to its original state. Now only the macOS portion (within the #else // [macOS block) has been modified to add the text input fields. The iOS code remains completely unchanged from the base commit. See commit 673ab7c.

Copilot finished work on behalf of Saadnajmi November 1, 2025 00:15
@Saadnajmi
Copy link
Collaborator

Seems good
Screenshot 2025-10-31 at 5 15 17 PM

@Saadnajmi Saadnajmi marked this pull request as ready for review November 1, 2025 00:15
@Saadnajmi Saadnajmi requested a review from a team as a code owner November 1, 2025 00:15
@Saadnajmi Saadnajmi changed the title Fix missing text inputs in macOS Configure Bundler dialog fix: fix missing text inputs in macOS Configure Bundler dialog Nov 1, 2025
@Saadnajmi Saadnajmi changed the title fix: fix missing text inputs in macOS Configure Bundler dialog fix: add missing text inputs in macOS Configure Bundler dialog Nov 1, 2025
@Saadnajmi Saadnajmi merged commit e57e55c into main Nov 3, 2025
24 of 39 checks passed
@Saadnajmi Saadnajmi deleted the copilot/add-text-inputs-configure-bundler branch November 3, 2025 17:07
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.

[Dev Menu] TextInputs missing from "Configure Bundler" screen of dev menu

3 participants