Skip to content

BookMap: add indicator for pinned page#14510

Merged
hius07 merged 4 commits into
koreader:masterfrom
hius07:bookmap-pinned-page
Oct 29, 2025
Merged

BookMap: add indicator for pinned page#14510
hius07 merged 4 commits into
koreader:masterfrom
hius07:bookmap-pinned-page

Conversation

@hius07

@hius07 hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member
1 2 3 4 5

This change is Reviewable

@Frenzie

Frenzie commented Oct 26, 2025

Copy link
Copy Markdown
Member

What's a pinned page? A bookmark by another name?

@hius07

hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member Author

It's new: #14483.

@shuvashish76

Copy link
Copy Markdown

I'm using the latest development release. Some confusions and question...

  • In latest dev-release, I can pin only one page and no option to pin multiple ones.
  • How can I browse them, if I'm able to mark multiples?
  • Temporary 'Reference point' bookmark #13378 the intention : "temporary bookmark" that resets if you reopen the file. But as per my testing the pinned page still exist after reopening the file and press "Go to pinned page so technically it works as bookmarks.

@hius07

hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member Author

One pinned page only, for quick jumping to it.

@shuvashish76

Copy link
Copy Markdown

This PR screenshot confused me. Ok got it👍

as per my testing the pinned page still exist after reopening the file and press "Go to pinned page so technically it works as bookmarks.

How do we completely remove pinned page?

@hius07

hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member Author

It cannot be removed, just don't jump to it.

@jonnyl2

jonnyl2 commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

the intention : "temporary bookmark" that resets if you reopen the file.

No, that wasn't my intention when I wrote that FR :). By temporary I just meant that it gets overwritten when the next location is set.

Question for @hius07 : Would it be possible to save the exact location for fixed-layout docs? Say my pinned area of interest is some footnote on a PDF that I read in Reflow mode. So that when I call my pinned page, it jumps directly to the bottom of the page. (Same as when using 'Go to previous location' etc.)

@jonnyl2

jonnyl2 commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

I understand it could cause problems if part of the following page is visible at the bottom of the screen -- then I guess it would save the next page's location, which could cause confusion when the pinned page is called with different view settings. (Edit: But this happens anyway, even with full-page bookmarks, which also get set for the page on the bottom edge of the screen.)

@hius07

hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member Author

Would it be possible to save the exact location for fixed-layout docs?

I think yes, as we do in the "Back" action, with the same restrictions about changed view mode.

@Commodore64user

Copy link
Copy Markdown
Member

I wish @poire-z was here to protect us all from that messy overlap, alas he is probably sunbathing in Algiers right now, I don't have a better suggestion but overlapping those icons looks ugly, and I am surprised @Frenzie is simply ignoring it.

@hius07

hius07 commented Oct 26, 2025

Copy link
Copy Markdown
Member Author

Do you mean these overlaps? They don't change in this PR. Unfortunately, there isn't enough room to avoid them.

6

@Frenzie

Frenzie commented Oct 26, 2025

Copy link
Copy Markdown
Member

overlapping those icons looks ugly, and I am surprised @Frenzie is simply ignoring it.

It's unclear if it can be sensibly avoided, but more important I don't believe it's new so it doesn't seem to be related to this PR.

@hius07

hius07 commented Oct 27, 2025

Copy link
Copy Markdown
Member Author

Not ready yet, the pinned page indicator should be added to the Page browser as well.

@poire-z

poire-z commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

No problem with me with the overlap, that's what we get with a fixed height for those icons.
But it feels the pin of the icon should be centered on the page slot, like the tip of the pencil is.

It cannot be removed, just don't jump to it.

I think we should have a way to remove it. No idea yet.

@hius07

hius07 commented Oct 27, 2025

Copy link
Copy Markdown
Member Author

But it feels the pin of the icon should be centered on the page slot

I didn't do that to avoid overlapping with the pen indicator at least.
The 2nd screenshot in the top post.

@poire-z

poire-z commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

I didn't do that to avoid overlapping with the pen indicator at least.

I see. But it feels we would see the pin miscentering more often than a pin + a pencil :)
Or may be we would have one of them turned the other way, ie. the pin / and the pencil \.

Comment thread frontend/ui/widget/bookmapwidget.lua Outdated
return x
end

function BookMapRow:getIndicatorXY(page, shift_y)

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.

Fine with factorizing this.
shift_y (which reads like it accepts a number by which it will be shifted) should be named shift_down if a boolean is to be provided.

@hius07

hius07 commented Oct 28, 2025

Copy link
Copy Markdown
Member Author

Center pin
1

Show pin in Page browser
2

-- Shift it a bit down to keep bookmark glyph(s) readable
y = y + math.floor(self.span_height * (1/3))
end
local x, y = self:getIndicatorXY(page, self.bookmarked_pages[page] or page == self.pinned_page)

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.

The condition gets cumulative (for previously added other indicators).
Is it ok that it stops with these 2 first ones ? (the next ones: extra, cur_page, won't be shifted if there are any previous locations).
If not (I really don't know if I stopped for some reason, of just forgot to do it when adding more indicators), may be we should in each branch set a should_shift_down=true and use that ?

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.

I don't understand.
Annotations are not shifted.
The pin is shifted iff there are annotations.
Other indicators are shifted if there are annotations or the pin.

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.

Other indicators are shifted if there are annotations or the pin.

Ok, but cur_page is not shifted down if there are "previous locations" (circled numbers (1) (2)) or some "extra" symbols.
I'm just asking, may be this is just right, I don't remember :)

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.

"previous location" indicator is not shown in the current page slot.

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.

Ok then, so it's ok and already taken care of by my old self :)

@hius07 hius07 merged commit 7ac0f6e into koreader:master Oct 29, 2025
4 checks passed
@hius07 hius07 deleted the bookmap-pinned-page branch October 29, 2025 05:58
@hius07 hius07 added this to the 2025.10 milestone Oct 29, 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.

6 participants