Skip to content

[feat] Right-click string utilities on selected text (encode/decode/stringify/destringify) #84

@mertbekci

Description

@mertbekci

Split out from #81.

Background

The CellContextMenu component already exists on URL bar / param / header inputs (right-click → copy / paste / clear). Extend it with text-transform utilities that act on the current selection when one is present, otherwise on the full cell value.

Proposed change

Add a Transform selection submenu (or four top-level items, TBD by feel during implementation):

  • URL-encodeencodeURIComponent semantics
  • URL-decodedecodeURIComponent with try/catch (malformed URLs leave selection untouched and toast an error)
  • Base64 encode — UTF-8 safe, no padding mangling
  • Base64 decode — symmetric inverse
  • Stringify — escape for embedding in a JSON string literal: "foo"\\\"foo\\\"
  • Destringify — symmetric inverse: \\\"foo\\\""foo"

Where it should be available

  • URL bar
  • Param key + value cells
  • Header key + value cells
  • Body editor (raw / json / xml / html / javascript modes — CodeMirror selection)
  • Form-urlencoded fields
  • Multipart text parts

GraphQL editor follows the same CodeMirror-selection rules.

Acceptance criteria

  • Transforms apply to the current selection (or whole field if no selection).
  • Each transform is reversible: encoding then decoding the same string returns the original.
  • Decode-of-malformed input shows an error toast, leaves the field untouched.
  • Available in URL bar, param/header cells, and the body CodeMirror editor.
  • Unit tests for each pair (round-trip + malformed input).
  • Keyboard shortcuts not assigned (avoid clashing); discoverable via right-click only.

Out of scope

  • User-defined transforms (plugin system). See #C-issue for the parking lot.
  • Format converters (JSON ↔ YAML, XML ↔ JSON). Track separately if requested.

Parent: #81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions