Say which bulk entries were skipped !45

merged merged by cmc on 2026-10-26 01:28 UTC · krz/domain-dig:bulk-input-skipped into main

Discussion

cmc

Closes U5, the last open finding.

parsedDomains validated each token and dropped the failures via compactMap { try? DomainName.validate($0).get() }, so pasting ten domains with two typos ran eight and said nothing about the other two. Before !8 those entries ran and failed visibly per section, and the single-lookup path has reported its own error since — the asymmetry was the defect, not the validation.

It returns a ParsedBulkInput now: the domains that validate, deduplicated and in order, and the entries that do not, as the user typed them. runBulkLookup puts the message in bulkInputError, which the bulk field renders exactly the way the single field renders domainInputError, and which clears on the next edit.

The worst case was the silent one. With every entry invalid, guard !domains.isEmpty else { return } returned early, so the Run button did nothing at all and nothing explained why. That now says there is nothing to run and names what it rejected.

Entries are named, not just counted. "Two were skipped" does not tell anyone which to fix. A pasted list of typos names the first five and counts the remainder, so fifty bad entries do not become a wall of text.

One thing the tests pin deliberately: the separator set includes whitespace, so not valid!! is two rejected tokens rather than one. That is the parser's existing behaviour and the message reports both, which is why testBulkInputKeepsTheValidEntriesAndNamesTheRest asserts ["not", "valid!!"] rather than the phrase.

WorkflowsView has its own parsedDomains that trims and drops empties without validating at all. That is different behaviour rather than this defect, so it is left alone.

9 new tests covering the message in the singular, the plural, the nothing-to-run case, truncation, deduplication, and the three paths through runBulkLookup. 343 green on iOS 18.6 and 27.0. Ratchet unchanged at 280.