mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
Show a Stopping state while indexing finishes its current batch
A requested stop only takes effect between batches, so the Stop button looked unresponsive. Report the stop request in the status line and disable the button until the batch finishes.
This commit is contained in:
parent
5d639d2242
commit
80d9c05648
3 changed files with 12 additions and 2 deletions
|
|
@ -109,6 +109,9 @@ Zotero_Preferences.Advanced = {
|
|||
if (status.error) {
|
||||
document.l10n.setAttributes(phaseLabel, 'preferences-advanced-semantic-search-error', { error: status.error });
|
||||
}
|
||||
else if (status.stopping) {
|
||||
document.l10n.setAttributes(phaseLabel, 'preferences-advanced-semantic-search-stopping');
|
||||
}
|
||||
else if (status.phase === 'downloading') {
|
||||
document.l10n.setAttributes(phaseLabel, 'preferences-advanced-semantic-search-downloading');
|
||||
}
|
||||
|
|
@ -128,8 +131,12 @@ Zotero_Preferences.Advanced = {
|
|||
document.getElementById('semantic-search-resume').hidden
|
||||
= status.indexing || !(status.error || status.paused || hasRemaining);
|
||||
|
||||
// Offer to stop indexing while it's running
|
||||
document.getElementById('semantic-search-stop').hidden = !status.indexing;
|
||||
// Offer to stop indexing while it's running; a requested stop takes
|
||||
// effect once the current batch finishes, so disable the button in
|
||||
// the meantime
|
||||
let stopButton = document.getElementById('semantic-search-stop');
|
||||
stopButton.hidden = !status.indexing;
|
||||
stopButton.disabled = !!status.stopping;
|
||||
|
||||
// Per-library "indexed / total" counts
|
||||
let grid = document.getElementById('semantic-search-libraries');
|
||||
|
|
|
|||
|
|
@ -1250,6 +1250,8 @@ Zotero.Embeddings.Indexing = new function () {
|
|||
enabled: Zotero.Embeddings.isEnabled(),
|
||||
model: Zotero.Embeddings.getModelName(),
|
||||
indexing: _indexing,
|
||||
// A stop has been requested but the current batch is still finishing
|
||||
stopping: _indexing && _stopping,
|
||||
paused: this.isPaused(),
|
||||
phase: _phase,
|
||||
error: _lastError ? (_lastError.message || String(_lastError)) : null,
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ preferences-advanced-semantic-search-multilingual =
|
|||
.label = Multilingual
|
||||
preferences-advanced-semantic-search-downloading = Downloading model…
|
||||
preferences-advanced-semantic-search-indexing = Indexing…
|
||||
preferences-advanced-semantic-search-stopping = Stopping…
|
||||
preferences-advanced-semantic-search-idle = Up to date
|
||||
preferences-advanced-semantic-search-paused = Indexing paused
|
||||
preferences-advanced-semantic-search-error = Indexing stopped: { $error }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue