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:
@@ -1303,6 +1303,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.": "この操作は取り消せません。",
|
||||
"Some could not be deleted: {error}": "一部を削除できませんでした: {error}",
|
||||
"It was not deleted": "削除されませんでした",
|
||||
"Empty address book": "このアドレス帳を空にする",
|
||||
"There is nothing in it to delete": "削除するものがありません",
|
||||
"Empty “{name}”?": "「{name}」を空にしますか?",
|
||||
"Delete them": "削除する",
|
||||
"Nothing was deleted": "何も削除されませんでした",
|
||||
},
|
||||
plurals: {
|
||||
// ── Third pass ─────────────────────────────────────────────────────
|
||||
@@ -1359,5 +1368,10 @@ export const catalog: Catalog = {
|
||||
"Marked {n} messages as read": { other: "{n} 通のメールを既読にしました" },
|
||||
"in {n} folders": { other: "{n} 個のフォルダーで" },
|
||||
"Deleted {n} messages": { other: "{n} 通のメールを削除しました" },
|
||||
// ── Emptying an address book, and deleting a selection (#277) ──
|
||||
"Delete {n} contacts?": { other: "{n} 件の連絡先を削除しますか?" },
|
||||
"Deleted {n} contacts": { other: "{n} 件の連絡先を削除しました" },
|
||||
"{n} contacts will be deleted. This cannot be undone.": { other: "{n} 件の連絡先が削除されます。この操作は取り消せません。" },
|
||||
"{n} were also in other address books and were only removed from this one": { other: "{n} 件は他のアドレス帳にもあるため、このアドレス帳から外しただけです" },
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user