Skip to content

Reuse the install button on variant change to stop the flicker#23

Merged
bharvey88 merged 1 commit into
mainfrom
fix/install-button-flicker
Jul 20, 2026
Merged

Reuse the install button on variant change to stop the flicker#23
bharvey88 merged 1 commit into
mainfrom
fix/install-button-flicker

Conversation

@bharvey88

Copy link
Copy Markdown
Collaborator

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

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)
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bharvey88, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01c99322-93c5-4511-ade0-386002df07d1

📥 Commits

Reviewing files that changed from the base of the PR and between 4d530a3 and 3a72009.

📒 Files selected for processing (2)
  • js/views/device.js
  • tests/installer.spec.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/install-button-flicker

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bharvey88
bharvey88 merged commit 95e8b29 into main Jul 20, 2026
3 checks passed
@bharvey88
bharvey88 deleted the fix/install-button-flicker branch July 20, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant