desktop: one read registry for every read button: single-flight per canonical key, broad reads cover narrow keys, overlapping buttons all busy and disabled (useReadState), 20 s 'read just now' memo, quota pause on the buttons, every read through the scheduler (Check again, Import apps, account Test, Read the stores, Dependencies), writes invalidate only the reads they change; tests/read-registry.test.ts; fixtures ?blocked and window.__fakeCalls
This commit is contained in:
parent
7345de2f7c
commit
c03938f9dc
14 changed files with 861 additions and 164 deletions
|
|
@ -12,6 +12,7 @@ import { pairCandidates, type UnifiedApp, withPair, withUnpair } from '../lib/id
|
|||
import { useNav } from '../nav';
|
||||
import { usePrefs } from '../prefs-ctx';
|
||||
import { useData } from '../store';
|
||||
import { ImportAppsButton, RefreshAllButton } from '../ui/ReadButtons';
|
||||
import { Icon, type IconName, StoreGlyph } from '../ui/icons';
|
||||
import { AppIcon, Chip, Kbd, MOD, Notice, Seg, StudioMark } from '../ui/kit';
|
||||
|
||||
|
|
@ -153,8 +154,8 @@ export function Settings({ onTheme: _onTheme, section }: { onTheme: () => void;
|
|||
{[1, 2, 3, 4, 6, 8].map(n => <option key={n} value={n}>{n}</option>)}
|
||||
</select><span className="hint">{t('set.parallelHint')}</span></div>
|
||||
<div className="actions">
|
||||
<button className="btn btn-sm" onClick={() => d.importApps()} disabled={d.importBusy || !d.accounts.length}><Icon name="download" />{t('action.importApps')}</button>
|
||||
<button className="btn btn-sm" onClick={() => { d.readAll(true).catch(() => {}); }}><Icon name="refresh" />{t('action.refreshAll')}</button>
|
||||
<ImportAppsButton />
|
||||
<RefreshAllButton />
|
||||
<span className="small muted">{d.live ? t('foot.lastRead', { when: ago(d.live.at) }) : t('foot.neverRead')}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue