I had heard that this latest version of Mastodon (v3.5.3) has a secret edit button functionality built in to it, but I couldn’t find instructions on how to enable it anywhere online.
Anyway, someone put me on to Akkoma which has a well-built edit function enabled out of the box, so I spun up my own Akkoma instance to test it out and it worked flawlessly.
https://twitter.com/phocks/status/1576400097289842688?s=20&t=3ed9rIu-VDRSLdNJF7niGw
But then Jase pointed me in the right direction with this post “How to enable Masto's edit button”, which got me most of the way there. I had a bit of a play around, and after a few early failures, I eventually got it going! Here’s how you do it.
cd
into your Mastodon folder: /home/mastodon/live
app/javascript/mastodon/components/status_action_bar.js
app/javascript/mastodon/features/status/components/action_bar.js
menu.push({ text: intl.formatMessage(messages.edit), action: this.handleEditClick });
(as you can see the menu item is there, it’s just commented out)if (writtenByMe) {
// menu.push({ text: intl.formatMessage(messages.edit), action: this.handleEditClick });
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
}
cd
back to /home/mastodon/live
again.yarn run build:production
to build our edited JavaScriptsystemctl restart mastodon-sidekiq
systemctl reload mastodon-web
That’s it! Reload the page and click the three dots next to one of your posts and you should hopefully see a little Edit button. 🤞
Anyway, there you go. Here’s an edited tweet in the wild. If you found this useful, throw me a follow on bne.social or on my private instance or even on the dirty old bird site, or sponsor my open-source projects on GitHub if you’re feeling charitable.
See ya round 👋