Skip to content

Events drawer toolbar and scroll bugfix

This record captures a small simulator follow-up that simplified the Events panel and fixed the drawer scroll container behavior.

Symptom

The Events drawer exposed controls that were not useful in the current simulator workflow. It also showed a subtle visual overflow when the event list became long. The last event card could appear to extend slightly past the visible drawer boundary.

Reproducible steps

  1. Open the simulator page.
  2. Open the Events drawer from the map preview.
  3. Trigger enough SDK callbacks to populate a longer list.
  4. Scroll to the bottom of the drawer.
  5. Observe that the final event item appears to sit slightly outside the container edge.

Root cause

The drawer mixed fixed-height assumptions with a scrollable list that used a calc()-based max-height. That layout became fragile once the drawer header and content height varied. The panel also retained extra toolbar actions that no longer matched the intended minimal UX.

Patch summary

  • Removed the unused Events actions and kept only Close and Clear.
  • Simplified useSimulatorEvents() to remove filter, pause, and copy state.
  • Converted the Events drawer to a column flex layout.
  • Let the event list consume remaining space with flex: 1 and min-height: 0.
  • Added inner scroll padding to avoid the final item visually touching the container boundary.

Risk assessment

This change is localized to the simulator Events UI and its local state store. It does not change SDK callback wiring or event payload recording.

Regression checklist

  • Confirm the Events drawer still opens and closes from the preview panel.
  • Confirm Clear removes all recorded entries.
  • Confirm event recording still works for onClickRoom and onClickRoomProperties.
  • Confirm long event lists scroll entirely within the drawer.

最后更新于: