Skip to content

ToC: search - #13906

Merged
hius07 merged 3 commits into
koreader:masterfrom
hius07:toc-search
Jun 10, 2025
Merged

hius07 merged 3 commits into
koreader:masterfrom
hius07:toc-search

Conversation

@hius07

@hius07 hius07 commented Jun 4, 2025 •

Copy link
Copy Markdown
Member

Tap the titlebar left icon to enter the search string.
If the search string is found in a subchapter, the whole parent chapter tree is shown expanded.
Easter egg: "*" search string shows and expands all ToC trees.
Tap the titlebar left icon again to return to the full ToC.
Closes #12921.

1

2


This change is Reviewable

else
local input_dialog
input_dialog = InputDialog:new{
title = _("Enter text to search for in ToC"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe just Enter search text or Enter text to search for. The in ToC feels a bit unnecessary in English, but more to the point I don't think that's likely to work out in translations.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have

return T(N_("1 entry at ToC depth %2", "%1 entries at ToC depth %2", #ticks[level]), #ticks[level], level)

text = _("ToC entries per page"),

text = _("ToC entry font size"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those aren't problematic because expanding them to "table of contents" doesn't overflow anything.

@Frenzie Frenzie Jun 4, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also I'm not immediately sure about the tick stuff but the ToC entries per page and ToC entry font size need to be disambiguated, so it's not unnecessary.

@Frenzie Frenzie Jun 4, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you can see French is just about the only language that decided to keep "ToC" (TdM)

@jonnyl2

jonnyl2 commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

Very useful feature, thank you!

Just one suggestion: if nothing found, just show an InfoMessage (e.g., "No results found."), rather than an empty TOC.

@hius07
hius07 marked this pull request as draft June 4, 2025 10:13
@hius07
hius07 marked this pull request as ready for review June 4, 2025 10:46
@hius07

hius07 commented Jun 4, 2025

Copy link
Copy Markdown
Member Author

Changes: wordings, infomessage "No results".

@hius07
hius07 merged commit 3d3e79f into koreader:master Jun 10, 2025
@hius07
hius07 deleted the toc-search branch June 10, 2025 05:58
@hius07 hius07 added this to the 2025.05 milestone Jun 10, 2025
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.

FR: Search/Filter TOC

3 participants