Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File explorer folders not showing content when clicking on them #3092

Closed
Jorgee97 opened this issue Feb 4, 2021 · 7 comments · Fixed by #3142
Closed

File explorer folders not showing content when clicking on them #3092

Jorgee97 opened this issue Feb 4, 2021 · 7 comments · Fixed by #3142
Labels
A-file-explorer Area: File explorer bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor N-critical Notes: Critical issue platform-windows Platform: Windows
Milestone

Comments

@Jorgee97
Copy link

Jorgee97 commented Feb 4, 2021

This has been happening for quite a while, and I think is a pretty important feature and hasn't been addressed yet and as I couldn't find a similar Issue created yet I will leave it here with a gif that shows the behavior.

error_files

If you guys need any more info I would be happy to help sorting this issue

@bryphe bryphe added A-file-explorer Area: File explorer bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor platform-windows Platform: Windows labels Feb 4, 2021
@bryphe
Copy link
Member

bryphe commented Feb 4, 2021

Hi @Jorgee97 ,

Thanks for reporting!

I think is a pretty important feature and hasn't been addressed yet and as I couldn't find a similar Issue created yet I will leave it here with a gif that shows the behavior.

Definitely. I've seen this come up a few times, but haven't been able to reproduce locally - trying to figure out what is different between the environments.

I just opened #3096 to add some additional logging around the expand-node-path - maybe can give us some clues. In particular, we weren't logging if there was an error while executing the readdir to get data.

Some other info that might be helpful:

  1. Would it be possible to share the full path? I'm wondering if there is a special character, a space, a size limit, or something that could breaking our path resolution.
  2. How did you open the folder? Was it through the menubar, command line argument (oni2 C:\some\path), or via an x command (:cd)?

Might be related to #2213 - there was a similar issue expanding the folder on Windows there, but went away after updating

@Jorgee97
Copy link
Author

Jorgee97 commented Feb 4, 2021

  1. C:\Users\ingjo\Documents\andrea\api-money-back (this is where the project lives).
  2. My results for every method:
    2.1. I just tested with oni2 . and this way it works nicelly.
    2.2. Opening the project from file context menu does not work.
    2.3. Opening the project with :cd source_to_project works aswell

Thanks for the quick response @bryphe

@bryphe
Copy link
Member

bryphe commented Feb 4, 2021

Interesting! Thanks for testing and sharing the results @Jorgee97 . Indeed, there is nothing suspicious about the path itself - no special characters, under the 260 character limit imposed by some older path APIs.

Glad one of those options works.

For the attempt that failed, 2.2:

Opening the project from file context menu does not work.

Just to confirm, the folders didn't expand in that case? Or did something else go wrong?

I suspect that the path must be coming through in a different form in that case where it isn't working 🤔

@Jorgee97
Copy link
Author

Jorgee97 commented Feb 5, 2021

The folders didn't expand when opening from the file context menu

@wmaurer
Copy link

wmaurer commented Feb 5, 2021

I had been struggling with the same problem, but now thanks to @Jorgee97 at least I have a workaround ;-) (i.e. opening the project via methods 2.1 or 2.3)

bryphe added a commit that referenced this issue Feb 5, 2021
…on path (#3096)

Some additional logging to help narrow down #3092
@BorisVSchmid
Copy link

Not sure if it is related, but right-clicking on the sub-folders gives a weird-looking path, with the last slash being a backslash. (Parent folder was selected through File>Open Folder, and I don't get opening sub-folders either. Win10).

notexpanding

@bryphe
Copy link
Member

bryphe commented Feb 16, 2021

Thanks @Jorgee97 and @BorisVSchmid for the all the information! With your help, I've been able to reproduce this locally consistently - and working on a fix in #3142

@bryphe bryphe added this to the 0.5.5 milestone Feb 16, 2021
@bryphe bryphe added the N-critical Notes: Critical issue label Feb 16, 2021
bryphe added a commit that referenced this issue Feb 16, 2021
__Issue:__ On Windows, there would be cases in which the explorer directory nodes would not expand on click or keyboard interactions.

__Defect:__ Windows paths would be split with the default windows path separator `\`, but in some cases normalized paths would make it to the explorer, and the split-on-default-separator logic wouldn't work (in particular, the logic to split up a path into hashes would fail).

__Fix:__ Working with paths-as-strings is problematic for reasons like this - especially since `\` and `/` are both valid directory separators in Windows. 

The `string` type isn't very useful for representing paths, at least not in the context of a stronger type system, because just looking at a `string` leaves a lot of questions open about how the path is / should be interpreted:

- Is this an absolute or relative path?
- Are the directory separators normalized?
- Is there a trailing slash?

To fix this, I've refactored the pipeline for the `Component_FileExplorer` and `Feature_Explorer` to use strongly-typed paths with the [`Fp`](https://github.com/reasonml/reason-native/blob/master/src/fp/Fp.rei) library. This ensures that we have a consistent, normalized representation for paths up-and-down our pipeline.

__Next steps:__
- Need to continue refactoring `string`-paths to strongly-typed `Fp.t` paths.

Fixes #3092 
Fixes #2213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-file-explorer Area: File explorer bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor N-critical Notes: Critical issue platform-windows Platform: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants