Add interface for muting users via CSS

Description

What it should do

For the time being, muting a user should consist of throwing a cached bit of CSS into the page <head> after all stylesheets (including sandbox.css), e.g., .user-111, .user-222 { display: none !important; visibility: hidden !important; }. (The numbers are the muted users' IDs.)

This will hide all of a user's works, series, and bookmarks from work and bookmark listings and search results, as well as any logged-in comments the user has left on works or news posts.

The cache should be expired whenever a user mutes or unmutes a user.

You should only be able to mute 1000 users. This number should be configurable.

Who you can mute

You should not be able to mute:

  • official accounts; you should receive an error.

    • Text: Sorry, you can't mute an official account.

  • yourself; there shouldn’t even be a button for this on dashboards or profiles, and you should receive an error if you attempt it from the Muted Users page.

    • Text: Sorry, you can't mute yourself.

How you can mute

  • Wherever the button appears, it should say “Mute” when the user is not currently muted and “Unmute” when the user is currently muted. (We’re calling it “the mute button” below for simplicity.)

  • The mute button should only be shown to logged in users.

  • Checks for whether a particular user can be muted (e.g., is it an official account) should occur after pressing the mute button, not before displaying it.

  • Muting or unmuting a user should require confirmation, no matter where you are muting or unmuting them from.

    • This should be a full page confirmation that provides information about what muting does, similar to the confirm_block.html.erb pages for confirming blocks. (It will eventually offer additional options.)

    • The confirmation pages for blocking and unblocking will also need text changes.

Text for muting confirmation page:

Mute testy

Are you sure you want to mute testy? Muting a user:

  • completely hides their works, series, bookmarks, and comments from you; there will be no empty space, placeholder text, or other indication something has been removed

Muting a user will not:

  • prevent you from receiving comment or subscription emails from this user

  • hide their works, series, bookmarks, and comments from anyone else

To prevent a user from commenting on your works or replying to your comments elsewhere on the site, visit <a href="/users/USERNAME/blocked/users">your Blocked Users page</a>.

Please note that if you are not using the default site skin, muting may not work properly. The Skins and Archive Interface FAQ has <a href="/faq/skins-and-archive-interface#restoresiteskin">instructions for reverting to the default site skin</a>.

Text for unmuting confirmation page:

Unmute testy

Are you sure you want to unmute testy? Unmuting a user allows you to:

  • see their works, series, bookmarks, and comments on the site

Updated text for blocking confirmation page:

Block testy

Are you sure you want to block testy? Blocking a user prevents them from:

  • commenting on your works

  • replying to your comments anywhere on the site

Blocking a user will not:

  • hide their works or bookmarks from you

  • delete comments they previously left on your works; you can delete these individually

  • hide their comments elsewhere on the site

To hide a user's works, bookmarks, series, and comments from you, visit <a href="/users/USERNAME/muted/users">your Muted Users page</a>.

Updated text for unblocking confirmation page:

No changes.

From dashboards and profiles

  • User and pseud dashboards, as well as user profiles, should have a mute button located to the right of the block button.

  • Your own dashboard or profile should not have a mute button.

From the Muted Users page

  • Your preferences page should have a "Muted Users" link on top, to the right of "Blocked Users." (Note: Admins cannot access a user’s preferences, so they will need to manually enter the URL.)

  • This link should point to the Muted Users page, located at https://test.archiveofourown.org/users/USERNAME/muted/users, where you should be able to manage your muted users.

  • The Muted Users page should be accessible only by the user who owns the page as well as by admins with the policy_and_abuse, support, or superadmin roles.

  • Admins should be able to see all the buttons, but should receive an error if actually attempting to mute or unmute users.

  • Below the “Muted Users” <h2>, there should be a navigation <ul> containing button-style “Blocked Users” and “Muted Users” links to allow for ease of switching between blocking and muting. (Like other navigation, the links should be created using span_if_current.)

    • This navigation should also be added to the Blocked Users page.

  • At the top of the page, there should be detailed information about what muting does.

    • The text on the Blocked Users page will also need to be updated.

  • It should be possible to mute additional users from this page via a tiny form (with autocomplete) like the one for blocking users.

  • The page should display the default pseud blurbs for users you've muted, ranging from newest at the top to oldest at the bottom, with the sort explicit in the code. It should be paginated.

  • The pseud blurbs should contain a mute button in the lower right corner. (Functionally, this will only ever be the “Unmute” form of the button.)

 

Text for top of Muted Users page:

Muted Users

You can mute up to 1,000 users. Muting a user:

  • completely hides their works, series, bookmarks, and comments from you; there will be no empty space, placeholder text, or other indication something has been removed

Muting a user will not:

  • prevent you from receiving comment or subscription emails from this user

  • hide their works, series, bookmarks, and comments from anyone else

To prevent a user from commenting on your works or replying to your comments elsewhere on the site, visit <a href="/users/USERNAME/blocked/users">your Blocked Users page</a>.

Please note that if you are not using the default site skin, muting may not work properly. The Skins and Archive Interface FAQ has <a href="/faq/skins-and-archive-interface#restoresiteskin">instructions for reverting to the default site skin</a>

Updated text for top of Blocked Users page:

Blocked Users

Blocking a user prevents them from:

  • commenting on your works

  • replying to your comments anywhere on the site

Blocking a user will not:

  • hide their works or bookmarks from you

  • delete comments they previously left on your works; you can delete these individually

  • hide their comments elsewhere on the site

To hide a user's works, bookmarks, series, and comments from you, visit <a href="/users/USERNAME/muted/users">your Muted Users page</a>.

 

Additional changes

At the top of work and bookmark listings or search results, we will advise logged in users they can mute users and warn them that counts may be inaccurate if they have done so.

Text:

You have muted some users on the Archive. Some items may not be shown, and any counts may be inaccurate. You can mute or unmute users on <a href="/users/USERNAME/muted/users">your Muted Users page</a>.

Notes

  • The migration can be a simple Rails migration; it does not need to be done with pt-online-schema-change.

  • The new table should include timestamps.

Deploy notes

  • Update ArchiveConfig.MAX_MUTED_USERS to match the value we decide on for blocks in

  • Migration version is 20220821213412

Attachments

2

Activity

lydia-theda 
February 6, 2023 at 3:28 PM

do you need a second person? The limit is now 2,000 for both.

Sarken 
February 6, 2023 at 6:57 AM

Says 2000 is the limit now!

lydia-theda 
January 31, 2023 at 2:33 PM
(edited)

Confirming that it’s now “official user” for both blocking and muting

Inspect element shows relative links for both the muted users page and the muting confirmation page

unmute confirmation page now has a comma after bookmarks

looks good

redsummernight 
January 31, 2023 at 7:04 AM

Checked the latest fix:

  • The confirm message when trying to block / mute an official user says “Sorry, you can't block an official user.“ / “Sorry, you can't mute an official user.“

  • FAQ links on the muted users page and the mute confirmation page are relative.

  • The unmute confirm page says “see their works, series, bookmarks, and comments on the site“.

Additionally, as an admin with role “superadmin“:

  • Could view someone’s muted users list.

  • Tried adding to someone’s muted users, got “Sorry, you don't have permission to access the page you were trying to reach. Please log in.“ before reaching the confirm page.

  • Tried removing from someone’s muted users (click “Unmute” on the pseud blurb of an existing entry), got “Sorry, you don't have permission to access the page you were trying to reach. Please log in.“ before reaching the confirm page.

Looks good!

Sarken 
January 31, 2023 at 6:16 AM

https://github.com/otwcode/otwarchive/pull/4446

Testing Instructions

  • Try to both block and mute an official user and confirm the message says "user" and not "account"

  • Mute someone, and then unmute them and make sure the confirmation page says "see their works, series, bookmarks, and comments on the site"

  • Check the FAQ link on your muted users page and the mute confirmation page and ensure it is relative

DeployedToBeta

Details

Assignee

Reporter

Roadmap

Misc

Priority

Affects versions

Fix versions

Components

BackEnd
FrontEnd

Difficulty

Milestone

Sentry

Created July 10, 2022 at 3:48 AM
Updated June 16, 2023 at 3:27 AM
Resolved February 8, 2023 at 9:45 PM