Mirror of https://github.com/improsocial/impro An extensible Bluesky client for web impro.social
6

Configure Feed

Select the types of activity you want to include in your feed.

Fix sidebar scroll restore bug

Grace Kind (Jul 15, 2026, 7:42 PM -0500) bfb544fd 77e2b41f

+14 -13
+1 -1
package.json
··· 1 1 { 2 2 "name": "impro", 3 - "version": "0.17.169", 3 + "version": "0.17.170", 4 4 "type": "module", 5 5 "scripts": { 6 6 "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve",
+2 -2
src/js/components/animated-sidebar.js
··· 63 63 this.querySelector("dialog.sidebar").showModal(); 64 64 } 65 65 66 - close() { 66 + close({ restoreScroll = true } = {}) { 67 67 if (!this.isOpen) { 68 68 return; 69 69 } 70 70 this.isOpen = false; 71 - this.scrollLock.unlock(); 71 + this.scrollLock.unlock({ restoreScroll }); 72 72 const dialog = this.querySelector("dialog.sidebar"); 73 73 if (dialog.hasAttribute("open")) { 74 74 dialog.close();
+6 -4
src/js/scrollLock.js
··· 39 39 } 40 40 } 41 41 42 - function unlockScroll(container) { 42 + function unlockScroll(container, { restoreScroll = true } = {}) { 43 43 const header = getHeaderElement(container); 44 44 let headerHeight = 0; 45 45 if (header) { ··· 65 65 body.style.top = ""; 66 66 body.style.width = ""; 67 67 body.style.height = ""; 68 - window.scrollTo(0, scrollTo); 68 + if (restoreScroll) { 69 + window.scrollTo(0, scrollTo); 70 + } 69 71 } 70 72 71 73 function findScrollableAncestor(element) { ··· 127 129 this.locked = true; 128 130 } 129 131 130 - unlock() { 132 + unlock({ restoreScroll = true } = {}) { 131 133 if (!this.locked) { 132 134 return; 133 135 } ··· 140 142 (holder) => holder !== this, 141 143 ); 142 144 if (__scrollLockHolders.length === 0) { 143 - unlockScroll(__lockedContainer); 145 + unlockScroll(__lockedContainer, { restoreScroll }); 144 146 __lockedContainer = null; 145 147 } 146 148 this.locked = false;
+5 -6
src/js/templates/sidebar.template.js
··· 61 61 })} 62 62 data-testid="sidebar-nav-${item.id}" 63 63 @click=${function (e) { 64 - // Handle active item click 65 - if (activeNavItem === item.id) { 64 + const isActive = activeNavItem === item.id; 65 + if (isActive) { 66 66 e.preventDefault(); 67 67 e.stopPropagation(); 68 68 onClickActiveItem?.(item.id); 69 69 } 70 - // Close sidebar 71 70 const sidebar = this.closest("animated-sidebar"); 72 - sidebar.close(); 71 + sidebar.close({ restoreScroll: isActive }); 73 72 }} 74 73 > 75 74 <span class="sidebar-nav-icon" ··· 264 263 @click=${(e) => { 265 264 if (currentUser) { 266 265 const sidebar = e.target.closest("animated-sidebar"); 267 - sidebar.close(); 266 + sidebar.close({ restoreScroll: false }); 268 267 } 269 268 }} 270 269 > ··· 281 280 @click=${(e) => { 282 281 if (currentUser) { 283 282 const sidebar = e.target.closest("animated-sidebar"); 284 - sidebar.close(); 283 + sidebar.close({ restoreScroll: false }); 285 284 } 286 285 }} 287 286 >