pyr0ball opened issue Circuit-Forge/avocet#2

pyr0ball
Wed, 04 Mar 2026 09:29:56 -0800

2#[Bug] useLabelKeyboard wired but labels array is empty — hotkeys do not trigger labels#

Problem

useLabelKeyboard is called in LabelView.vue but receives an empty labels: [] array:

useLabelKeyboard({
  labels: [],   // ← never populated
  onLabel: ...
})

The composable maps number keys 1-9 to label names by index. With an empty array, pressing 1-9 does nothing.

Fix

Pass labels.value (the fetched labels list) instead of a hardcoded empty array:

useLabelKeyboard({
  labels: labels.value,
  onLabel: (name) => handleLabel(name),
  onSkip: () => handleSkip(),
  onDiscard: () => handleDiscard(),
  onUndo: () => handleUndo(),
  onHelp: () => { /* TODO */ },
})

Note: labels is a ref<string[]> fetched from GET /api/config/labels on mount. The composable call needs to either watch the ref or be called after fetch completes.

Acceptance Criteria

Pressing 1-9 maps to the corresponding label in the fetched list

h skips, S → skip, D → discard, U → undo all work as documented