Fix hidden add/remove template buttons, add per-template login filter

The add/remove template buttons sat directly below the fixed-height
list with only 6px of margin to the tab's bottom edge - enough on this
dev machine but not on the operator's real one (different DPI/font
scale), so the buttons rendered off the visible area. Moved them above
the list instead (visibility no longer depends on how much space is
left at the bottom) and gave the whole "Шаблоны" tab substantially
more vertical room throughout.

Also added an optional per-template login regex filter
(MailTemplateDefinition.LoginPattern): once a file's suffix matches a
template, its login must also match that template's pattern (if any)
or the row surfaces as a clear Error in the preview instead of
silently going through - addresses "непонятно что будет работать".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
redlineoandClaude Sonnet 5 committed 2026-07-24 12:23:54 +03:00
1 parent 804b9610ca
commit 6e823954a3
8 files changed
+385 -50

No files matched your search

@@ -30,5 +30,19 @@ namespace BulkArchiveMailer.Core
public string Subject { get; set; } = "";
public string BodyHtml { get; set; } = "";
/// <summary>
/// Optional regular expression the parsed login (from
/// "{login}_{FileSuffix}.7z") must match (case-insensitively) for
/// this template to actually apply, checked by ArchiveScanner AFTER
/// the file's suffix has already matched this template. Empty (the
/// default) means "no restriction" - the original, pre-v1.2.0
/// behavior where suffix alone decides the match. Validated for
/// compilability by SettingsForm at save time; ArchiveScanner
/// itself treats an uncompilable pattern defensively as "does not
/// match" rather than throwing, in case an operator hand-edits
/// config.json with a broken regex.
/// </summary>
public string LoginPattern { get; set; } = "";
}
}