Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

When using kaoto code editor for editing multiple routes - after sync only first route stays displayed #1910

Closed
tplevko opened this issue Jun 6, 2023 · 3 comments · Fixed by #2059
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tplevko
Copy link
Contributor

tplevko commented Jun 6, 2023

Describe the Bug

When users use the code editor for editing multiple routes with displayed route in the canvas, after syncing the code editor the displayed routes are hidden and only the first route stays displayed.

Steps to Reproduce the Bug or Issue

  1. create multiple routes
  2. display second route
  3. edit the second route in editor
  4. sync editor
  5. see the route displayed is now the first route

Screenshots or Videos

Peek 2023-06-06 08-59

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [latest]
@tplevko tplevko added the bug Something isn't working label Jun 6, 2023
@lordrip
Copy link
Member

lordrip commented Jun 7, 2023

I never thought that I would ever say this, but this is not a bug but a feature 😅 🙈

Jokes aside, showing only the first route is the "intended" behavior, but now that you raise this topic, I'm wondering if this might be confusing to the user. I'll ask for feedback in the meantime, to provide a different behavior.

@tplevko
Copy link
Contributor Author

tplevko commented Jun 8, 2023

Thanks @lordrip for the response. I still believe this might be an issue, as the route which stays displayed in the canvas might not be the one the user was editing - the current behaviour leaves open the first route from the route list.

The "only route displayed" would be OK I think, in case the one route displayed after the source code edit sync was the one the user was editing.

@lordrip
Copy link
Member

lordrip commented Jun 8, 2023

Argh, sorry @tplevko, I got the issues mixed, that comment was meant for this issue: #1898.

I agree with you that the current situation is not ideal, I'll need to check whether we can keep the existing visible routes if any upon sync.

Thanks for rising this issue 💪

@apupier apupier added this to the 1.1.0 milestone Jun 21, 2023
@lordrip lordrip self-assigned this Jun 28, 2023
lordrip added a commit that referenced this issue Jun 29, 2023
Currently, the UI creates the flows IDs in two places:
1. Upon syncing the code through the useFlowsStore.setFlowsWrapper() method
2. Upon creating a new flow when using the New Flow button

For the .1, since the UI doesn't have a previous ID
because we're starting from the source code, the UI
creates an ID using the DSL name and the position index,
i.e. "Camel Route-1".

For the .2, the UI uses a service to generate an ID
with the word "route-####" while "####" it's a 4 digits
random number.

In this commit, the UI leverages the IFlowsWrapper.flows[0].metadata.name
property as an ID for each flow, this way, whenever a sync happens,
the IDs will be the same.

fixes: KaotoIO/vscode-kaoto#280
fixes: #1910
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants