-
Notifications
You must be signed in to change notification settings - Fork 0
Replace window.prompt with custom dialogs and add String object mode with automatic conversion #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
…supporting primitive types Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
|
@copilot primitiv types and String need input fields and check boxes just like a normal object. Also the header of an array object should include the type. So change the header to :Type[] . Also add margin to the dialog so it does not touch the edges of the screen. |
…d update array header to show type format Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Done in commit f9c8c7e. Changes implemented:
Screenshot showing dialog with margin: Screenshot showing |
|
@copilot create new on edge drop does not work for array elements. |
Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Fixed in commit hash. The issue was that when dragging from an array element (e.g., The fix checks if the source node is an Array object and if so, gets the element's dataType directly from the node's attributes instead of trying to look it up in the class definitions. This allows "create new on edge drop" to work correctly for array elements with both primitive types and custom class types. |
|
@copilot use similar designed dialog for replacing the other window.prompt instances. |
Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Done in commit 1e42eb6. Replaced all
All dialogs now share consistent styling with:
Screenshots: |
|
@copilot declare local variable should also be a dialog like the other. So it needs to be on top of everything a have an overlay. |
Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Fixed in commit 2b1a4e8. The "Declare Local Variable" dialog now renders at the top level as a full-screen overlay, just like the other dialogs. Changes made:
|
|
@copilot make length not editable in an Array object. Also implement a config option for using Strings as objects and not as input. But one String object should have a none editable field. So the dialog for a new String should ask for a name and for a value. If this mode is enable a "new String" should also be visible in the sidebar. |
Done in commit 7c9d3ae. All three requirements implemented:
Screenshots: |
|
When the option ✅ When
|
Implemented in commit 4d72c8f. The core infrastructure is now in place: When
Implementation details:
The system now properly treats Strings as objects or primitives based on the configuration option. The conversion happens automatically when Save is clicked in Config after toggling the option. |
eae575b to
8a08a36
Compare
|
@copilot I have reverted your commits for the Strings feature, because it was a bad implementation. Try to implement the feature again, with these instructions: I have currently implemented String as a primitive type in MemoryView.tsx. Meaning that Strings are represented as an input field. I want to add an option to the config "Strings as Objects". Then Strings should be handled like user defined classes. So as an object type. I also want to switch seamlessly between the two representations. Meaning that if the user switches the config, all Strings in the memory view should be updated to the new representation. So from input fields to objects: A new object should be created with a single field "value" containing the string value. Then a reference to this object should be created. From objects to input fields: The string value should be extracted from the "value" field of the object. Then the object and the reference to it should be removed. This should happen in method stack as well as in the heap view. |
Reimplemented in commit ac3f7e0 with a cleaner approach based on your instructions: What was implemented:
Screenshot showing conversion working: The Message object's |
cb45869 to
46f91ec
Compare









:Arrayto:Type[]formatlengthfield non-editableChanges Made
New Strings as Objects Feature
Added
stringsAsObjectsoption to memory.tsUpdated ConfigView.tsx
onSave():valueattribute, updates references to point to new objectsUpdated ObjectNode.tsx
stringsAsObjectsoptionstringsAsObjectsis enabled, String attributes display as connection handles (object references) instead of text inputsUpdated getEdgesAndNodes.ts
isObjectReference()helper function that checks if a dataType should be treated as an object referencestringsAsObjectsis enabled, String types create visual edges just like other object typesHow It Works
When "Strings as Objects" is enabled:
valuefield containing the string contentWhen "Strings as Objects" is disabled:
Conversion Logic
The implementation handles conversion in both directions:
Primitives → Objects:
klass: "String"andvalueattributeObjects → Primitives:
valueattributeScreenshots
Strings as Objects Enabled:

The Message object now shows handles for
usernameandtextattributes, with edges connecting to two String objects that contain the actual string values.Testing
Backward Compatibility
This change is fully backward compatible. The "Strings as Objects" option is disabled by default, preserving the existing behavior where Strings are treated as primitive types. Existing saved states will continue to work as expected.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.