Fix focus issues, clarify documentation #10

Merged
Xeplosion merged 2 commits from dev into main 2026-08-27 06:09:34 +00:00
Owner

What changed and why

Two unrelated fixes, bundled together since both are small:

Focus loss while typing (capture-form) — every text/number/textarea
field's input event triggered a full render(), which does
root.innerHTML = "" and rebuilds the whole DOM tree. That destroyed the
focused input on every single keystroke, making sustained typing in any
field unusable. Fixed by having render() record the focused element's
position (child-index path from #app) and cursor selection before the
rebuild, then restoring focus to the equivalent element afterward — the
rebuild itself is unchanged, so the dirty indicator, step-completion
badges, and promote-button validity still update live on every keystroke
as before.

Compliance field wording — complies_with_guidelines and its
description/label were worded as generic "scraping guidelines" compliance.
It's actually specifically about compliance with Trustpilot's Terms of
Service (this is the reviews section — trustpilot_url, review_count,
scrapes are all Trustpilot-scoped). Updated the schema description,
compliance_notes description, the capture-form UI label, and both docs
to say so explicitly. The JSON key itself, the sheet column name, and the
115 existing provider files' field names are deliberately unchanged —
this is wording-only, to avoid a coordinated rename across the sheet,
bootstrap.py, and every provider file.

Closes #
Closes #

How to test

  1. Open the capture-form, sign in, open any provider.
  2. Type a full sentence into any text field (e.g. "Provider notes") without
    pausing — confirm focus and cursor stay in the field the whole time and
    no characters get lost or reordered.
  3. Try it on a nested field too (e.g. a product line's "Line notes") to
    confirm it's not just top-level fields that work.
  4. Confirm the "● unsaved" dirty indicator and the step sidebar's
    completion badges still update live as you type (i.e. this didn't
    silently stop re-rendering, it just stopped losing focus).
  5. Open the Reviews step and confirm the compliance field now reads
    "Complies with Trustpilot's Terms of Service?"
  6. pytest — all existing tests should still pass unmodified (no field
    names or schema validity rules changed, wording/behavior only).

Checklist

  • Tests added or updated
  • Docs updated if behaviour changed
  • No unrelated changes included
  • PR is focused on one thing

Release notes

Fix a bug where typing in any capture-form field lost focus on every keystroke; clarify that the compliance field refers to Trustpilot's ToS specifically.

## What changed and why Two unrelated fixes, bundled together since both are small: **Focus loss while typing (capture-form)** — every text/number/textarea field's `input` event triggered a full `render()`, which does `root.innerHTML = ""` and rebuilds the whole DOM tree. That destroyed the focused input on every single keystroke, making sustained typing in any field unusable. Fixed by having `render()` record the focused element's position (child-index path from `#app`) and cursor selection before the rebuild, then restoring focus to the equivalent element afterward — the rebuild itself is unchanged, so the dirty indicator, step-completion badges, and promote-button validity still update live on every keystroke as before. **Compliance field wording** — `complies_with_guidelines` and its description/label were worded as generic "scraping guidelines" compliance. It's actually specifically about compliance with Trustpilot's Terms of Service (this is the `reviews` section — `trustpilot_url`, `review_count`, `scrapes` are all Trustpilot-scoped). Updated the schema description, `compliance_notes` description, the capture-form UI label, and both docs to say so explicitly. The JSON key itself, the sheet column name, and the 115 existing provider files' field names are deliberately unchanged — this is wording-only, to avoid a coordinated rename across the sheet, `bootstrap.py`, and every provider file. ## Related issues Closes # Closes # ## How to test 1. Open the capture-form, sign in, open any provider. 2. Type a full sentence into any text field (e.g. "Provider notes") without pausing — confirm focus and cursor stay in the field the whole time and no characters get lost or reordered. 3. Try it on a nested field too (e.g. a product line's "Line notes") to confirm it's not just top-level fields that work. 4. Confirm the "● unsaved" dirty indicator and the step sidebar's completion badges still update live as you type (i.e. this didn't silently stop re-rendering, it just stopped losing focus). 5. Open the Reviews step and confirm the compliance field now reads "Complies with Trustpilot's Terms of Service?" 6. `pytest` — all existing tests should still pass unmodified (no field names or schema validity rules changed, wording/behavior only). ## Checklist - [ ] Tests added or updated - [x] Docs updated if behaviour changed - [ ] No unrelated changes included - [x] PR is focused on one thing ## Release notes Fix a bug where typing in any capture-form field lost focus on every keystroke; clarify that the compliance field refers to Trustpilot's ToS specifically.
fix: clarify complies_with_guidelines refers specifically to Trustpilot's ToS.
All checks were successful
CI / format (push) Successful in 7s
CI / test (push) Successful in 7s
Validate capture files / validate (push) Successful in 7s
CI / format (pull_request) Successful in 7s
CI / test (pull_request) Successful in 8s
Validate capture files / validate (pull_request) Successful in 7s
ffa5f4668a
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
XeplosionGames/minecraft-provider-analysis!10
No description provided.