Skip to content

fix: handle chapter display and nibbles for late-start playback#765

Open
Roze061 wants to merge 5 commits into
Samillion:mainfrom
Roze061:late-chapter
Open

fix: handle chapter display and nibbles for late-start playback#765
Roze061 wants to merge 5 commits into
Samillion:mainfrom
Roze061:late-chapter

Conversation

@Roze061
Copy link
Copy Markdown

@Roze061 Roze061 commented May 31, 2026

FIX #764

Screenshot 2026-06-01 050303

Comment thread modernz.lua Outdated
@Roze061 Roze061 marked this pull request as draft May 31, 2026 22:16
@Samillion Samillion changed the title Refactor chapter visibility for late start chapter fix: handle chapter display and nibbles for late-start playback Jun 4, 2026
@Samillion
Copy link
Copy Markdown
Owner

Looks good to me.

I see you changed the status to a draft. Are you still working on something?

@Roze061
Copy link
Copy Markdown
Author

Roze061 commented Jun 4, 2026

@Samillion will using request_init be heavy on the cpu? to make the title go down when chapter_title is empty

@Samillion
Copy link
Copy Markdown
Owner

@Samillion will using request_init be heavy on the cpu? to make the title go down when chapter_title is empty

You mean in observe_cached("chapter", request_tick)? No, it's not called frequently to cause any performance impact.

Could you explain the problem in more detail? As just replacing _tick with _init is not ideal solution.

@Roze061
Copy link
Copy Markdown
Author

Roze061 commented Jun 4, 2026

state.initREQ = true for redraw request. like when fullscreen, when changing chapters it will also re-render

@Samillion
Copy link
Copy Markdown
Owner

Wouldn't a change in the layouts for chapter be better?

default layout:

--local chapter_index = user_opts.show_chapter_title and (state.chapter or -1) >= 0
++local chapter_index = user_opts.show_chapter_title and #state.chapter_list > 0 and (state.chapter or -1) >= 0

compact layout:

--local chapter_index = (state.chapter or -1) >= 0
++local chapter_index = #state.chapter_list > 0 and (state.chapter or -1) >= 0

In fact, both layouts should be this instead:

local chapter_index = #state.chapter_list > 0 and (state.chapter or -1) >= 0

@Roze061
Copy link
Copy Markdown
Author

Roze061 commented Jun 4, 2026

state.chapter is "-1" when chapter not start at 0, if not state.initREQ = true it will be invisible until there is request_init

@Samillion
Copy link
Copy Markdown
Owner

Indeed. I don't see a problem with using _init here, to be honest.

Could you also make the change to local chapter_index place, so that everything's clean.

local chapter_index = #state.chapter_list > 0 and (state.chapter or -1) >= 0

@Roze061 Roze061 marked this pull request as ready for review June 4, 2026 22:45
@Roze061
Copy link
Copy Markdown
Author

Roze061 commented Jun 4, 2026

(chapter: use request_init instead of #chapter_list)chapter: use request_init instead of #chapter_list
Recording-2026-06-05-055532.gif

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.

Chapter title hidden when chapter property value "-1" at start

2 participants