webxr client: add clear button to Server IP field#685
Conversation
The Server IP field prefills from the last connected server with no way to clear it, which suppressed the browser's autocomplete dropdown of previously used servers. Add an inline circular 'x' button that appears when the field has a value; clicking it clears the value (including the persisted localStorage entry) and refocuses the field so the dropdown can show again.
📝 WalkthroughWalkthroughThis PR adds a dedicated "clear" button for the server IP input field in the CloudXR 2D UI. The button appears inline next to the input, displaying a × symbol with accessibility labels. The TypeScript class now declares a DOM reference, initializes it during element setup, and wires event listeners to conditionally show the button based on input value and clear the input while triggering configuration updates and persistence on click. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
📝 Docs preview is not auto-deployed for fork PRs. A maintainer with write access to |
yanziz-nvidia
left a comment
There was a problem hiding this comment.
Reviewed by yanziz-reviewer-bot
Summary
Adds a circular "×" clear button to the Server IP input so users can wipe a localStorage-prefilled value and restore browser autocomplete. No CI state visible from the diff; no dep changes.
Legend: 🚫 Blocker · 💡 Suggestion · 🔍 Nit
| Finding | |
|---|---|
| 🚫 | deps/cloudxr/webxr_client/src/CloudXR2DUI.tsx:557 — The click handler dispatches a synthetic input then a change, causing updateConfiguration() to fire twice per clear. Both 'input' and 'change' have updateConfig registered; the synthetic dispatch hits both. Fix: call updateServerIpClearButton() and updateConfig() directly, then dispatch only 'change' (for localStorage persistence). |
| 💡 | deps/cloudxr/webxr_client/src/index.html:662 — Button has aria-label="Clear server IP" but some screen readers will also read the bare × text. Wrap glyph: <span aria-hidden="true">×</span>. |
| 🔍 | DCO sign-off checkbox in the PR description is unchecked. |
Actionables (for bots — copy-paste-ready for AI)
Fix if it makes sense in context — these are agent-generated suggestions, not human-vetted obligations. Skip anything that's wrong, already addressed, or not worth the churn.
CloudXR2DUI.tsx:557–563— Replace the twodispatchEventcalls in theserverIpClearButtonclick handler with direct calls toupdateServerIpClearButton()andupdateConfig(), keeping onlydispatchEvent(new Event('change', { bubbles: true }))for localStorage persistence.index.html:662— Wrap×in<span aria-hidden="true">×</span>insideserverIpClearButton.
The Server IP field prefills from the last connected server with no way to clear it, which suppressed the browser's autocomplete dropdown of previously used servers. Add an inline circular 'x' button that appears when the field has a value; clicking it clears the value (including the persisted localStorage entry) and refocuses the field so the dropdown can show again.
Description
Fixes #(issue)
Type of change
Testing
Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCOSummary by CodeRabbit