song select: refresh a folder's song count text when the count changes #10

Merged
Yonokid merged 1 commits from GanYiZhong/PyTaikoGreen:fix/folder-count-refresh into main 2026-10-05 13:45:22 +02:00
Contributor

Summary

On song select, the song count on a genre folder ("全N曲") could stay at 0 for the whole session. This happened, for example, to the folder under the cursor at startup.

The cause: folder_texts builds a folder's texts on first draw and caches them. But the engine fills in tja_count with a background scan that finishes after the boxes are first drawn. So a box drawn before its scan finished kept the "0 songs" text until the skin reloaded.

The fix: the cache now remembers the count it was built with. When box.tja_count changes, it rebuilds only the count text; the name and explanation texts are untouched. Child skins that use this script (Nijiiro, Red) get the fix as well.

Testing

Tested on Windows with a library of about 3000 charts, launching straight into song select:

  • Before: Pop showed 全0曲 for the whole 40-second run.
  • After: it shows 全685曲 about 3 seconds after song select opens, once the scan finishes.

🤖 Generated with Claude Code

## Summary On song select, the song count on a genre folder ("全N曲") could stay at 0 for the whole session. This happened, for example, to the folder under the cursor at startup. The cause: `folder_texts` builds a folder's texts on first draw and caches them. But the engine fills in `tja_count` with a background scan that finishes after the boxes are first drawn. So a box drawn before its scan finished kept the "0 songs" text until the skin reloaded. The fix: the cache now remembers the count it was built with. When `box.tja_count` changes, it rebuilds only the count text; the name and explanation texts are untouched. Child skins that use this script (Nijiiro, Red) get the fix as well. ## Testing Tested on Windows with a library of about 3000 charts, launching straight into song select: - **Before:** Pop showed 全0曲 for the whole 40-second run. - **After:** it shows 全685曲 about 3 seconds after song select opens, once the scan finishes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GanYiZhong added 1 commit 2026-10-05 08:13:41 +02:00
The folder texts are cached on first draw, but the engine fills in a
folder's song count with a background scan after the boxes are first
drawn, so the count text stayed at 0 for the rest of the session (e.g.
the folder under the cursor at startup kept showing 0 songs). The cache
now remembers the count it was built with and rebuilds that one text
when box.tja_count changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yonokid merged commit 605e43f335 into main 2026-10-05 13:45:22 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Yonokid/PyTaikoGreen#10