Ricerca dei profili con suggerimenti e foto (#37)
«Aggiungi account» ha una sola casella: mentre Alberto scrive compaiono subito i suggerimenti locali, poi i profili di Instagram con la foto, come chiesto in #37. Il browser di Febe scrive nella casella «Cerca» di Instagram con tasti veri da una mappa chiusa (mai Invio, Tab o Esc), controlla prima il fuoco, legge la risposta della pagina e non clicca mai un risultato. La ricerca ha una categoria propria nel Governatore, con tetti larghi che non consumano quelli della raccolta, e si dà il turno con il motore sull'unica pagina; a fine sessione la pagina torna comunque al riposo. Le foto passano dal CDN con un permesso ciascuna e restano solo in memoria. Le risposte di Alberto del 15 novembre (controllo del fuoco, turni, evento requestWillBeSent, niente foto dei seguiti per ora) sono in §6.1 e in docs/decisioni.md. Su Instagram vero la ricerca parte quando i bersagli search-open e search-box saranno raccolti dal vivo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e417c666d
commit
9941a2fa1f
98 files changed
+8021
-229
No files matched your search
@@ -2,16 +2,18 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace Febe.Web.Library;
|
||||
|
||||
/// <summary>A user name read from a line of the «Per nome utente» text area.</summary>
|
||||
/// <summary>A user name read from the names pasted in «Aggiungi account»; <paramref name="Line"/> is its place (from 1).</summary>
|
||||
public sealed record ParsedUsername(int Line, string Username);
|
||||
|
||||
/// <summary>A line that is not a user name, with the reason in Italian.</summary>
|
||||
/// <summary>A pasted name that is not a user name, with its place and the reason in Italian.</summary>
|
||||
public sealed record UsernameProblem(int Line, string Text, string Reason);
|
||||
|
||||
/// <summary>
|
||||
/// «Per nome utente» (spec §4.2, mockup 04): one user name or profile address per line. Accepts «marta.demo»,
|
||||
/// «@marta.demo», «instagram.com/marta.demo», «https://www.instagram.com/marta.demo/?hl=it». Refuses addresses of
|
||||
/// posts, reels and other pages, and names Instagram would not accept. Names are compared and stored in lowercase.
|
||||
/// The names pasted or chosen in «Aggiungi account» (spec §4.2, mockup 04, issue #37): the window sends one name per
|
||||
/// line (it splits what Alberto pasted at line breaks, commas and semicolons). Accepts «marta.demo», «@marta.demo»,
|
||||
/// «instagram.com/marta.demo», «https://www.instagram.com/marta.demo/?hl=it». Refuses addresses of posts, reels and
|
||||
/// other pages, and names Instagram would not accept. Names are compared and stored in lowercase. The reasons speak
|
||||
/// of «names», not lines: the window shows each as «n° nome».
|
||||
/// </summary>
|
||||
public static partial class UsernameParser
|
||||
{
|
||||
@@ -43,7 +45,7 @@ public static partial class UsernameParser
|
||||
|
||||
if (line.Length > 300)
|
||||
{
|
||||
problems.Add(new UsernameProblem(number, line[..60] + "…", "Riga troppo lunga per essere un nome utente."));
|
||||
problems.Add(new UsernameProblem(number, line[..60] + "…", "Troppo lungo per essere un nome utente."));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ public static partial class UsernameParser
|
||||
|
||||
if (seen.TryGetValue(candidate, out var first))
|
||||
{
|
||||
problems.Add(new UsernameProblem(number, line, $"Già scritto alla riga {first}."));
|
||||
problems.Add(new UsernameProblem(number, line, $"Già scritto: è uguale al {first}° nome."));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -104,7 +106,7 @@ public static partial class UsernameParser
|
||||
text = text.Trim().TrimStart('@').ToLowerInvariant();
|
||||
if (text.Contains(' ', StringComparison.Ordinal))
|
||||
{
|
||||
return (null, "Un nome utente non contiene spazi: uno per riga.");
|
||||
return (null, "Un nome utente non contiene spazi: per cercare un nome e cognome scrivilo da solo nella casella.");
|
||||
}
|
||||
|
||||
return IsValid(text)
|
||||
|
||||
Reference in new issue
Block a user