Add Friends by their Riot ID from the Account selector (#116)
CI / core (pull_request) Successful in 1m42s
CI / core (pull_request) Successful in 1m42s
- The selector lists « Vos Comptes », « Amis » (when there are some) and a last entry « Ajouter un ami… » that opens a Pseudo#TAG field validated by Entrée; refusals are shown with the field, the missing key with a way to « Paramètres ». - A Friend's history is imported on its own below-normal thread, one import at a time (the latest asked for wins), when it is added, chosen in the selector and on « Actualiser » while it is shown; never at launch or on a timer. - The Défi reloads as Matches arrive (at most once a second) and the header says « Import de Pseudo : n / N Parties »; a failure shows as one alert line, an import of a deleted Friend ends silently. - Tests with a simulated Riot source, docs/interface.md and the user guide updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d601d30605
commit
0f13ecbc80
16 files changed
+942
-36
No files matched your search
@@ -127,6 +127,16 @@ pub fn sync_line(
|
||||
}
|
||||
}
|
||||
|
||||
/// The status line while the history of the Friend `name` is imported.
|
||||
pub fn friend_sync_line(name: &str, progress: Option<SyncProgress>) -> String {
|
||||
match progress {
|
||||
Some(p) if p.to_fetch > 0 => {
|
||||
format!("Import de {name} : {} / {} Parties", p.fetched, p.to_fetch)
|
||||
}
|
||||
_ => format!("Import de {name}…"),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -217,6 +227,19 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_friend_line_names_the_friend() {
|
||||
let progress = SyncProgress {
|
||||
fetched: 3,
|
||||
to_fetch: 10,
|
||||
};
|
||||
assert_eq!(
|
||||
friend_sync_line("Bob", Some(progress)),
|
||||
"Import de Bob : 3 / 10 Parties"
|
||||
);
|
||||
assert_eq!(friend_sync_line("Bob", None), "Import de Bob…");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_sync_line_follows_what_is_running() {
|
||||
let progress = SyncProgress {
|
||||
|
||||
Reference in new issue
Block a user