Deploy to prod#46
Merged
Merged
Conversation
Adds an inline DOMContentLoaded script to the head array that delegates click events on Starlight's .copy buttons and fires window.umami?.track with page, section (nearest preceding heading id, falls back to "intro"), and lang (stripped from the code element's language-* class).
Adds an inline DOMContentLoaded script to the head array that attaches
a debounced (400ms) input listener to Starlight's Pagefind search input.
Sanitizes query text (strips email-shaped strings and 0x wallet addresses),
resolves hasResults from the visible result list, and fires
window.umami?.track('docs-search', { query, hasResults }). No-ops when
the sanitized query is empty or Umami is absent.
Pagefind's query pipeline (fetch shards → WASM → render) can outlast the 400 ms input debounce, causing a synchronous read of the results container to report hasResults=false when results are still rendering. Replace the fixed-timer read with a MutationObserver on .pagefind-ui__results: the event fires once the result DOM settles (150 ms after the last mutation), so hasResults reflects the actual outcome. A 2 s safety timeout fires the event anyway if no mutations arrive (empty result set, Pagefind error). The observer is disconnected after firing so each query produces exactly one event.
Renames the "Explorer" action button to "Block Explorer" for clarity and adds a new "Entity Explorer" button linking to https://data.arkiv.network, placed directly after Block Explorer so both explorers sit together before "Add Network to Wallet".
Restructure into three task-focused sections (query editor, searching for entities/owners, sharing results) and drop UI-narration sections flagged in PR #45. Fix query syntax link to point at the JSON-RPC reference. Add a landing-screen screenshot below the intro.
# Conflicts: # astro.config.mjs
- code-copied: switch to button[data-code] selector; read lang from
pre[data-language] (Expressive Code puts it there, not a class on code);
add window.__copyAnalyticsBound guard for view-transition re-runs
- docs-search: drop MutationObserver machinery; use plain 600ms debounce;
match input via classList.contains('pagefind-ui__search-input') (type=text,
not type=search); add window.__searchAnalyticsBound guard
- sanitization: redact with labeled tokens ([email], [bearer], etc.) instead
of stripping; expand patterns to cover bearer tokens, JWTs, api keys, UUIDs,
unix/windows paths, IPv4, hex addresses, cc-like numbers; emit redacted bool
and redactionTypes string as extra event properties
Snippets provided and tested by SewerynKras; escaping adapted for JS
template literal context in astro.config.mjs.
docs: add Data Explorer page, Entity Explorer button, UTM tracking
feat(analytics): add code-copied and docs-search Umami events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.