insin / control-panel-for-twitter

Browser extension which gives you more control over your Twitter timeline and adds missing features and UI improvements - available for desktop and mobile browsers
https://jbscript.dev/control-panel-for-twitter
MIT License
1.93k stars 63 forks source link

Method for limiting the impact of breaking Twitter changes while the extension is fixed and published #221

Open insin opened 1 year ago

insin commented 1 year ago

This is how the last 3½ years of Control Panel for Twitter have gone:

  1. Twitter deploys a change which affects Control Panel for Twitter in some way (e.g. replacing the sparkle menu with timeline tabs, moving the position of the Views counter)
  2. I get an email, or a message on Twitter, or an issue on GitHub, or I open up Twitter and can see something's wrong
  3. I figure out which features are affected
  4. I work on a fix and submit a new version to browser extension stores
  5. Browser extension stores publish the new version (can take minutes, hours or days, it's a crapshoot basically)

Problem

While steps 4 and 5 are happening, Control Panel for Twitter users are getting weirdness (e.g. replies being hidden instead of views), degradation of the main functionality (e.g. Control Panel for Twitter can no longer find your timeline to hide things you don't want to see) or worse (e.g. trying to click a Sparkle button which no longer exists, and as a result clicking the first item in the first menu which pops up).

While this is happening, some users are complaining that Twitter is broken, some are realising it's Control Panel for Twitter that's been broken by Twitter, some are figuring out which options to disable, and some are just disabling the extension entirely. Usually by this point I'm at the mercy of browser extension stores in terms of how quickly a fixed version can get out to people.

Solution

After step 3, I could upload a JSON file to somewhere with the affected version number of the now-impaired extension as its filename - e.g. 2.25.0.json - when Control Panel for Twitter's content script loads, it could periodically (let's say no more than once an hour) ping a URL corresponding to its version number - e.g. https://insin.github.io/control-panel-for-twitter/2.25.0.json.

If it gets a 404, all is well. If it gets a file back, that file should contain information about what's been broken and the severity.

If a feature is completely broken - whether preventing access to functionality in some way (hiding the link replies instead of views) or something more major (potentially clicking something it shouldn't) - it should be forced off and its option should be disabled in the option dialogue. There should be some help text indicating why it's broken and temporarily disabled.

If a feature just doesn't work properly but is ultimately harmless or is otherwise a minor/purely visual thing, we should leave it up to the used but display some help text to indicate that it's not working properly.

These changes should only apply to the options page while you're using the broken version of the extension - as soon as the next version is released and you upgrade, these changes will be undone - in particular if we automatically turned a broken feature off, we should turn it back on again the first time the updated version of Control Panel for Twitter runs.

We should also communicate this state to the user somehow - we can display a coloured button on the browser action indicating current status, and if we're going to automatically turn features off we should probably pop something up on top Twitter itself to let the user know when the extension has detected an issues file. The options page should probably also have a message at the top indicating the degree of brokenness - e.g. "Some options are disabled due to being incompatible with a Twitter change", "Some features are not working properly due a Twitter change" - and letting the user know this should be fixed once an update is available.

zopieux commented 1 year ago

We should also communicate this state to the user somehow - we can display a coloured button on the browser action indicating current status, and if we're going to automatically turn features off we should probably pop something up on top Twitter itself to let the user know when the extension has detected an issues file.

Great idea — please remember mobile users won't have any visible surface you can control beyond the banner thing (second part of the above suggestion), so it's important to display it every time there is degradation, on mobile at least.

Thanks for maintaining this great extension, doing God's work!

insin commented 1 year ago

After last week's major breakage which was fixed by changing a single CSS selector, if we do this, we could also use it to patch the main CSS selectors (say if Twitter revert the change soon, which they've done before after major timeline changes).