fix(dashboard): allowlist input erased by polling refresh #111

Merged
razvandimescu merged 1 commits from fix/allowlist-input-focus into main 2026-04-16 20:27:02 +08:00
razvandimescu commented 2026-04-16 20:12:44 +08:00 (Migrated from github.com)

Summary

Fixes #106.

  • The allowlist panel's renderAllowlist() replaced the entire section's innerHTML every 2 seconds (polling loop), including the <form> and <input>. If the user was mid-typing when the refresh fired, their text vanished — reported as "it would 'time out' and erase the entered text."
  • Fix: skip the re-render when allowDomainInput has focus. The list updates on the next refresh after the user submits or clicks away.
  • Note for the reporter: numa.toml already supports config-based allowlists under [blocking]: allowlist = ["tailscale.com"]. This pre-loads entries at startup without needing the dashboard.

Test plan

  • make all — fmt + clippy + audit + 285 tests pass
  • Open dashboard, start typing in allowlist input, wait >2s — text should persist
  • Submit a domain via the input — allowlist updates on next refresh cycle
  • Verify the existing polling refresh still updates the allowlist when the input is not focused
## Summary Fixes #106. - The allowlist panel's `renderAllowlist()` replaced the entire section's `innerHTML` every 2 seconds (polling loop), including the `<form>` and `<input>`. If the user was mid-typing when the refresh fired, their text vanished — reported as "it would 'time out' and erase the entered text." - Fix: skip the re-render when `allowDomainInput` has focus. The list updates on the next refresh after the user submits or clicks away. - Note for the reporter: `numa.toml` already supports config-based allowlists under `[blocking]`: `allowlist = ["tailscale.com"]`. This pre-loads entries at startup without needing the dashboard. ## Test plan - [x] `make all` — fmt + clippy + audit + 285 tests pass - [x] Open dashboard, start typing in allowlist input, wait >2s — text should persist - [x] Submit a domain via the input — allowlist updates on next refresh cycle - [x] Verify the existing polling refresh still updates the allowlist when the input is not focused
Sign in to join this conversation.