Skip to content

Add year in review feature to web UI #32709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Oct 31, 2024

Follow-up to #28693.

Even though we were planning a more extensive recap feature we will likely not be able to deliver it in full before year's end, so this is a minimal one-screen implementation so we don't lose another year. This adds a new type of notification that opens a modal window with the summary screen.

grafik

grafik

@Gargron Gargron added the ui Front-end, design label Oct 31, 2024
@Gargron Gargron force-pushed the feature-annual-reports-web branch 5 times, most recently from 4fa6eb0 to 1d1e646 Compare October 31, 2024 06:59
@Gargron Gargron marked this pull request as ready for review October 31, 2024 07:34
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeating my concerns from #28693 as those have not changed:

I'm still not a fan of the popularity-based information, and I still have concerns regarding the performance cost of generating a large number of these reports, and regarding the fact this essentially holds (small amounts of) user metadata the user can't remove unless they outright delete their account.

I have also left a few more specific inline comments.

Otherwise, the UI looks good and the mascots are very cute!

@mjankowski
Copy link
Contributor

Looks like the endpoint here is api-only, and the exposure/visibility is js-produced web-app-only? It would be delightful if some version of this could be produced at a shareable url that generated a pleasant opengraph experiençe.

Separately - do those PNGs exist as SVG?

@Gargron
Copy link
Member Author

Gargron commented Oct 31, 2024

It would be delightful if some version of this could be produced at a shareable url that generated a pleasant opengraph experiençe.

I agree it would be nice to generate a shareable image but I don't see a way we could do it. Do you know of a way?

Separately - do those PNGs exist as SVG?

The art was delivered to me as a PSD file, so not vector. Why?

@mjankowski
Copy link
Contributor

I agree it would be nice to generate a shareable image but I don't see a way we could do it. Do you know of a way?

Just to clarify, I did NOT mean like generate a png or poster size PDF or something ... those are doable, but probably more trouble than worth, especially in time available.

I was mainly thinking of exposing a URL (/@user/wraps/2024 or something?) that would have basically the same contents or similar as this modal as its html page, but also some basic opengraph markup such that when shared there was a nice preview ... presumably the "archetype image" as an image and then some variation of "Year in review for {user}" sort of thing as link? Maybe something instance/user specific.

I think what's sort of enjoyable about these sorts of things from other platforms and giving people some easy path to sharing and self-commenting on their own prior year.

The art was delivered to me as a PSD file, so not vector. Why?

Some mix of smaller file size concerns, and "responsiveness" if we could find some way to make shareable page links.

@Gargron Gargron force-pushed the feature-annual-reports-web branch from 1d1e646 to 11dc46d Compare November 4, 2024 11:54
@Gargron
Copy link
Member Author

Gargron commented Nov 4, 2024

The graphics contain gradients so I cannot cleanly vectorize them.

@Gargron Gargron force-pushed the feature-annual-reports-web branch from 11dc46d to d785ad5 Compare November 5, 2024 13:09
@Gargron Gargron force-pushed the feature-annual-reports-web branch from d785ad5 to a596fb1 Compare November 5, 2024 13:20
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My overall concerns about the feature remain, but the implementation looks correct.

I'm still worried about the performance, but as far as I can tell, this still does not add code to generate the reports other than fully manually from a Rails console, so that can still be evaluated and fixed before this goes live.

@Gargron Gargron enabled auto-merge November 5, 2024 14:32
@Gargron Gargron added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit d6349c0 Nov 5, 2024
30 checks passed
@Gargron Gargron deleted the feature-annual-reports-web branch November 5, 2024 14:49
@seefood
Copy link
Contributor

seefood commented Nov 10, 2024

asking on behalf of the translators, can someone clarify the cryptic names for the archtypes? I deduced "cool hunter" means someone who reposts a lot, but what are the social butterfly, oracle, etc? It would help not only the translators, but also the users if there were some explanations...

@CyberTailor
Copy link

Literal translation would make no sense indeed, some guidelines for translators are needed to make their own "adaptation" of Wrapstodon using the cultural context people would be familiar with.

@ClearlyClaire
Copy link
Contributor

Looking at the string identifiers and the code:

  • the “lurker” is someone who posts, replies, and boosts less than a certain amount a year
  • the “cool-hunter” is someone who boosts more than twice what they post
  • the “pollster” is someone whose posts are at least 10% polls
  • the “social butterfly” is someone who replies more than they post themselves
  • the “oracle” is a person that does not fall into any of these categories

The translation string identifier is pretty self-explanatory for these except for the oracle.

@GeopJr
Copy link
Contributor

GeopJr commented Nov 12, 2024

"That puts you in the top 1% of Mastodon users." sounds a bit misleading, shouldn't it be the instance name instead of 'Mastodon'?

E.g. "That puts you in the top 1% of mastodon.social users."

edit: (Claire also brought it up here #32709 (comment))

@halcy
Copy link
Contributor

halcy commented Dec 3, 2024

Question about this PR: Since (I guess?) 4.4.0 is unlikely to land before 2025, would a backport to 4.3.x / minor release with essentially just this be in the cards? I am hesitant to update to alpha / nightly.

Anyways, it turned out really cute, hope it ends up being a good starting point to make next years even better <3

@tribela
Copy link
Contributor

tribela commented Dec 4, 2024

Looking at the string identifiers and the code:

* the “lurker” is someone who posts, replies, and boosts less than a certain amount a year

* the “cool-hunter” is someone who boosts more than twice what they post

* the “pollster” is someone whose posts are at least 10% polls

* the “social butterfly” is someone who replies more than they post themselves

* the “oracle” is a person that does not fall into any of these categories

The translation string identifier is pretty self-explanatory for these except for the oracle.

Also need explaination what "We won't tell Bernie" means

@CyberTailor
Copy link

Also need explaination what "We won't tell Bernie" means

This message is displayed when you're in "top 5%" (whatever it means) users. Try to come up with something funny, literal translation will not make any sense anyway.

@Gargron
Copy link
Member Author

Gargron commented Dec 4, 2024

@halcy Additionally to this you'll want to cherry-pick #32710, #33148, #32807 and #32765, I hope I'm not missing anything.

@halcy
Copy link
Contributor

halcy commented Dec 4, 2024

Thanks! I'll have a look and if it looks sane, do a database backup and potentially give it a try once I have a few hours over the weekend!

@xrobau
Copy link
Contributor

xrobau commented Dec 18, 2024

For those that are interested in backporting, these are the commits that from the PRs mentioned above that can be cherry-picked:

d6349c0
32e5e1d
6cf8776
c2b498a
90f4ffa

There's a few little conflicts that need to be resolved, and if you don't want to do that yourself I have a 100% UNMAINTAINED BRANCH OF 4.3 here. Please do not comment on this PR if there are issues with it, talk to me directly.

https://github.com/xrobau/mastodon

To generate the Year In Review:

  • Run a db migration to add the new table RAILS_ENV=production bundle exec rails db:migrate
  • Launch the rails console RAILS_ENV=production bundle exec rails console
  • Prepare the table with AnnualReport.prepare(2024)
  • Actually generate the report using the following command:
User.joins(account: :account_stat)
    .confirmed
    .merge(Account.without_suspended)
    .includes(:account)
    .where(current_sign_in_at: (Date.new(2024, 1, 1)..)) # replace year here, too, if you want to run it for a different year
    .where(account_stats: { followers_count: (1..) }).find_each do |user|
  annual_report = AnnualReport.new(user.account, 2024).generate # replace year here, too, if you want to run it for a different year
  next if annual_report.nil? || annual_report.data['top_statuses'].values.all?(&:nil?) || annual_report.data['top_hashtags'].empty?
  NotifyService.new.call(user.account, :annual_report, annual_report)
end

Those instructions were found at https://blog.thms.uk/2024/12/how-to-run-wrapstodon - if something is not working, please check there!

renatolond pushed a commit to masto-donte-com-br/mastodon that referenced this pull request Dec 19, 2024
renatolond pushed a commit to masto-donte-com-br/mastodon that referenced this pull request Jan 16, 2025
renatolond pushed a commit to masto-donte-com-br/mastodon that referenced this pull request Apr 3, 2025
renatolond pushed a commit to masto-donte-com-br/mastodon that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Front-end, design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants