Notebook file#12699
Conversation
poire-z
left a comment
There was a problem hiding this comment.
I initially thought: damned, we don't need to answer every 2-users crazy feature request :)
But it seems well done, generic and flexible, adapting to various use cases.
So, thought gone.
| FileManager.instance = self | ||
| G_ui = self |
There was a problem hiding this comment.
Mixed feelings about that new G_ui.
We did without it for years, and introducing it now feels like an adhoc solution (or one being lazy finding another solution :)) and not in line with our object oriented stuff (ie. making the filemanageutil stuff being methods instead of functions - no idea how complicated/ugly this would be vs. this simple and clean solution).
As it also makes other stuff more readable, instead of our multiple ugly local ui = require("apps/filemanager/filemanager").instance.
@NiLuJe : any thought ?
May be it also needs a few G_ui = nil to explicitely make it go away when being done with ReaderUI/Filenamanger, instead of waiting for it to be replaced by the coming up new instance.
There was a problem hiding this comment.
Haven't looked at the full picture yet, but, yep, looks nasty and potentially highly error-prone ;).
There was a problem hiding this comment.
Yep, I hate it ;).
Globals are evil to begin with, and this pins the whole object tree in a global, making it doubly so ;).
There was a problem hiding this comment.
What is the negative impact, technically?
There was a problem hiding this comment.
Globals are bad form. Globals are also costly.
This also pins the whole tree in memory, because the object in question is the root of basically all of our things, so it holds at least one ref of basically everything.
Add to that that the GC is extremely cautious about collecting globals, IIRC.
That makes for a terrible combination ;).
| table.insert(kv_pairs, { _("Notes file:"), notes_file and notes_file:gsub(".*/", "") or _("Tap to set"), | ||
| callback = notes_file_callback }) |
There was a problem hiding this comment.
(Each time you add an item to Book information, I need to increase my Info list items per page to have it neat on a single page. Text will become smaller and me blind :/ You're so evil :))
To all: no problem or confusion with naming that feature "notes file" ? We already have Add note / Edit note for associating our own text to a highlight, so this might be confusing.
No other idea about an alternative name for this feature.
There was a problem hiding this comment.
Notebook file might be slightly more distinct?
| local path_chooser = PathChooser:new{ | ||
| path = self.ui.file_chooser and self.ui.file_chooser.path or self.ui:getLastDirFile(), |
There was a problem hiding this comment.
What would be the most confortable locations for such notes files ? Alongside books ? In koreader/settings/ ?
Dunno if you could/should store the last directory used for these, so next time one call "Choose", he gets in the directory where all his notes files are (instead of ui.getLastDirFile whatever that gives, or TextEditor last dir, dunno which is picked when).
Also wondering if there should be a default notes_file, a generic one, or the last one used! ? Having to go through "Choose" on each book may be bothering. I'm not a customer for this feature, but if I would, I'd probably use only a single file to append notes about all books I needed to write something about.
|
Thanks to @hius07 for your work. I was withholding my review because I was interested to read the original requester @Biep's opinion. Anyway, here are my thoughts:
|
Possibly hints at yet another VK/InputDialog and/or TE shenanigan. (e.g., either something's not actually torn down properly, or there are multiple concurrent VK instances). I won't have time to look into it for a few weeks, FWIW. |
Fixed. |
The below seems to agree with my ideas.
👍️
👍️ The probability that both an
👍️ That would allow the recursive notebook file that I mentioned.
👍️ And remembering where which file was, and making typos in the name, and..
👍️ One option would be submenus for global and local files, so that one would not crowd out the other.
No idea what this is about, I am afraid. The one (low need, low urgency) idea missing here is having the option for several notebook files, characterised by a letter/character, so that one could separate various use cases (or users) that way. Overall, this sounds great! |
True - but this one came from me. 😉 |
|
Excellent updates. Default local file works exactly as I'd imagined. For users like Biep, who would also like to use alternative notebook files for each book, I just have a few suggestions for making that a bit quicker:
But as I said, for me it works perfectly fine already, so these are just some completely optional things from my POV. |
|
I'm not a fan of building an interface for several notebook files for a book. |
|
I understand, that is over the top for this very niche use case. The UI is already usable for multiple notebook files at is, as they can be changed easily. My suggestions just tried to address that adding a non-existing file takes many steps and requires typing in an entire, potentially long, filename. How about this: Change the Create button to Change, and add just one simple dialog box that shows the complete path including filename of the currently set notebook file [edit: or even just the filename, and only allow changing to a filename within the same path the currently assigned notebook file is located in]; e.g. like this: The user can then easily insert a letter or number without having to type out the entire filename or start editing the file. Tapping OK will then just change the property of Only if the user selects Create New... will the current new file creation interface be launched. |
|
Thank you! I think this works well for @Biep's intended use case. Attaching a quick video to demonstrate how one would create several files for the same book: (The currently assigned notebook file can also be edited directly from the reader via a gesture.) |
|
Thanks! That seems to come very close! And I assume that other file endings would be possible - so if one day .md files would be shown as Markdown, I could have a .md annotation file, and see the make-up as long as I was not actively editing it. |
|
No history/record is kept for previously associated notebook files. But they can still easily be switched by going to Book information (possible via gesture), and then selecting one via Choose. Yes, any file extension can be selected or entered. |
Would there be a gesture for that - for opening the list to choose from? Because that would provide an easy way for what I want/need:
(And in the darkness bind them..) |
|
The file path edit window dynamically expands so the full path and filename will be visible. The other question is not up to me (I suppose it's easy to do but it may not be the desired behavior for all users). |
|
All right - assuming the full path is not longer than the screen allows. Some people may have instructed Any ETA on when this would appear in the nightlies? |
|
It is there! Wonderful! Thank you, guys! (Are there any women on the team? If so, count yourself included!) |
|
The illustrations at the very least. |
|
@Frenzie: Sorry - what do you mean by that? Should I test the stuff shown in the illustrations? My very first impressions: 🙌👏👍️
My overall impression: wonderful job done! |
|
I haven't tried it yet, but I understand I can have several books share a single notebook file too. That is very useful, e.g. the original Hebrew/Greek Bible plus several translations sharing a notebook. In that case allowing Copy/Paste from the file path+name box would be useful - I must check whether that is possible. |
|
(1) |
Women. ;-) |
I see no women in illustrations, unless you count |
Thanks. I have little time (preparing my trip to Burkina Faso), but hope to react before leaving. |








(After the release)
Closes #12623.
This change is