-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Improving file panel rendering. #589
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for superfile canceled.
|
bc68644
to
da3c86e
Compare
sort.Slice(files, order) | ||
|
||
for _, item := range files { | ||
fileInfo, err := item.Info() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need of filtering dirEntries after. Filtered them before the sort.
name: item.Name(), | ||
directory: item.IsDir(), | ||
} | ||
if location == "/" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant. filepath.Join() handles location being "/"
switch sortOptions.options[sortOptions.selected] { | ||
case "Name": | ||
order = func(i, j int) bool { | ||
_, errI := os.ReadDir(location + "/" + files[i].Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need to do ReadDir syscall here at all. We can just decide based on IsDir()
da3c86e
to
c3d9fea
Compare
Rebased to latest main, after merge of PR#584 |
Removed redundant computations, and improved error handling.
Fixes some issue found during investigation of #585
Renamed
folder
todir
Validated that file view and sort options were working as intended.
Validated that no issues in opening root directory
\
Validated that hiding and showing of dot files was working as expected