Promote suggestion misses through the bulk-add modal, then delete them

Suggestion Misses' "Promote Selected" now opens the same bulk-add modal
shape as Suggestions' "Create Many" (editable phrases textarea +
lang/intent), prefilled with the selected misses' own text/language, and
submits via batchCreateSuggestions() so edited/added lines are honored.

Once that succeeds, the selected misses are deleted via the new
batchDeleteSuggestionMisses() (DELETE /admin/suggestion-misses/batch) so
they don't linger in the list now that they're suggestions. This is
best-effort: a failed cleanup doesn't undo the promotion, just surfaces a
separate warning notification.
This commit is contained in:
Nyan Lin Paing
2026-09-03 20:42:56 +07:00
parent 74578d10e3
commit 051b091ef8
4 changed files with 134 additions and 17 deletions
@@ -275,6 +275,15 @@ class BnfexpressAdminClient
], fn (mixed $value): bool => $value !== null));
}
/**
* @param list<int|string> $missIds
* @return array{deleted: int, skipped: int}
*/
public function batchDeleteSuggestionMisses(array $missIds): array
{
return $this->request('DELETE', '/admin/suggestion-misses/batch', body: ['miss_ids' => $missIds]);
}
// --- Suggestion sync/embeddings ------------------------------------------
/**