huo
This commit is contained in:
+616
-153
File diff suppressed because it is too large
Load Diff
@@ -1615,8 +1615,13 @@
|
||||
}
|
||||
}
|
||||
} else if (!matchedCard && identifiers.length > 0 && currentTag && !isReCenteringFeed && !tagFeedLoading) {
|
||||
// Active item belongs to current tag context but is not in currently rendered slice
|
||||
// (e.g. after pressing Random in tag). Center feed around this active item!
|
||||
// Active item belongs to current tag context but is not in currently rendered slice.
|
||||
// If this was a pool-based random navigation, skip reload — keep existing items visible.
|
||||
if (window._isPoolRandomNav) {
|
||||
window._isPoolRandomNav = false;
|
||||
return;
|
||||
}
|
||||
// Non-pool navigation (next/prev): center feed around the active item
|
||||
isReCenteringFeed = true;
|
||||
loadTagFeed(true, identifiers[0]).finally(() => {
|
||||
isReCenteringFeed = false;
|
||||
@@ -2030,6 +2035,17 @@
|
||||
|
||||
// Reload recommendations or sync tag feed when user triggers Random (#random, #nav-random, or 'r' key)
|
||||
const handleRandomAction = () => {
|
||||
// If pool-based random is active, the context hasn't changed — skip reload
|
||||
if (window._randomPool && window._randomPool.items && window._randomPool.items.length > 1) {
|
||||
// Context is stable (same tag/hall/user) — just highlight the new item in tag feed
|
||||
const tag = getCurrentTag();
|
||||
if (tag && !userManuallySelectedNonTagTab) {
|
||||
// Refresh highlight in tag feed without re-fetching
|
||||
setTimeout(() => highlightActiveTagCard(true), 100);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Fallback: server-side random may change context, so reload
|
||||
recommendationsLoaded = false;
|
||||
const tag = getCurrentTag();
|
||||
if (tag) {
|
||||
|
||||
Reference in New Issue
Block a user