fix(economic): fix national debt panel hang + add lazy pagination (#1928)

- Remove persistCache from nationalDebtBreaker: IndexedDB hydration on
  first call can deadlock in some browsers, causing the panel to hang
  indefinitely showing "Loading debt data from IMF..." with no timeout
- Add 20s hard deadline via Promise.race so loading always resolves
- Extract _fetchNationalDebt() to avoid top-level await in the race
- Lazy-load 20 countries initially with "Load more" button (+20 each tap)
  instead of rendering all 187 rows at once; resets on sort/search change
- Ticker only updates visible rows (not all 187)
This commit is contained in:
Elie Habib
2026-03-20 17:11:41 +04:00
committed by GitHub
parent 7711e9de03
commit c6099d785a
3 changed files with 58 additions and 5 deletions

View File

@@ -20264,6 +20264,30 @@ body.has-breaking-alert .panels-grid {
min-width: 70px;
}
.debt-load-more {
width: 100%;
padding: 8px;
margin: 4px 0;
background: none;
border: 1px solid var(--border);
border-radius: 4px;
color: var(--text-dim);
font-size: 11px;
cursor: pointer;
text-align: center;
flex-shrink: 0;
transition: border-color 0.15s, color 0.15s;
}
.debt-load-more:hover {
border-color: var(--accent);
color: var(--accent);
}
.debt-load-more-count {
opacity: 0.6;
}
.debt-footer {
display: flex;
justify-content: space-between;