Skip to content

Commit 16a1d64

Browse files
fix(query): perusertag
gated
1 parent fe74923 commit 16a1d64

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ async function runQuery() {
616616

617617
// Each secondary section is isolated so one failure can't blank the others or the primary content.
618618
await runSection("related hashtags", ctrl, async () => {
619-
setStatus("Fetching related hashtags…");
619+
setStatus("Fetching trending…");
620620
const trending = await apiGet("hashtags", param({ limit: "50" }), ctrl.signal);
621621
if (!alive()) return;
622622
// drop the exact searched tag(s); keep the co-occurring ones
@@ -694,6 +694,7 @@ async function loadLeaderboardPage(setPodium = false, forceFetch = false) {
694694
const env = await apiGet("leaderboard", p, ctrl.signal);
695695
state.batch = (env.items || []).map(transform);
696696
state.batchIndex = batchIndex;
697+
state.tagsGated = !!env.tags_gated;
697698
state.total = env.total || 0;
698699
state.totalPages = Math.max(1, Math.ceil(state.total / state.pageSize));
699700
sliceBatchToRows();
@@ -1212,7 +1213,10 @@ function openUserModal(username) {
12121213
</div>
12131214
<div class="ov-breakdown" id="modal-tag-details" hidden style="margin-top:10px">${tagHtml}</div>`;
12141215
} else {
1215-
html += `<div class="tag-stats-empty" style="margin-top:14px">No detailed tag stats reported for this contributor in this window.</div>`;
1216+
const emptyMsg = state.tagsGated
1217+
? "Per-contributor tag details aren't available yet for very large queries. The overall tag breakdown above still applies."
1218+
: "No detailed tag stats reported for this contributor in this window.";
1219+
html += `<div class="tag-stats-empty" style="margin-top:14px">${emptyMsg}</div>`;
12161220
}
12171221

12181222
$("#user-modal-body").innerHTML = html;

frontend/charts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function _ensureChartsSection() {
133133
<line x1="10" y1="3" x2="8" y2="21"/>
134134
<line x1="16" y1="3" x2="14" y2="21"/>
135135
</svg>
136-
Related hashtags
136+
Trending
137137
</div>
138138
<div class="osmsg-hashtag-stat-row">
139139
<span id="hashtag-stat-total"></span>

osmsg/query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def leaderboard(
465465
"page_size": page_size,
466466
"total": total,
467467
"total_pages": (total + page_size - 1) // page_size,
468+
"tags_gated": not small_history,
468469
}
469470

470471

0 commit comments

Comments
 (0)