feat: 1:1 Yandex ID account menu, official WordsCard AI replies, VibeResetButton pill, and git.tatar updater

This commit is contained in:
marwy 2026-11-27 13:43:33 +03:00
parent 682e3579ab
commit 6c30a33a9b
28 changed files with 2574 additions and 461 deletions

View file

@ -8,6 +8,8 @@ pub struct UserAccount {
pub display_name: String,
pub has_plus: bool,
pub avatar_uri: Option<String>,
#[serde(default)]
pub default_email: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@ -393,3 +395,61 @@ pub struct MetatagDetail {
pub artists: Vec<ArtistSummary>,
pub playlists: Vec<PlaylistSummary>,
}
/// Optional clickable action link attached to an AI WordsCard (`card.action`).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WordsCardAction {
pub title: String,
pub url: String,
}
/// External source citation attached to an AI WordsCard / WordsBigCard (`actions[]`).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WordsCardSource {
pub title: String,
pub url: String,
pub favicon_url: Option<String>,
}
/// Official 5.129.0 AI Track Fact / Reply card returned by `POST /words/cards`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WordsCard {
pub id: String,
pub track_id: String,
pub text: String,
pub tags: Vec<String>,
pub action: Option<WordsCardAction>,
pub actions: Vec<WordsCardSource>,
pub big_card_ids: Vec<String>,
pub feedback_state: Option<String>,
}
impl WordsCard {
pub fn is_fact(&self) -> bool {
self.tags.iter().any(|t| t == "FACT")
}
pub fn is_liked(&self) -> bool {
self.feedback_state
.as_deref()
.map_or(false, |s| s.eq_ignore_ascii_case("like"))
}
pub fn is_disliked(&self) -> bool {
self.feedback_state
.as_deref()
.map_or(false, |s| s.eq_ignore_ascii_case("dislike"))
}
pub fn has_big_card(&self) -> bool {
!self.big_card_ids.is_empty()
}
}
/// Expanded full-screen AI fact/story card returned by `POST /words/big-cards`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WordsBigCard {
pub id: String,
pub text: String,
pub actions: Vec<WordsCardSource>,
}