Select contacts, and empty an address book
Raised on #174 as the other half of a migration -- import, notice something is wrong, empty the book, correct the export, import again -- and tracked as #277. The gap turned out to be wider than the ask. Contacts had no multi-select at all: the only delete in the module was the cross on a single card's pane, one card and one confirmation at a time. `destroyCards` has taken a list and batched it against maxObjectsInSet since #218, and nothing in the UI ever handed it more than one id. So "empty this address book" was missing, and so was "delete these fourteen". The list now has checkboxes, on hover the way the message list's are, and always on a touchscreen where there is no hover to reveal them. Shift-click takes the run between two rows. The search box gives way to a selection bar rather than sitting beside it, because what the count promises is what the search left on screen. A selection is cleared when the book being shown changes, since carrying it across would leave a count describing rows that are no longer there and a Delete aimed at them. Emptying a book is in the book's own menu, beside the import and export that moved there in #226, and separate from Delete, which takes the book with it. A default book cannot be deleted and can perfectly well be emptied, which is most of the reason it is its own entry. The part that is not a deletion, and the reason this is not one destroy over everything in the book: a card filed in two books belongs to both, and `ContactCard/set destroy` takes it away from both at once. Emptying one book must not empty another, so a card with a second home is patched out of this one and left alone. That is reported separately afterwards, because it would otherwise look like contacts that refused to go. `destroyCards` now answers with what the server confirmed rather than throwing on the first refusal. A refusal that took half a selection with it still deleted the other half, and an error saying only that it failed sends somebody looking for contacts that are already gone. Both callers report the count and the reason apart. Emptying a shared book is deliberately not offered: the cards live in the owner's account and this client has no path to write there. One bug found by driving the built app rather than by any test, and worth recording because of where it hid. The range a shift-click covers was measured inside the `setPicked` updater -- which React runs when it gets round to rendering, by which time the anchor ref has already been moved to the row that *ended* the range. Every shift-click selected exactly one row, and every store assertion still passed, because nothing was wrong below the component. The anchor is read before the updater now, and the contacts view has its first component tests: ten of them, six of which fail if the measurement moves back inside. Twelve new strings, in all nine catalogues, so nothing new falls back to English.
This commit is contained in:
@@ -1298,6 +1298,15 @@ export const catalog: Catalog = {
|
||||
// Sentences that lib/ and store/ were building in English, and the two
|
||||
// swipe labels that reach t() through a variable and so were invisible
|
||||
// to a scan for t("literal"). See #259.
|
||||
// ── Emptying an address book, and deleting a selection (#277) ──
|
||||
"This cannot be undone.": "Isso não pode ser desfeito.",
|
||||
"Some could not be deleted: {error}": "Alguns não puderam ser excluídos: {error}",
|
||||
"It was not deleted": "Não foi excluído",
|
||||
"Empty address book": "Esvaziar este catálogo de endereços",
|
||||
"There is nothing in it to delete": "Não há nada nele para excluir",
|
||||
"Empty “{name}”?": "Esvaziar “{name}”?",
|
||||
"Delete them": "Excluir todos",
|
||||
"Nothing was deleted": "Nada foi excluído",
|
||||
},
|
||||
plurals: {
|
||||
// ── Third pass ─────────────────────────────────────────────────────
|
||||
@@ -1349,5 +1358,10 @@ export const catalog: Catalog = {
|
||||
"Marked {n} messages as read": { one: "{n} mensagem marcada como lida", other: "{n} mensagens marcadas como lidas" },
|
||||
"in {n} folders": { one: "em {n} pasta", other: "em {n} pastas" },
|
||||
"Deleted {n} messages": { one: "{n} mensagem excluída", other: "{n} mensagens excluídas" },
|
||||
// ── Emptying an address book, and deleting a selection (#277) ──
|
||||
"Delete {n} contacts?": { one: "Excluir {n} contato?", other: "Excluir {n} contatos?" },
|
||||
"Deleted {n} contacts": { one: "{n} contato excluído", other: "{n} contatos excluídos" },
|
||||
"{n} contacts will be deleted. This cannot be undone.": { one: "{n} contato será excluído. Isso não pode ser desfeito.", other: "{n} contatos serão excluídos. Isso não pode ser desfeito." },
|
||||
"{n} were also in other address books and were only removed from this one": { one: "{n} contato também estava em outro catálogo de endereços e foi removido apenas deste", other: "{n} contatos também estavam em outros catálogos de endereços e foram removidos apenas deste" },
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user