Repository navigation
Show visited markers and tinting earlier (6.10.2) - #21
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19630f8903
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const root = document.body || document.documentElement; | ||
| if (!root) return; |
There was a problem hiding this comment.
Retry observation when the root does not exist
Because this userscript runs at document-start, a manager with synchronous GM storage APIs can finish both startup reads before the parser has created either <html> or <body>. In that case this expression yields null, the function returns without installing an observer, and nothing invokes it again until onReady() after DOMContentLoaded; consequently the new early tile painting does not work in that environment. Observe document itself or arrange to retry as soon as the root element appears.
Useful? React with 👍 / 👎.
Visible tiles previously remained unmarked until sync configuration, history, recovery journals, legacy migration, and DOMContentLoaded had all finished. Paint the local working copy immediately and observe newly inserted tiles during page loading. Read independent storage values concurrently, then reconcile journal state and refresh tiles before enabling controls or writing history.
Add regression tests that hold sync configuration or journal storage pending and verify early painting, no premature writes, and recovered settings/history. Also cover existing and inserted tiles before DOMContentLoaded.
Validation: syntax and whitespace checks; all 84 tests pass. In a local harness with 200 ms storage calls, first tile processing fell from 854 ms to 223 ms (simulated timing, not a live-device measurement).
Bump userscript and worker versions to 6.10.2 and add the changelog section for automatic release publication. Worker behavior is unchanged.