weareunderdesign / rnbw

design. develop. ship.
https://rnbw.dev
GNU General Public License v3.0
57 stars 13 forks source link

route/files/code <> design - core interactions #735

Closed atulbhatt-system32 closed 6 months ago

atulbhatt-system32 commented 7 months ago

Opening web component by double clicking hides the navigator panel

Image

edenvidal commented 7 months ago

this is how it looks like after double clicking a component. the navigator is hidden and the files panel collapses. @VictoriaShyika can you fix this?

Image

atulbhatt-system32 commented 7 months ago

@edenvidal I had already solved it yesterday morning before our discussion

edenvidal commented 7 months ago

@atulbhatt-system32

i switched to a .js file and then back to the html by clicking on the canvas, but the route only updated when i clicked on the sidebar. (how can we make one method that works for everything? right now, it’s not like that for many features.)

when you double-click on a web component to open its js file, it should work the same as when you select the js file from the file list, and the route should update. the double click is simply a shortcut to get to something in a way that should already exist. this would use what’s already there to make sure everything acts the same way.

also, when double-clicking on a web component, it seems that when clicking on the navigator it gets back to the open html file, why? the return should only occur when clicking on an element either through the design or the sidebar (not the entire sidebar, just an element inside it)

edenvidal commented 7 months ago

@atulbhatt-system32 Another issue is that when clicking back on the design, it won't focus on an element, so as a user, you'll need to click twice in order to switch back. again, as always, the issue is deeper. please, let's not just fix it but get to the bottom of it and make an issue related to handling all cases when other elements are selected due to disappearing (of any reason) of another element?

edenvidal commented 7 months ago

@atulbhatt-system32 there's a problem with double clicking on web components with multi-level navigation. i tried to double click on a group to navigate within the design, but it opened the code of the web component instead, simply since the area i clicked on was the web component are. it seems that there is a lot of redundant functionality related to opening a web component. the double clicking on a web component can simply initiate the already existing functionality of files.

atulbhatt-system32 commented 7 months ago

@atulbhatt-system32

i switched to a .js file and then back to the html by clicking on the canvas, but the route only updated when i clicked on the sidebar. (how can we make one method that works for everything? right now, it’s not like that for many features.)

when you double-click on a web component to open its js file, it should work the same as when you select the js file from the file list, and the route should update. the double click is simply a shortcut to get to something in a way that should already exist. this would use what’s already there to make sure everything acts the same way.

also, when double-clicking on a web component, it seems that when clicking on the navigator it gets back to the open html file, why? the return should only occur when clicking on an element either through the design or the sidebar (not the entire sidebar, just an element inside it)

The part where the web-component switches back to html file when clicking anywhere must be because of the logic that the activePanel is changed and is not codeview we switch back which we need to correct.

atulbhatt-system32 commented 7 months ago

@atulbhatt-system32 Another issue is that when clicking back on the design, it won't focus on an element, so as a user, you'll need to click twice in order to switch back. again, as always, the issue is deeper. please, let's not just fix it but get to the bottom of it and make an issue related to handling all cases when other elements are selected due to disappearing (of any reason) of another element?

The first click switches back to the original file and selects the first node inside the body. Then in second click happens what you selected.

atulbhatt-system32 commented 7 months ago

@atulbhatt-system32 there's a problem with double clicking on web components with multi-level navigation. i tried to double click on a group to navigate within the design, but it opened the code of the web component instead, simply since the area i clicked on was the web component are. it seems that there is a lot of redundant functionality related to opening a web component. the double clicking on a web component can simply initiate the already existing functionality of files.

I will breakdown here how we perform double click operation on Web Components.

edenvidal commented 7 months ago

@atulbhatt-system32, let's implement the following functionality, please, in the way described here (we already had it before!)

  1. it is possible to toggle through files in the files. the route always shows the current file, and the code always shows the current file.
  2. the design always renders the last (!) html file regardless of the files and code views. when clicking on a node, whether on the elements tree or the design, the files/code/route and then again initiate the rendered html as the active file.

so, route-files-code = always together. design = reflects only html, no change needed if no toggle to html

please confirm.

atulbhatt-system32 commented 7 months ago

sure @edenvidal we will follow this convention.

edenvidal commented 7 months ago

@atulbhatt-system32 this has nothing to do with web components but simply the interaction between route/files/code/design. this needs to be really hard coded at the core of rnbw, literally everything works based on that.

adding the web component behavior separately here:

double-clicking on a web component node directly initiates the function that opens the associated js file. and that's it. the rest is already taken care.

atulbhatt-system32 commented 7 months ago

@edenvidal based on that I want to confirm another behaviour.

What if I open a JS file or any other file that is not an html file through filetree?

edenvidal commented 7 months ago

@atulbhatt-system32

  1. yes. but i think this is not the right question since i just described it. also, this is not "another" behavior, this is "the" behavior.
  2. i've deleted this issue. ignore it. i just described it earlier. please, forget every existing thing (actually, remove it from our code), and simply let's follow solely this behavior I just described.

here is the concise description once again. (please, convince me you're getting it before implementing)


so,


this has nothing to do with web components but simply the interaction between route/files/code/design. this needs to be really hard coded at the core of rnbw, literally everything works based on that.

adding the web component behavior separately here:

atulbhatt-system32 commented 7 months ago

@edenvidal

When clicking on a node, whether on the elements tree or the design, the files/code/route and then again initiate the rendered html as the active file.

This was what I wanted to confirm. Rest I'm clear.

So it goes like this.

edenvidal commented 6 months ago

@VictoriaShyika , please review this issue carefully for the intent. @atulbhatt-system32 it'll be great if you can provide some info here on the steps to take to resolve it potentially.

VictoriaShyika commented 6 months ago

@edenvidal, @atulbhatt-system32.

  1. The selection of web-components is not done like with other elements, we need to select web components like other elements on the page and then show the source code on double click. I think we need to improve the selection logic for web components for this.
  2. It seems that after selecting a web component in the design and when the code is added to the CodeView, we can return to the previous (.html) page by clicking on stage. Is it necessary to return to it by clicking on the elements panel?
  3. I tested the selection of other files when the web component is open, and the correct files were opened in the code and in the url on my end.
  4. The design works as you described earlier: design = reflects only html, no change needed if no toggle to html
  5. There is a problem with changing the file with web-components.
  6. Opening a wep-component after "esc" works for me.
atulbhatt-system32 commented 6 months ago

@VictoriaShyika @edenvidal

  1. Yes, we need to fix the selection part like it happens on others. I think event delegation is happening or something like that which causes clicking outside of web component to open web-component.

  2. Switching back is supposed to happen and for now only from the stage as we are not showing node tree panel when we have JS file open.

  3. This needs to be fixed.

@edenvidal I think when you tested these the dev branch was not updated at that time.

edenvidal commented 6 months ago

so it kinda work now. two things need to be fixed:

  1. switching back to "design" once toggling files should happen seamlessly as if i didn't leave the design (no de-selection and other stuff)
  2. if opening any file that is not html, then open the code view with it (even if it closed).
  3. if the elements panel is gone, the settings panel should be gone as well - let's make sure everything that applies to the elements panel also applies to the settings panel, always).

@VictoriaShyika please describe what are you going to do with it to apply those changes.

VictoriaShyika commented 6 months ago

@edenvidal

  1. I think we need to detect which last html file was opened (when we switch to files without design) and if we return to the same html file, show last selecting state.
  2. We just need to detect the file extension and if that extension without design make codeView visible.
  3. We need to connect the settings and elements panel and show it only when it needed
edenvidal commented 6 months ago

@VictoriaShyika sounds good. not sure about how to implement the 1st but i'm here to test and help.