[PR #7480] fix(ui): add timeout cleanup in TextField copy handler #12414

Closed
opened 2026-02-16 18:17:19 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7480

State: closed
Merged: No


Summary

  • Fix potential memory leak in TextField copy button
  • Use reactive effect pattern for timeout management
  • Auto-cleanup on rapid clicks and component unmount

Changes

The copy feedback timeout (2s "Copied" indicator) now uses createEffect with onCleanup instead of a bare setTimeout. This ensures:

  • Previous timeout is cleared on rapid clicks
  • Timeout is cleared on component unmount
  • No state updates on unmounted components
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7480 **State:** closed **Merged:** No --- ## Summary - Fix potential memory leak in TextField copy button - Use reactive effect pattern for timeout management - Auto-cleanup on rapid clicks and component unmount ## Changes The copy feedback timeout (2s "Copied" indicator) now uses `createEffect` with `onCleanup` instead of a bare `setTimeout`. This ensures: - Previous timeout is cleared on rapid clicks - Timeout is cleared on component unmount - No state updates on unmounted components
yindo added the pull-request label 2026-02-16 18:17:19 -05:00
yindo closed this issue 2026-02-16 18:17:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12414