Skip to content

[BUG] AI-instruction-tip (lightbulb) input glitches in Settings → Labels #829

Closed

Description

@jj-valentine

Description

In Settings → Labels, each label has a lightbulb button ("Add AI instruction tip"). Pressing it makes the tip input box glitch out. Easily and consistently reproducible.

Reproduce...

  1. Open Settings → Labels.
  2. Click the lightbulb ("Add AI instruction tip") on a label row.
  3. The tip input glitches (misbehaves on open / focus / value).

Likely cause (from a quick code read)

In packages/ui/components/Settings.tsx (~lines 1474–1598), the labels list:

  • Uses key={index} for mapped rows (React anti-pattern — inputs can attach to the wrong row when the list changes mid-edit).
  • Conditionally remounts the tip input on toggle ({isEditingTip && (...)}) with an autoFocus that can race the state update.
  • Fires two unbatched state updates on click (setEditingTipIndex then setEditingTipValue).

Switching to stable keys (label id) and avoiding the remount/focus race likely resolves it.

Activity

  1. added a commit that references this issue on May 31, 2026
    2a8eb9d
  2. added a commit that references this issue on Jun 3, 2026
    2c47bd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions