Skip to content

Conversation

@dejan-lukic
Copy link
Contributor

Listen for the turbo:load (see hotwired/turbo) event and re-render qlty UI elements. This removes the expensive MutationObserver & fixes forward/back navigation (see demo)

Rendering issue demo

Before:

qlty-forward-back-navigation-before.mp4

After:

qlty-forward-back-navigation-after.mp4

Copilot AI review requested due to automatic review settings July 10, 2025 01:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a listener for Hotwired Turbo’s turbo:load event to re-inject Qlty UI elements on page navigation, replacing the existing MutationObserver.

  • Introduce addPageLoadListener helper in src/github/events.ts
  • Replace MutationObserver in tryInjectDiffUI with Turbo load listener
  • Use void to swallow returned promise and remove the UI-injection guard

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/github/events.ts New helper to listen for turbo:load and invoke a callback
src/github-injector.ts Swap out the MutationObserver for the Turbo listener, update async calls, remove old dedup guard
Comments suppressed due to low confidence (1)

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