fix: get projectId from link in tree navigation#5746
Conversation
|
The other change was to remove a now-redundant React.Fragment wrapper; there's only one thing inside there, so it was a no-op. |
| setBrokenSkillInfo(link); | ||
| } | ||
| const { skillId, dialogId, trigger } = link; | ||
| const { skillId, dialogId, trigger, projectId } = link; |
There was a problem hiding this comment.
The diff makes it hard to see how this value is being used.
There was a problem hiding this comment.
Can you point me to where its being used?
There was a problem hiding this comment.
It's used immediately below in the calls like navTo(skillId ?? projectId, dialogId);. Before this change, the value of projectId was obtained from the outside scope - a prop that was handed to the SideBar component - and that was defined out in DesignPage.tsx also as skillId ?? projectId, so every dialog link the side bar ended up navigating to whichever projectId was currently "active" instead of their own internal projectId.
There was a problem hiding this comment.
Can we consider renaming some variables for clarity? It's very difficult to know what projectId is when used in the various places.
* get projectId from link in tree navigation * rename variables for clarity Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Description
There was a bug in the sidebar navigation; the links did include the correct project ID (for both the root bot and skills), but navigation was only using the project ID of the currently active bot/skill, not the one the link was actually meant to point at.
Task Item
closes #5727