Skip to content

File browser: add Folder Menu#10275

Merged
hius07 merged 8 commits into
koreader:masterfrom
hius07:folder-menu
Mar 31, 2023
Merged

File browser: add Folder Menu#10275
hius07 merged 8 commits into
koreader:masterfrom
hius07:folder-menu

Conversation

@hius07

@hius07 hius07 commented Mar 31, 2023

Copy link
Copy Markdown
Member

To go up to parent folders.

11

Home folder abbreviated

12

Home folder abbreviated and locked

13

Long folder name

14


This change is Reviewable

font_face = "smallinfofont",
font_size = 22,
font_bold = false,
avoid_text_truncation = false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Was going to ask "why force that?!" - but testing without, the wrap is ugly with the second line going under the indentation & symbol - and it would be too hard to make nice - so, ok with that :)

@Frenzie Frenzie added this to the 2023.04 milestone Mar 31, 2023
@hius07 hius07 merged commit 59a0139 into koreader:master Mar 31, 2023
@hius07 hius07 deleted the folder-menu branch March 31, 2023 16:35
@mergen3107

Copy link
Copy Markdown
Contributor

I tried this feature and can crash it.

  1. FM, currently in Home folder.
  2. Click home, new window pops up, so higher than home. Home is /storage/emulated/0/Books. I went to /storage/emulated.
  3. However, KOReader does not see the 0 directory there (I think that was the case all the time).
  4. However, if I click home icon now, it freezes then crashes. I’ll try to attach the bomb crash in a second.

Previously hitting home was bringing me home directly. Is there a way to bring this back?

@mergen3107

Copy link
Copy Markdown
Contributor

I wasn’t able to save it :(
When I clicked Save report, it crashed completely to launcher.

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

An Android issue. /storage/emulated must be handled in a special way.

@mergen3107 , do you see your Home folder in the list? Can you press it and go Home?

@mergen3107

Copy link
Copy Markdown
Contributor

I can only see the folder with “(Home)” when I am inside Home somewhere.

Anywhere outside Home it crashes before window pops up

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

The bug (#10198 (comment)) is not related to this PR.
But in any case the upper parts of /storage/emulated/0 should not be shown in the Folder Menu on Android.

Regaring the Home button: we can go Home via
-the Plus menu
-assigning an action to long-pressing the Home titlebar icon
-or maybe it is good to add a separate (topmost) Home button to the Folder Menu

@poire-z

poire-z commented Apr 1, 2023

Copy link
Copy Markdown
Contributor

I guess long-press would be fine ? I was also a bit surprised that i now have to tap twice to go to home, but that's may be just because of the icon ? dunno if the hamburger icon is better as it's not really a menu with options like in Book map and Page browser.
Also, may be your text "(Home)" could be replace by a "home" unicode symbol to make it easier to catch the eye and tap ?

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

Long-pressing on top left corner is free and can be assigned via Gesture manager.

The only home character:

11

@poire-z

poire-z commented Apr 1, 2023

Copy link
Copy Markdown
Contributor

Long-pressing on top left corner is free and can be assigned via Gesture manager.

Right, so let that be. Do we have a default for it in File browser? Should "go home" be it if not?

The only home character:

May be without parens (and a bit more spaces if needed) ?

@poire-z

poire-z commented Apr 1, 2023

Copy link
Copy Markdown
Contributor

There might be some others to try in our nerdfont.
https://www.nerdfonts.com/cheat-sheet and search for "home".
image

(Always a bit tedious to find the right codepoint as we shift some a bit; #9526 (comment))

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

Yes, I've tried that nerdfonts sheet, other symbols are not supported in Noto-Sans.

12

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

No default gesture:

hold_top_left_corner = nil,

@mergen3107

Copy link
Copy Markdown
Contributor

Before we fight to death for the icon design, let me suggest one conservative thing:

  1. Let’s keep the single tap on the Home icon as it is: bring people to home.
  2. For the new folder list*, let’s put it either as long-tap on the icon (or corner, I don’t really use the corners) or as second icon like hamburger menu.
  • Honestly, new folder list would make a lot of sense if it was activated when the full path below “KOReader” title. This would resemble File Explorer in Windows, Dolphin on Linux, WinSCP, etc

@poire-z

poire-z commented Apr 1, 2023

Copy link
Copy Markdown
Contributor

Yes, I've tried that nerdfonts sheet, other symbols are not supported

Right, can't find any other ones.
So, let's go with this one: it looks similar with the chimney on the same side :) it's solid black, but ok, it catches the eye better that way.

Before we fight to death for the icon design

Well, we're disappoitned gladiators, not enough choices to fight about :/

About the change, I've never used this button enough to be bothered. But it looks nice and somehow give more choices/ways to go up (people requested that), without getting too much against habits (yes, you tap it and you don't go immediately, but it's just a tap away, and you can decide to stop in between, or go up 3 levels instead of taping 3 times).

Honestly, new folder list would make a lot of sense if it was activated when the full path below “KOReader” title.

Except in the Dict lookup result, I don't think we have much of that kind of UX (anonymous text acting like buttons)?

@mergen3107

Copy link
Copy Markdown
Contributor

but it's just a tap away

For me it is deal breaking because it crashes on upper folder :D
And I go outside a lot to find other non-book files

@hius07

hius07 commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

because it crashes on upper folder

Thank you for the report, fixed already.

@mergen3107

Copy link
Copy Markdown
Contributor

Sorry, didn’t see :) thanks! Will test tomorrow

@mergen3107

Copy link
Copy Markdown
Contributor

@hius07
Thanks for quick response!

No more crash in -27.

Only weird thing is that in / folder, it says “Content is limited, etc”, and there is only one folder, but it weirdly says “/torage”. It works well and brings to “/storage”, but it weird that it is spelt that way.

Also, in /storage there is no 0 folder, so the only way to go back is to use the plus button.

I really now think that the old Home button icon should have at least an extra row that brings you home.

I used go home button a lot, even more than I realized it, especially now when I have to use the Plus button, then seek for the Go to home row (which is after Set as home button). Very inconvenient.

@hius07

hius07 commented Apr 2, 2023

Copy link
Copy Markdown
Member Author

I tried setting goHome action to the long-press on top left corner and found it convenient.

@mergen3107

Copy link
Copy Markdown
Contributor

I can’t conveniently use corner taps and long taps on Onyx: screen frame is rounded at corners and these touch areas are unreliable to use. So I disabled all corner actions.

Is there an option of long press for the button itself? E. g.,

  • Tap: goHome
  • Long tap: choose folder ?

@yparitcher

Copy link
Copy Markdown
Member

+1 for the home button being home on tap and any menu on hold, when i am in the FM the only place i need to go quickly is home and i use the button alot

@NiLuJe

NiLuJe commented Apr 2, 2023

Copy link
Copy Markdown
Member

Yeah, it would also track with the "this looks like a context menu", and context-menus being a right-click kinda thing (which is often bound to long-tap on trackpads).

@hius07

hius07 commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

We can go two ways:
-add "Show folder menu" to Dispatcher and free tap/long-press on top left corner in Gesture manager
-hardcode tap/long-press to Go home / Show folder menu and add a setting "Show folder menu on Home icon tap" to Home folder settings submenu.

@NiLuJe

NiLuJe commented Apr 3, 2023

Copy link
Copy Markdown
Member

I can't quite think of a use-case for having this bound elsewhere, but that's just me ;).

@poire-z

poire-z commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

I know it's practical (for power users - and us developpers?, although it always look odd to me to get the callback far away from the button definition) to handle corner buttons via corner gestures, moreover when a user will always get a "home" button that may not have anything to do with the action he has assigned to that corner :)
So, I won't mind removing this top left corner from gestures/dispatcher (but then, you'll probably get some old users like those above complaining you killed their habbits :) and add proper callback in the button definition:

hardcode tap/long-press to Go home / Show folder menu and add a setting "Show folder menu on Home icon tap" to Home folder settings submenu.

It may look a bit odd having both the folders tree list + a setting, but may be if it's at bottom with a separator, with the current directory above (that the user will probably not tap), it could be ok.
If I understand what you meant, I guess the setting could say [ ] Show this on tap - but I don't think I did anything for a refreshed text_func for the buttons in the ButtonTable (I just did enabled_func), so it might need a bit more coding.

Or just go with the flow of old users and have tap on the home button (it's a home, not a hamburger inviting to get a menu) go home - and hardcoded long-press show the tree list menu.
Dunno really :/

@Frenzie

Frenzie commented Apr 3, 2023

Copy link
Copy Markdown
Member

I think being able to override it is probably more elegant in theory, but I have no strong preference.

@hius07

hius07 commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

I meant to hardcode tap/long-press to GoHome/ShowFolderMenu and have a setting to switch actions, tap/long-press -> ShowFolderMenu/GoHome.

@poire-z

poire-z commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

I meant to hardcode tap/long-press to GoHome/ShowFolderMenu and have a setting to switch actions, tap/long-press -> ShowFolderMenu/GoHome.

That's what I meant with [ ] Show this on tap (show this menu on tap, and implicitely "go home with long-press) - if you want this in the folder tree list.
But I guess having it in the regular top menu settings (in Home folder settings> ?) is probably less confusing and leave this folder list cleaner.

@gbyl

gbyl commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Casting another vote for a way to override this new behavior. Like many other people, I keep a flat directory structure and mainly use the home button to refresh after file transfers. Originally discussed in #7477

@poire-z

poire-z commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Thinking again, it might not that often be used/useful to deserve a setting, even if it's fancy and not many people will see it if set on long-press.
Tap on a home button => go home
Long-press on a home button gives the home context menu/neighbour directories.

TranHHoang added a commit to TranHHoang/koreader that referenced this pull request May 26, 2023
KOReader 2023.04 "Solar Panel"

![koreader-2023-04-fs8](https://user-images.githubusercontent.com/202757/234975122-d7739c71-74aa-4cb0-a086-72a4bba70f52.png)

It's been another busy month squashing many bugs. Our Mac users will be happy to hear that I told macOS we've supported HiDPI since long before anyone came up with such terminology (koreader#10341), and that the program can now natively build on M1 devices (koreader#10291).

Solar panel credit: <https://openclipart.org/detail/294030/solar-energy> by gnokii

We'd like to thank all contributors for their efforts. Some highlights since the previous release include:

* Readerzooming: fix use of default settings (koreader#10205) @hius07
* ButtonDialog/ButtonDialogTitle: consistent 'width' handling (koreader#10230) @poire-z
* MovableContainer: add support for anchoring initial position (koreader#10230) @poire-z
* Book map, Page browser: add top left menu (koreader#10230) @poire-z
* Book style tweak: add button with CSS suggestions (koreader#10230) @poire-z
* crengine: fix parsing of multibytes encodings (koreader#10230) @poire-z
* readerstyletweak: update profiles on unregistering in dispatcher (koreader#10247) @hius07
* Filesearcher: add search in book metadata (koreader#10198) @hius07
* Fix: Updated legacy directory, which crashed the program (koreader#10260) @Mochitto
* ReaderLink: allow a forward location stack (koreader#10228) @yparitcher
* BookInfo: add page information (koreader#10255) @hius07
* Center pdf manual zoom mode (koreader#10246) @nairyosangha
* File browser: add Folder Menu (koreader#10275) @hius07
* Calendar view: add options to change start time of days (koreader#10254) @weijiuqiao
* filechooser: fix crash on "unreadable content" (koreader#10283) @hius07
* Sync book statistics: add to dispatcher (koreader#10285) @ptrm
* [plugin] Exporter: use util.getSafeFilename() to remove illegal characters from output filename (koreader#10282) @Mochitto
* readerbookmark: fix writing pdf annotation (koreader#10287) @hius07
* Folder Menu: sign for Home folder (koreader#10288) @hius07
* ListMenu: show mark for books with highlights (koreader#10276) @hius07
* Calendar view's day view: thicker separator at 00:00 (koreader#10289) @poire-z
* PageBrowser: tweak scrolling behaviour at book start/end (koreader#10289) @poire-z
* Make `kodev check` feature complete (koreader#8682) @yparitcher
* macOS: support for M1 building (koreader#10291) @ptrm
* Reader: do not apply font size and spacing out of range (koreader#10295, koreader#10307) @hius07
* File browser: show Folder Menu on long-press on Home icon (koreader#10298) @hius07
* SSH.koplugin: fix cant stop SSH server bug when pid file's stale (koreader#10300) @weijiuqiao
* PM: Optimize task queue handling around standby (koreader#10203) @zwim
* statistic.koplugin: fix today's timeline showing next day when within custom offset (koreader#10299) @weijiuqiao
* ReaderThumbnails: update cached page thumbnail on bookmark note change (koreader#10303) @hius07
* SDL: add multitouch support (koreader#10334) @Frenzie
* SDL: add HiDPI support (koreader#10341) @Frenzie
* BookInfo: fix crash on show cover (koreader#10315) @hius07
* Deal with table.pack corner-cases properly (koreader#10350) @NiLuJe
* Android: add Tagus Gea support (<koreader/android-luajit-launcher#412>) @Alfedi

[Full changelog](koreader/koreader@v2023.03...v2023.04) — [closed milestone issues](https://github.com/koreader/koreader/milestone/63?closed=1)

---

Installation instructions: [Android](https://github.com/koreader/koreader/wiki/Installation-on-Android-devices) • [Cervantes](https://github.com/koreader/koreader/wiki/Installation-on-BQ-devices) • [ChromeOS](https://github.com/koreader/koreader/wiki/Installation-on-Chromebook-devices) • [Kindle](https://github.com/koreader/koreader/wiki/Installation-on-Kindle-devices) • [Kobo](https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices) • [PocketBook](https://github.com/koreader/koreader/wiki/Installation-on-PocketBook-devices) • [ReMarkable](https://github.com/koreader/koreader/wiki/Installation-on-ReMarkable) • [Desktop Linux](https://github.com/koreader/koreader/wiki/Installation-on-desktop-linux) • [MacOS](https://github.com/koreader/koreader/wiki/Installation-on-MacOS)
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants