Skip to content

Instantly share code, notes, and snippets.

@joshuat
Last active January 19, 2021 08:25
Show Gist options
  • Star 81 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save joshuat/9310780782f6526fc8717d6798a4d4b9 to your computer and use it in GitHub Desktop.
Save joshuat/9310780782f6526fc8717d6798a4d4b9 to your computer and use it in GitHub Desktop.
Remove the avatars from your slack sidebar

Slack has listened to feedback and given us a way to toggle off the sidebar avatars.

(This only seems to be available in the Beta channel at the moment)

Display or hide profile photos

  1. From your desktop, click your profile picture in the top right.
  2. Select Preferences from the menu.
  3. Click Sidebar in the left-side column.
  4. Check or uncheck the boxes next to Show profile photos next to DMs.
View previous instructions
  1. Message yourself /slackdevtools
  2. In the DevTools console:
function addStyle (styleString) {
  const style = document.createElement('style');
  style.textContent = styleString;
  document.head.append(style);
}

addStyle(`
  .p-channel_sidebar__presence_icon.p-channel_sidebar__presence_icon--on-avatar {
    transform: scale(1.5) translateX(-6px) translateY(-5px);
  }

  .p-channel_sidebar__mpim_counter {
    transform: scale(1.2) translateX(-4px) translateY(-4px);
  }

  span.p-channel_sidebar__mpim_avatars_mpim1.c-avatar {
    opacity: 0;
  }

  .p-channel_sidebar__channel span.c-avatar {
    opacity: 0;
  }

  .p-channel_sidebar__user_avatar--hide-presence .p-channel_sidebar__presence_icon--on-avatar {
    display: block;
    transform: scale(1.5) translateX(-3.5px) translateY(-9px);
  }
`);
@dducrest
Copy link

Thank you.

@mzjp2
Copy link

mzjp2 commented Nov 11, 2020

You are an absolute lifesaver, thank you!

@mzjp2
Copy link

mzjp2 commented Nov 11, 2020

I think if you combine the code here with the approach in this gist you can make it persist between restarts by patching the preload-bundle.js file in your Slack.app file to inject this piece of CSS on every domLoad call on Slack.

@dducrest
Copy link

@mzjp2, now we are cooking with gas! Thanks for the pointer.

@briannaschroer
Copy link

thank you so much for this!

@brianlovin
Copy link

Adding .p-channel_sidebar__channel, .p-channel_sidebar__link { margin-left: 12px; } will align all the list items so that category icons are on a more clear key line:

Screen Shot 2020-11-12 at 1 46 55 PM

@SrinivasBhat
Copy link

That worked like ... awesome. Thank you!

@mangefoo
Copy link

Awesome. Thanks!

@vytautas-k
Copy link

Thanks, man! Appreciate it a lot!

@rexcooper
Copy link

Thanks

@xaosaki
Copy link

xaosaki commented Nov 13, 2020

Combined this idea and this gist and fix points size:
look here

@djsudduth
Copy link

Thanks!

@iamwill
Copy link

iamwill commented Nov 13, 2020

You are the hero we don't deserve.

@sjhale
Copy link

sjhale commented Nov 13, 2020

Thank you! This has been a huge help.

@AGHG46087
Copy link

Awesome, this is great - whatever donut came up with the icons list - must have graduated in UI rocket science. one last question how can we make it persistent.

@peterter125
Copy link

Works like magic :)
Thanks a lot!

@xaosaki
Copy link

xaosaki commented Nov 17, 2020

Add text guide for permanent fix.

@ktmilligan
Copy link

Thank you!!!! You made my day!

@AnshumanTripathi
Copy link

Thanks you! Much appreciated!

@imasupersadpanda
Copy link

Has anyone successfully combined this and ryanhatfield's script into one element yet? If not, would anyone be willing to give me a pointer or two on how to smash these two together?

This code is a game changer and I'm really grateful for the UX improvement it gave back to me., so thanks a ton Joshua! On my company's workspace tho, it reverts pretty frequently - sometimes several times a day. I'd really like to apply a more stable hack/patch/whatever and these two pieces are the best approach I've found so far. I feel out of my depth trying to meld them. I assume it'll require modifying this section but my brain is just blue screening when I get beyond that conclusion.

@mzjp2
Copy link

mzjp2 commented Dec 1, 2020

Has anyone successfully combined this and ryanhatfield's script into one element yet? If not, would anyone be willing to give me a pointer or two on how to smash these two together?

@imasuperpanda - scroll up a few comments

@imasupersadpanda
Copy link

D'oh! Thanks, @mzjp2!

@sjhale
Copy link

sjhale commented Dec 9, 2020

Slack have listened to the feedback and made this change configurable!

How do I update my settings?
Click your workspace name (top left) > Preferences > Sidebar > “Show profile photos next to DMs”

Note: you may need to do a hard refresh (Cmd/Ctrl+Shift+R) to see it

SlackAvatars

@joshuat
Copy link
Author

joshuat commented Dec 9, 2020

@sjhale 🎉

@sochi
Copy link

sochi commented Dec 11, 2020

(This only seems to be available in the Beta channel at the moment)

This option seems to be available in stable releases too 🎉 (not sure if Slack does any gradual rollout of new changes but I am using a stable release and I can see the option there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment