fix: comment sheet position and pull-to-refresh timing

- Position comment sheet above bottom nav
- Find scroll container lazily on first touch instead of connectedCallback
- Simplify scroll container detection to just check overflow-y

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Changed files
+14 -11
src
components
+13 -10
src/components/molecules/grain-pull-to-refresh.js
··· 52 52 53 53 connectedCallback() { 54 54 super.connectedCallback(); 55 - this.#scrollContainer = this.#findScrollContainer(); 56 55 this.addEventListener('touchstart', this.#onTouchStart, { passive: true }); 57 56 this.addEventListener('touchmove', this.#onTouchMove, { passive: false }); 58 57 this.addEventListener('touchend', this.#onTouchEnd, { passive: true }); 59 58 } 60 59 61 60 #findScrollContainer() { 62 - let el = this.parentElement; 61 + let el = this; 63 62 while (el) { 64 - // Check through shadow DOM boundaries 65 - if (el.scrollHeight > el.clientHeight) { 66 - const style = getComputedStyle(el); 67 - if (style.overflowY === 'auto' || style.overflowY === 'scroll') { 68 - return el; 69 - } 63 + // Get next parent, crossing shadow DOM boundaries 64 + const parent = el.parentElement || el.getRootNode()?.host; 65 + if (!parent || parent === document.documentElement) break; 66 + 67 + const style = getComputedStyle(parent); 68 + if (style.overflowY === 'auto' || style.overflowY === 'scroll') { 69 + return parent; 70 70 } 71 - // Traverse up through shadow roots 72 - el = el.parentElement || el.getRootNode()?.host; 71 + el = parent; 73 72 } 74 73 return null; 75 74 } 76 75 77 76 #getScrollTop() { 77 + // Find scroll container lazily (content may not be loaded at connectedCallback) 78 + if (!this.#scrollContainer) { 79 + this.#scrollContainer = this.#findScrollContainer(); 80 + } 78 81 if (this.#scrollContainer) { 79 82 return this.#scrollContainer.scrollTop; 80 83 }
+1 -1
src/components/organisms/grain-comment-sheet.js
··· 42 42 } 43 43 .sheet-container { 44 44 position: fixed; 45 - bottom: 0; 45 + bottom: calc(48px + env(safe-area-inset-bottom, 0px)); 46 46 left: 0; 47 47 right: 0; 48 48 display: flex;