Fix stars page grouping to keep book items together

Group by first two breadcrumbs (e.g., "Books / 1 Corinthians") so that
chapters and verses from the same book appear in the same group instead
of being split across different groups.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-03 21:42:51 -05:00
parent 0738823b3f
commit fc8bb7f197
+7 -2
View File
@@ -851,9 +851,14 @@ kbd {
}
function getGroupBreadcrumbs(breadcrumbs) {
// Group by the first two meaningful breadcrumbs (e.g., "Books / 1 Corinthians")
// This keeps chapters and verses of the same book together
if (!breadcrumbs || breadcrumbs.length === 0) return [];
if (breadcrumbs.length <= 1) return breadcrumbs;
return breadcrumbs.slice(0, -1);
// Filter out "Home"
var filtered = breadcrumbs.filter(function(c) { return c.text !== 'Home'; });
if (filtered.length === 0) return [];
// Take first two items max (e.g., "Books" + "1 Corinthians")
return filtered.slice(0, 2);
}
function getBreadcrumbKey(breadcrumbs) {