add: dedicated responses tab for profiles

This commit is contained in:
trisua 2025-07-06 13:34:20 -04:00
parent 9ba6320d46
commit 07a23f505b
24 changed files with 332 additions and 55 deletions

View file

@ -124,6 +124,20 @@ impl DefaultTimelineChoice {
}
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub enum DefaultProfileTabChoice {
/// General posts (in any community) from the user.
Posts,
/// Responses to questions.
Responses,
}
impl Default for DefaultProfileTabChoice {
fn default() -> Self {
Self::Posts
}
}
#[derive(Clone, Debug, Serialize, Deserialize, Default)]
pub struct UserSettings {
#[serde(default)]
@ -285,6 +299,9 @@ pub struct UserSettings {
/// Automatically hide users that you've blocked on your other accounts from your timelines.
#[serde(default)]
pub hide_associated_blocked_users: bool,
/// Which tab is shown by default on the user's profile.
#[serde(default)]
pub default_profile_tab: DefaultProfileTabChoice,
}
fn mime_avif() -> String {
@ -504,10 +521,15 @@ pub struct ExternalConnectionData {
}
/// The total number of achievements needed to 100% Tetratto!
pub const ACHIEVEMENTS: usize = 30;
pub const ACHIEVEMENTS: usize = 34;
/// "self-serve" achievements can be granted by the user through the API.
pub const SELF_SERVE_ACHIEVEMENTS: &[AchievementName] =
&[AchievementName::OpenTos, AchievementName::OpenPrivacyPolicy];
pub const SELF_SERVE_ACHIEVEMENTS: &[AchievementName] = &[
AchievementName::OpenReference,
AchievementName::OpenTos,
AchievementName::OpenPrivacyPolicy,
AchievementName::AcceptProfileWarning,
AchievementName::OpenSessionSettings,
];
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub enum AchievementName {
@ -541,6 +563,10 @@ pub enum AchievementName {
CreateRepost,
OpenTos,
OpenPrivacyPolicy,
OpenReference,
GetAllOtherAchievements,
AcceptProfileWarning,
OpenSessionSettings,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
@ -583,6 +609,10 @@ impl AchievementName {
Self::CreateRepost => "More than a like or comment...",
Self::OpenTos => "Well informed!",
Self::OpenPrivacyPolicy => "Privacy conscious",
Self::OpenReference => "What does this do?",
Self::GetAllOtherAchievements => "The final performance",
Self::AcceptProfileWarning => "I accept the risks!",
Self::OpenSessionSettings => "Am I alone in here?",
}
}
@ -618,6 +648,10 @@ impl AchievementName {
Self::CreateRepost => "Create a repost or quote.",
Self::OpenTos => "Open the terms of service.",
Self::OpenPrivacyPolicy => "Open the privacy policy.",
Self::OpenReference => "Open the source code reference documentation.",
Self::GetAllOtherAchievements => "Get every other achievement.",
Self::AcceptProfileWarning => "Accept a profile warning.",
Self::OpenSessionSettings => "Open your session settings.",
}
}
@ -655,6 +689,10 @@ impl AchievementName {
Self::CreateRepost => Common,
Self::OpenTos => Uncommon,
Self::OpenPrivacyPolicy => Uncommon,
Self::OpenReference => Uncommon,
Self::GetAllOtherAchievements => Rare,
Self::AcceptProfileWarning => Common,
Self::OpenSessionSettings => Common,
}
}
}