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
Desktop: Resolves #6167 : Move to notebook cannot distinguish notebooks with the same name #6400
Conversation
It should show the full note path, including notebook on each line. Otherwise you indeed need something like a tooltip but nobody will know there's a tooltip, and it's not convenient if you have to move your mouse over each title. |
I think in this case, we don't need And |
I think it should display a tree, except when searching in which case it should disambiguate with the notebook name. I think that's what the original issue was suggesting. |
I think you mean like this: demo.mp4and I used |
if (folder.title === '') { | ||
folder.title = 'Untitled'; | ||
} | ||
const new_path = path + folder.title; |
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.
newPath
options.startFolders = []; | ||
}); | ||
|
||
it('Empty Notebook Title', () => { |
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.
"empty folder title"
}); | ||
|
||
it('Long Path', () => { | ||
const testCases = [{ id: 1, title: '1', children: [{ id: 2, title: '2', children: [{ id: 3, title: '3', children: [{ id: 4, title: '4', children: [{ id: 5, title: '5', children: [{ id: 6, title: '6', children: [{ id: 7, title: '7', children: [{ id: 8, title: '8', children: [{ id: 9, title: '9', children: [{ id: 10, title: '10', children: [{ id: 11, title: '11', children: [{ id: 12, title: '12', children: [{ id: 13, title: '13', children: [{ id: 14, title: '14', children: [{ id: 15, title: '15' }] }] }] }] }] }] }] }] }] }] }] }] }] }, { id: 16, title: '16' }] }]; |
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.
Put that over multiple lines please. It's unreadable now
}); | ||
|
||
it('Diffrent Paths', () => { | ||
const testCases = [{ id: 8, title: 'my Note' }, { id: 2, title: 'first', children: [{ id: 3, title: 'second', children: [{ id: 4, title: 'third', children: [{ id: 5, title: 'fourth' }] }, { id: 6, title: 'fourth' }] }, { id: 7, title: 'fourth' }] }]; |
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.
over multiple lines please
|
||
}); | ||
|
||
it('Diffrent Paths', () => { |
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.
different
const folder = folders[i]; | ||
// When NoteBook doesn't get a title | ||
if (folder.title === '') { | ||
folder.title = 'Untitled'; |
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.
What does it do if you leave it as an empty string? I'd prefer an empty string because untitled notebooks is not really something we support
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.
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.
Yes please, remove it
return option._value; | ||
}; | ||
|
||
const onInputChange = (_input) => { |
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.
input
}; | ||
|
||
const onInputChange = (_input) => { | ||
if (_input !== '') { |
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.
if (input)
Any update for this PR? |
Done :) |
@@ -0,0 +1,106 @@ | |||
const moveToFolder = require('./moveToFolder'); | |||
|
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.
All new files should be TypeScript
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.
Also unfortunately I have no idea what these test units do. Have a look at what other test units do. For example the title is often it('should do this or that')
. What does your code do? Explain it clearly in the test title.
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.
Also unfortunately I have no idea what these test units do
It tests the AddOptions
function that returns paths of folders with different scenarios.
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.
Have a look at what other test units do. For example the title is often
it('should do this or that')
. What does your code do? Explain it clearly in the test title.
OK, I will try to refactor the code and convert the unit test to TS.
export class AddOptions { | ||
|
||
private maxDepth = 15; | ||
public startFolders: any[] = []; |
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.
FolderEntity. No "any" of you can avoid it
}; | ||
|
||
addOptions(folders, 0); | ||
const options = new AddOptions(); |
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.
the naming is not good. Those are not options.
Not sure what's the status of this PR? |
When adding a new unit test (.test.ts) file in MainScreen/commands it crashes when building the Joplin app, and I see a unit test file automatically added in the index.ts file. Is there a solution to this problem? Or do I need to move a unit test file somewhere else?
|
I believe this has been implemented in another pull request. Thanks anyway for looking into it @bishoy-magdy! |
According to #6167, There are many ways to display the paths of folders.,I see the best way to show the path while preserving the search form is by adding the path title for each folder by using the label in the selector and adding a
span
with atitle
for each folder, Plus resetting the search by value only and I will get the path while traveling the folders inaddOptions
function.And I fixed the bug that shows white space when there is no title on the folder in
Move to notebook
by adding anUntitled
label.Example:
demo.mp4