Skip to content

Implement significant UI bug fixes#5

Merged
atomic-junky merged 31 commits into
monologue-tool:mainfrom
RailKill:dev
Jul 29, 2024
Merged

Implement significant UI bug fixes#5
atomic-junky merged 31 commits into
monologue-tool:mainfrom
RailKill:dev

Conversation

@RailKill

@RailKill RailKill commented Jul 28, 2024

Copy link
Copy Markdown
Collaborator

This PR fixes a bunch of visual UI bugs that were mostly present in Monologue even before v2.2.2:

Summary by Sourcery

This pull request addresses multiple visual UI bugs in the Monologue application and introduces several enhancements to improve user experience, including filename truncation, editable RootNodeID, and better file dialog handling.

  • Bug Fixes:
    • Fixed various visual UI bugs in the Monologue application.
    • Resolved an issue where the WelcomeWindow would lose focus, causing the cursor to not change to a pointing hand when hovering over buttons.
  • Enhancements:
    • Introduced a filename truncation function to handle long filenames in the UI.
    • Made RootNodeID editable and ensured all editable IDs cross-check between nodes and options to prevent duplicates.
    • Updated the file dialog handling to improve user experience when creating or opening files.
    • Enhanced the connection and disconnection logic in the GraphEdit to update node connections more reliably.
    • Improved the side panel to show or hide based on the selected graph node and its state.

RailKill and others added 28 commits July 27, 2024 20:30
Fix multiple links to new node created via picker
Fix to only disconnect picker_from_port
Fix graph connection issues caused by removal of ChoiceNode options
Implement option ID editing and copy notifications
@sourcery-ai

sourcery-ai Bot commented Jul 28, 2024

Copy link
Copy Markdown

Reviewer's Guide by Sourcery

This pull request addresses multiple visual UI bugs in the Monologue application, enhances file operation handling, and improves node connection logic. Additionally, it introduces filename truncation and refines ID management for nodes and options. Key changes include the addition of filename truncation, dynamic node connection updates, and improved file dialog operations. The PR also introduces visual feedback for ID copy actions and fixes focus issues on the welcome window.

File-Level Changes

Files Changes
Scripts/Control.gd
Scripts/GraphNodes/ChoiceNode.gd
Scripts/GraphNodes/OptionNode.gd
Scripts/SidePanelNodes/SidePanelNodeDetails.gd
Scripts/GraphEdit.gd
Enhanced node connection logic, ID management, and file operation handling across multiple scripts.
Scripts/Windows/WelcomeWindow.gd
Scripts/MonologueNodePanel.gd
Scripts/SubComponents/Ribbon.gd
Improved UI interactions and added visual feedback for ID copy actions.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey @RailKill - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding more inline comments to explain complex logic, especially in the new and heavily modified functions. This will improve long-term maintainability.
  • Some error handling has been removed or changed, particularly in file operations. Please review to ensure all error cases are still properly handled.
  • Given the extensive changes, it would be beneficial to add or update unit tests to cover the new functionality and prevent regressions.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

graph_node = node
return graph_node

func link_option(option_dictionary: Dictionary, establish_link: bool = true):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Add null checks in link_option function

Consider adding null checks for 'next_node' and 'option_dictionary' to prevent potential null reference exceptions. This will make the function more robust and less prone to runtime errors.

Suggested change
func link_option(option_dictionary: Dictionary, establish_link: bool = true):
func link_option(option_dictionary: Dictionary, establish_link: bool = true):
if option_dictionary == null:
return
var option_index = options.find(option_dictionary)
var next_node = get_graph_node(option_dictionary.get("NextID"))
if next_node == null:
return

panel_node.side_panel.control_node.add_child(ribbon)


func _on_id_text_changed(new_id):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Implement ID conflict prevention

Allowing direct editing of IDs could lead to conflicts. Consider implementing a mechanism to ensure uniqueness of IDs, such as validation against existing IDs or auto-generation of unique IDs.

@RailKill RailKill marked this pull request as draft July 28, 2024 01:11
@RailKill

RailKill commented Jul 28, 2024

Copy link
Copy Markdown
Collaborator Author

Moving back into draft due to critical bugs found:

  1. The editing of node ID does not cross-check for option node ID, which allows for nodes with the same ID to be input by the user. This breaks the application. I will look into this and fix this immediately.
  2. RootNodePanel is not actually a MonologueNodePanel, which I assumed it was, and now it is breaking when trying to open the RootNodePanel. Problem with my implementation, will fix.

EDIT: Critical bugs have been fixed.

@RailKill RailKill marked this pull request as ready for review July 28, 2024 02:31

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey @RailKill - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@atomic-junky atomic-junky merged commit 877a8d1 into monologue-tool:main Jul 29, 2024
@atomic-junky

Copy link
Copy Markdown
Collaborator

Thanks for continuing to improve this project, all these changes are really nice!

@RailKill RailKill deleted the dev branch July 29, 2024 10:56
@RailKill RailKill restored the dev branch July 29, 2024 10:56
@RailKill RailKill deleted the dev branch July 29, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment