Skip to content

Click-to-copy: load deferred regardless of site configuration - #2801

Open
chalin wants to merge 5 commits into
docsydev:mainfrom
chalin:chalin-m24-plugin-copy-readiness-2026-0909
Open

Click-to-copy: load deferred regardless of site configuration#2801
chalin wants to merge 5 commits into
docsydev:mainfrom
chalin:chalin-m24-plugin-copy-readiness-2026-0909

Conversation

@chalin

@chalin chalin commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator
  • Scope: click-to-copy always loads deferred, so it scans the fully parsed page with Bootstrap present
    • no defer a site, language, or environment override sets on its entry can make it synchronous
    • the choice lives in the plugin's shim, which the loop already calls, not in the theme's overridable config default
    • enable/disable, the legacy opt-out, Prism suppression, and every other plugin keep their behavior
  • Out of scope:
    • the generic defer field and default, other plugins' loading strategy, and the invalid-value policy (separate discussion)
    • a warning when a site sets defer on this entry (tracked; the value is accepted and ignored)
    • runtime-inserted code blocks (not a supported case)
  • Tests: built red-first on main, where each config layer turned the tag synchronous and the body-end hook block got no button; a fixture case per layer, and a browser net asserting on the clipboard text
  • Docs: Plugins owns the promise and its limit; the shim contract and quality page follow

@chalin chalin added this to the 0.18.0 milestone Sep 9, 2026
- Moves the plugin's `defer` from the theme's overridable default into its shim, so no configuration layer can run the one-shot scan before the document is parsed
- Fixture net covers site, language, and env `defer: false`, with a sibling override guarding the env key path
- Browser net copies from a block emitted by the body-end hook under a conflicting `defer: false`: the case a synchronous load misses
- Retargets the layering tests that used click-to-copy's `defer` as their inheritance and override probe
- Plugins guide owns the promise and its limit: the whole server-rendered page, hook markup included, not markup scripts add later
- Shim contract names the second shim role the plugin now relies on
- Quality page registers the copy net and its red-first evidence
- UG states the override outright, so a reader can't take "whatever its entry carries" as "honors your value"; the shim-contract page qualifies the pin as against configuration
- Site and language fixture cases gain the env case's sibling override, proving their layer reached the registry
- Comments keep only local gotchas and pointers; the runtime net's copied-text claim states the actual equality
- Each layer's fixture sets `version: latest` on the click-to-copy entry and asserts the floating-version warning: with a sibling entry as the guard, dropping the click-to-copy input left every case green, the default already being deferred
- Shim header and shim-contract page read as complete sentences
@chalin
chalin force-pushed the chalin-m24-plugin-copy-readiness-2026-0909 branch from 8747b8f to 92491cd Compare September 10, 2026 10:39
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