Skill: Callback and Event Roundtrip
When to Use
Use this skill when changing event callbacks or pane interactivity.
Core Workflow
- Register callback handlers via
register_event_handler()on the Python side. - Ensure frontend emits correct event payloads (
event_type,target, and event-specific fields). - Route browser events through socket command forwarding (
forward_to_vis). - Keep server forwarding logic from browser socket to Python source sockets intact.
- Validate event names/fields against existing callback contracts.
Guardrails
- Callback handlers run in a background socket thread; avoid unsafe shared state writes.
- Do not rename event keys without coordinated client/server/docs updates.
- Preserve existing event types (
Click,KeyPress,PropertyUpdate,Close, etc.).
Documentation
- Skill reference
py/visdom/__init__.pypy/visdom/server/handlers/socket_handlers.pyjs/api/ApiProvider.jsjs/EventSystem.jsAGENTS.mdCONTRIBUTING.md
Assets
- See
assets/README.mdand store templates/resources inassets/.
Tests
- Follow the default flow in
references/TESTS.md.