Skip to content

Session replay from pocket-kit v0.3.0, with typed text masked - #380

Merged
calebl merged 1 commit into
mainfrom
fm/ta-session-replay
Nov 5, 2026
Merged

calebl merged 1 commit into
mainfrom
fm/ta-session-replay

Conversation

@calebl

@calebl calebl commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Adds pocket-kit v0.3.0's opt-in session replay, following calebl/draft-web#110.

  • Gemfile: pocket-kit pinned to tag: "v0.3.0" (was commit d7c0fd7). No config changes were needed for the 0.1→0.3 jump; error reporting and feedback tests pass unchanged. Propshaft serves the vendored rrweb assets, so no manifest change (Draft's was Sprockets).
  • config/initializers/pocket_kit.rb: config.replay.enabled = true; show_typed_text left at its default false.
  • Layout: pocket_kit_replay_tag beside pocket_kit_errors_tag in app/views/layouts/application.html.erb, the only layout with the errors tag. The tag renders only when feedback or page errors can send, so with neither command set nothing is recorded.
  • Masking: pocket-kit passes maskAllInputs (inputs, textareas, selects, including the command line and the feedback note) and masks contenteditable. The page also echoes the typed line back as text (.command in the turn log, the refusal, the in-flight receipt, and the saved-turn notice), so those now carry rr-mask. Narration that restates the player's action is game prose and is recorded as shown.
  • Test: PocketKitErrorsTest checks the replay meta tag has data-show-typed-text=false, that an echoed typed line is rr-mask, and that there is no replay tag when no command is set.
  • README: describes the replay next to the error report section.

Known limits

  • Replays can be viewed only from this machine for now.
  • An error report sent as the page closes may be too large to arrive.

Checks: bin/rails test (5503 runs, 0 failures), rubocop, zeitwerk, brakeman all clean. No model calls were made.

Pins pocket-kit to the v0.3.0 tag, turns config.replay.enabled on, puts
pocket_kit_replay_tag beside the errors tag in the one layout that has it,
and marks every echo of a typed line rr-mask so it is not recorded in clear.
@calebl
calebl merged commit 7107dc1 into main Nov 5, 2026
4 checks passed
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