botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
76 stars 88 forks source link

[BUG] File view in code editor tab does not change when selecting file of same name (global / local) #1293

Open dvncan opened 3 years ago

dvncan commented 3 years ago

Describe the bug The code editor's file view does not change when toggling between a local & global file of the same name. The bug causes confusion when copying a global file to a local bot or vise versa. As the tab which has the file name does not denote if it is a global or local file, you must close the tab and be sure to open the correct file before editing.

To Reproduce

  1. Open a bot in Botpress Studios
  2. Navigate to the code editor
  3. Copy or find a file that is replicated globally and locally
  4. With your mouse click to open one of the files and click between both files
  5. The view will stay the same, although the selected file changes
  6. This is very noticable when you have built a custom action from a global file and the view does not show it, or you have had the wrong copy of the file open and you are editing the global version while the local remains the same.

Expected behavior Either two tabs open, one for each copy of the file. A denotation will have to accompany the file title. or The file tab toggles between the two files being selected, and the title of the tab does not change.

Screenshots Local file (clicking both) Screen Shot 2021-03-23 at 10 42 27 AM Screen Shot 2021-03-23 at 10 42 12 AM

Global file (clicking both) Screen Shot 2021-03-23 at 10 43 16 AM Screen Shot 2021-03-23 at 10 42 48 AM

Environment (please complete the following information):

Demo deployment

Michael-N-M commented 3 years ago

With the new tab support in code editor, maybe opening it in a seperate tab then appending the file paths to the title to differentiate them.

dvncan commented 3 years ago

that would work, something like "global/hitlnext.json" right next to "local/hitlnext.json".. You only really need to differentiate the second tab, but right now it makes me confused as to which file I am editing.