4 ms·
> you still cannot collapse the sidebar on the left The sidebar bothers me all the time, when I want to have two windows side-by-side on my screen. The actual
by bccdee 5y ago
> you still cannot collapse the sidebar on the left
The sidebar bothers me all the time, when I want to have two windows side-by-side on my screen. The actual chat ends up being smaller than the sidebar.
I wrote a javascript bookmarklet that automatically shows/hides the sidebar element on hover. I've gotten a lot of use out of it. It's 821 characters --- less than three tweets long.
Why haven't they solved this problem for users? It's shocking that the only way to shrink the sidebar is to inject javascript.
- Rietty 5y agoWould you mind sharing/making a gist of it please?
- Liskni_si 5y agoNot OP but I also use a collapsible sidebar. Src here: https://github.com/liskin/dotfiles/blob/home/src-webextensions/discord.user.css https://github.com/liskin/dotfiles/blob/home/src-webextensio...
- bccdee 5y agoSure: javascript:(function(){ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } let sidehover = false; let guildhover = false; let sidebar = document.getElementsByClassName("sidebar-2K8pFh")[0]; let guildbar = document.getElementsByClassName("guilds-1SWlCJ")[0]; async function hide() { await sleep(50); if (!sidehover && !guildhover) { sidebar.style.display="none"; } } async function show() { await sleep(150); if (sidehover || guildhover) { sidebar.style.display=""; } }; guildbar.addEventListener("mouseenter", () => { guildhover = true; show(); }); guildbar.addEventListener("mouseleave", () => { guildhover = false; hide() }); sidebar.addEventListener("mouseenter", () => { sidehover = true; show() }); sidebar.addEventListener("mouseleave", () => { sidehover = false; hide() }); hide(); })() The `sleep(150)` and `sleep(50)` can be tweaked to adjust the delay between when you hover over the server bar and when the channels bar is displayed (that's the 150 ms) and between when you move the mouse off the side bar and when the channels bar disappears (the 50 ms). If you're using the electron desktop app, you can open the javascript console with ctrl-shift-i and paste it in there for the same effect.
- bozhark 5y agoas Rietty said, would you please share? edit: i before e
- bccdee 5y agoI posted it as a reply to Rietty -- https://news.ycombinator.com/item?id=28343549 https://news.ycombinator.com/item?id=28343549.