feat: Focus on current directory on navigation to parent directory in a filepanel#1340
Conversation
📝 WalkthroughWalkthroughRenamed a test case and added a new subtest to assert focus behavior when navigating to a parent directory; updated file-panel directory-switch logic to set Changes
Sequence Diagram(s)(Skipped — conditions for generating sequence diagrams not met.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@lazysegtree |
| return fmt.Errorf("%s is not a directory", path) | ||
| } | ||
|
|
||
| m.TargetFile = filepath.Base(m.Location) |
There was a problem hiding this comment.
This should not be done always @xelavopelk. It should be done only when you are switch to parent directory.
In this case, when users press confirm on directory ./b/c They will go to ./b/c/b instead of correct ./b/c/a
➜ ~/temp/testf/a [8:46:23] find .
.
./b
./b/c
./b/c/a2
./b/c/a
./b/c/b
➜ ~/temp/testf/a [8:46:26]
I don't understand what that means, but don't mind that comment. I have fixed it. |
|
FYI, this is not a bug fix. The way it worked before was the intended behaviour. |
| { | ||
| name: "Enter via cd command second dir", | ||
| startDir: curTestDir, | ||
| resultDir: dir2, | ||
| startCursor: 1, | ||
| keyInput: []string{ | ||
| common.Hotkeys.OpenSPFPrompt[0], | ||
| // TODO : Have it quoted, once cd command supports quoted paths | ||
| "cd " + dir2, | ||
| common.Hotkeys.ConfirmTyping[0], | ||
| }, | ||
| searchBarClear: true, | ||
| }, |
There was a problem hiding this comment.
This unit test is pointless and will pass even without the fix
There was a problem hiding this comment.
When you add unit tests, please understand what they are doing and if they even add any value.
|
Let me know if you are good with the PR, I will merge it then. |
ok. thanks for help. |

problem:

0) The process starts in the directory "~/repo/golang/superfile-klepov".
Up to parent after fix:

Summary by CodeRabbit
Tests
Bug Fixes