Reuse the install button on variant change to stop the flicker#23
Conversation
renderInstall() rewrote installSlot.innerHTML on every variant/channel change. On the WebSerial path that destroyed and recreated the esp-web-install-button custom element each time, re-running its shadow-DOM init and flashing the "Connect & Install" button. esp-web-tools only reads the manifest on click, not on render, so the only thing that needs to change between variants is the button's manifest attribute. The hasSerial branch now reuses the existing button when present and just updates its manifest attribute in place, building the markup only on first render. The no-serial fallback branch is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes a flicker where clicking a firmware variant briefly flashed the "Connect & Install" button.
Root cause: renderInstall() rewrote the whole install section's innerHTML on every variant/channel change, which destroyed and recreated the esp-web-install-button web component each time, re-running its shadow-DOM setup and painting as a visible flash. Confirmed by instrumenting the live page: after a variant click the button was a brand-new element and the DOM showed it being removed and re-added.
esp-web-tools reads the manifest only when the Install button is clicked, so the only thing that actually changes between variants on the WebSerial path is the button's manifest attribute. The fix reuses the existing button and updates that attribute in place, building the markup only on first render. The no-USB fallback branch is unchanged (its content genuinely differs per variant and has no web component to flicker).
Verified: with the fix, a variant click reuses the same button element and produces zero DOM mutations in the install slot (versus a full remove/re-add before). New Playwright test proves the button is reused rather than recreated; full suite 24/24, validators green.
🤖 Generated with Claude Code