Skip to content

Feature: shareable demo link for the compare section (?demo=compare), matching the existing single-file ?demo #742

Description

@yakew7

Where: assets/profiler-ui.js, assets/profiler-compare.js (compareSampleBtn handler).

Current gap: profiler.html?demo auto-loads the single-file sample dataset via if (/(?:\?|&)demo\b/.test(window.location.search)) { runText(buildSampleCSV(), ...); } - a genuinely useful feature for linking someone straight to a working example. The compare section's own "Try with sample drift data" button (compareSampleBtn) has no equivalent: grep -n "demo\|location.search\|URLSearchParams" assets/profiler-compare.js returns nothing related to a shareable link - there is no ?demo=compare (or similar) URL parameter that auto-populates both sample files A/B and runs the comparison.

Repro:

$ grep -n "location.search" assets/profiler-ui.js assets/profiler-compare.js
assets/profiler-ui.js:...: /(?:\?|&)demo\b/.test(window.location.search)
assets/profiler-compare.js: (no matches)

Suggested approach: extend the existing query-string check to recognize a second value (e.g. ?demo=compare) that calls compare's existing sample-loading function programmatically (whatever compareSampleBtn's click handler calls), so both halves of the tool are equally linkable/embeddable in explainers or social posts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions