Skip to content

Improve diagram editor connection compatibility hints#182

Open
ArizmendiWan wants to merge 6 commits intoopen-rmf:mainfrom
ArizmendiWan:zhenwan-issue-172-connection-hints
Open

Improve diagram editor connection compatibility hints#182
ArizmendiWan wants to merge 6 commits intoopen-rmf:mainfrom
ArizmendiWan:zhenwan-issue-172-connection-hints

Conversation

@ArizmendiWan
Copy link

@ArizmendiWan ArizmendiWan commented Mar 15, 2026

This PR is an initial implementation for #172. It improves drag-time connection feedback and adds a compatibility-aware next-operation flow in the diagram editor.

Current changes include:

  • clearer compatible/incompatible handle feedback while dragging
  • compatibility detection for drags starting from either source or target handles
  • dropping on empty space to open a filtered "Compatible next operations" popup
demo.mov

This PR also includes a small incidental frontend sync fix for a stale generated type/schema reference that was needed to keep the frontend building cleanly.

GenAI Use

  • [√ ] I used a GenAI tool in this PR.
  • [ ] I did not use GenAI

Generated-by: Codex Version 26.309.31024 (962) and Claude Code v2.1.76.

Signed-off-by: ArizmendiWan <2311602492@qq.com>
@ArizmendiWan ArizmendiWan force-pushed the zhenwan-issue-172-connection-hints branch from a7faafc to 10abb27 Compare March 16, 2026 00:19
@mxgrey
Copy link
Contributor

mxgrey commented Mar 18, 2026

Thanks for this contribution! The UI hints shown in the video look very impressive and helpful!

Just one high level thought before conducting a full code review: a Clear Diagram button in the main menu bar is extremely destructive. There's a risk a user could accidentally click on that while trying to do something else. I would recommend removing that at least until we have an undo feature for the editor.

@mxgrey mxgrey requested review from aaronchongth and mxgrey March 19, 2026 04:33
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I've just left some high level review comments for now. Will get back to you soon with more a more in-depth review

Signed-off-by: ArizmendiWan <2311602492@qq.com>
@ArizmendiWan ArizmendiWan force-pushed the zhenwan-issue-172-connection-hints branch from ef7542e to d10cd87 Compare March 19, 2026 22:07
@ArizmendiWan
Copy link
Author

ArizmendiWan commented Mar 19, 2026

Thanks for your feedbacks! I have addressed the requested review changes:

  • removed the Clear Diagram action
  • moved the connection helper from top-right to top-left
  • removed the handbook roadmap addition
  • updated the PR description to mention the incidental stale generated type/schema sync fix
demo_v01.mov

Please let me know if there’s anything else you’d like me to adjust.

Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Thanks for the changes so far, I left a few comments.

Regarding the UI, the buttons should appear below the filter input, instead of on the right.

Image Image

When there are no valid operations, the text lines up below the filter properly, the buttons should do that too in general

Image

const remappedId = addUniqueSuffix(
'new_input',
nodeManager.nodes
.filter((n) => n.type === 'sectionInput')
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated to use the existing node helper

const outputId = addUniqueSuffix(
'new_output',
nodeManager.nodes
.filter((n) => n.type === 'sectionOutput')
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated to use the existing node helper

const remappedId = addUniqueSuffix(
'new_buffer',
nodeManager.nodes
.filter((n) => n.type === 'sectionBuffer')
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated to use the existing node helper

</ButtonGroup>
{operations.length === 0 && (
<Typography variant="body2" sx={{ px: 1.5, py: 1.5, width: 260 }}>
No compatible operations are available for this output yet.
Copy link
Member

Choose a reason for hiding this comment

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

This is also prompted when filtered via text with no results instead of handling an output, either

  • identify which case it is, and provide proper explanations, or
  • use more generic wording to cover both cases

I personally would like it to be the first case, since it is more verbose and explanatory to the user

Image

Copy link
Author

Choose a reason for hiding this comment

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

Updated the empty-state messaging to distinguish filter-empty from compatibility-empty.

Update the add-operation UI and connection hints for compatible previous and next operations, and keep the supporting drag-direction logic aligned with that flow.

Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
@ArizmendiWan
Copy link
Author

ArizmendiWan commented Mar 20, 2026

Thanks for the review! I have addressed the remaining review comments:

  • Replaced the inline section node type checks with the existing helpers for consistency.
  • Updated the empty-state messaging to distinguish filter-empty from compatibility-empty.
  • Also added support for reverse-flow compatibility so the compatibility UI now works when starting a drag from either direction.
demo_v02.mov

Signed-off-by: ArizmendiWan <2311602492@qq.com>
@ArizmendiWan
Copy link
Author

I also updated the compatibility hint functionality. Right now it also checks if a handle is already full. If one handle is full, no compatibility will be shown and the hint panel will show corresponding messages.

demo_v03.mov

@ArizmendiWan ArizmendiWan requested a review from mxgrey March 23, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

3 participants