Skip to content

[BUG] Playground state (plaintext + cipher config) lost on page refresh — no URL persistence #258

Description

@anubhavy-05

Bug Description

When a user configures the Playground (selects a cipher, enters a plaintext, sets a key,
and sees the encrypted output), all state is completely lost on page refresh or when
sharing the URL
. The page always reloads to its default empty state with no cipher selected.
This makes it impossible to:

  • Share a specific cipher configuration with others via a URL link
  • Bookmark a session to resume later
  • Return to a previous encryption setup after accidental navigation

Steps to Reproduce

  1. Open the CryptoViz Playground in your browser
  2. Select any cipher (e.g., Caesar Cipher) from the cipher selector
  3. Enter a plaintext (e.g., Hello, World!) and a key (e.g., 3)
  4. Observe the encrypted output is correctly shown
  5. Press F5 (or Ctrl+R) to refresh the page — OR copy the URL and open it in a new tab

Expected Behavior

The URL should update with query parameters (or a hash) encoding the current cipher
selection, plaintext, and key — so that refreshing the page or sharing the URL

Actual Behavior

The URL never changes from the base /playground path. On refresh, the page resets
to a blank state — the selected cipher, plaintext, and key are all cleared.
There is no way to share or bookmark a specific encryption session.

Screenshots

No screenshot available — this is a stateless behavior bug reproducible in all browsers.

Environment

  • OS: Windows 11 / macOS 14 / Ubuntu 22.04 (reproduced on all)
  • Browser: Chrome 125, Firefox 127, Edge 125
  • Version: Latest (main branch as of 2026-07-19)

Additional Context

  • This is a usability and shareability gap — no existing issue addresses URL-based
    state persistence for the Playground.
  • Suggested implementation: use URLSearchParams to encode cipher, key, and
    plaintext into the URL on every state change (debounced), and read them back
    on component mount.
  • Sensitive keys should be opt-in for URL inclusion (with a warning), or excluded
    by default to avoid accidental credential leakage.
  • This would also benefit the proposed Compare Mode (see future issues) and
    complements #88 (Playground Layout & Responsiveness).

Metadata

Metadata

Assignees

Labels

ECSoC26Elite Coders Summer of Code 2026bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions