WAP LabsProject atlas

docs/waves/form_handling_local_mode_testing.md

Form Handling Local Mode Testing

Status: active reference Owner lane: engine-wasm + browser Last reviewed: 2026-03-15

Purpose

Provide a manual test reference for the current form-handling baseline in Waves, with emphasis on local mode behavior.

This document is intended for quick regression checks now that A5-04, A5-05, and the active A5-06 hardening slice are landed for the current MVP lane.

Current Scope

Covered by the current implementation:

  1. text input focus/edit/commit/cancel
  2. password input masking in the viewport
  3. single-select select/option focus/edit/cycle/commit/cancel
  4. local-mode capture of external submit intents without network fetch

Still not covered in this local-mode reference:

  1. multi-select behavior
  2. broader submit hardening beyond the active MVP path and smoke-covered browser/host cases
  3. advanced mask validation semantics
  4. local-mode replay of captured form submits

Local Mode Behavior Summary

In Local mode:

  1. the deck is loaded directly into the engine
  2. text and select controls remain fully interactive
  3. engine-owned field state updates and render output should work exactly like network mode
  4. if a form submit or link produces an external navigation intent, Waves does not fetch it
  5. instead, Waves captures the external intent and shows a local-mode status message

Current expected local submit posture:

  1. form editing works
  2. submit intent is generated by the engine
  3. Waves surfaces the captured external intent
  4. no network request is issued in local mode

This is effectively a stubbed local-only submit path today.

Use this WML through Load Raw WML in the developer tools drawer while run mode is set to Local.

<wml>
  <card id="home">
    <p>User: <input name="username" value="AHMED" type="text"/></p>
    <p>PIN: <input name="pin" value="" type="password"/></p>
    <p>
      Country:
      <select name="Country" title="Country">
        <option value="Jordan">Jordan</option>
        <option value="France">France</option>
        <option value="Germany">Germany</option>
      </select>
    </p>
    <do type="accept">
      <go method="post" href="/login">
        <postfield name="username" value="$(username)"/>
        <postfield name="pin" value="$(pin)"/>
        <postfield name="Country" value="$(Country)"/>
      </go>
    </do>
  </card>
</wml>

Test Cases

1. Text input edit commit

Steps:

  1. Switch Waves to Local mode.
  2. Load the fixture deck.
  3. Focus username.
  4. Press Enter to begin edit.
  5. Type BOB.
  6. Press Enter to commit.

Expected:

  1. the viewport shows [username: BOB]
  2. focus remains deterministic
  3. no fetch occurs

2. Text input cancel

Steps:

  1. Focus username.
  2. Press Enter.
  3. Type one or more characters.
  4. Press Escape.

Expected:

  1. the viewport reverts to the original committed value
  2. no partial draft remains visible
  3. no fetch occurs

3. Password masking

Steps:

  1. Focus pin.
  2. Press Enter.
  3. Type 1234.
  4. Press Enter to commit.

Expected:

  1. the viewport renders masked characters, not the raw PIN
  2. focus returns to normal non-edit mode after commit
  3. no fetch occurs

4. Select default render

Steps:

  1. Load the fixture deck in Local mode.
  2. Observe the Country control before any interaction.

Expected:

  1. the select renders as a focusable control
  2. the first option is shown by default unless the markup explicitly selects another option
  3. no fetch occurs

5. Select cycle and commit

Steps:

  1. Focus Country.
  2. Press Enter to begin select edit.
  3. Press ArrowDown once or more.
  4. Press Enter to commit.

Expected:

  1. the rendered select value changes while editing
  2. the committed value remains visible after edit mode ends
  3. cycling wraps deterministically through the available options
  4. no fetch occurs

6. Select cancel

Steps:

  1. Focus Country.
  2. Press Enter to begin select edit.
  3. Press ArrowDown to change the draft selection.
  4. Press Escape.

Expected:

  1. the rendered value returns to the original committed option
  2. no partial draft select state remains active
  3. no fetch occurs

7. Local-mode form submit capture

Steps:

  1. Edit username, pin, and Country.
  2. Ensure no control is in edit mode.
  3. Press Enter on the card accept action path to submit.

Expected:

  1. the engine emits an external navigation intent for /login
  2. Waves does not perform a fetch because run mode is Local
  3. status text reports that local mode captured the external intent
  4. this is expected current behavior, not a failure

What To Inspect During Testing

Useful places to look during manual verification:

  1. viewport render output
  2. runtime snapshot panel
  3. event timeline panel
  4. status line after local-mode submit capture

For local submit capture, the most important signals are:

  1. edited values remain visible in the viewport before submit
  2. no network load starts
  3. the captured external intent is surfaced to the operator

Expected Limitations Right Now

These are not regressions for the current baseline:

  1. local mode does not complete the remote submit roundtrip
  2. local mode only proves engine-owned edit state and intent generation
  3. submit payload hardening beyond the active MVP path remains future follow-on work, but the current browser/host/native lane is already covered by the landed A5-06 slice
  • browser/frontend/src/app/browser-controller.ts
  • browser/frontend/src/app/waves-copy.ts
  • engine-wasm/engine/src/engine_tests/navigation_metadata.rs
  • browser/src-tauri/src/tests/tauri_commands.rs