tnc-ca-geo / animl-frontend

A frontend web app for viewing & labeling camera trap data by The Nature Conservancy.
https://animl.camera
Other
16 stars 0 forks source link

Rethink `isAddingLabel` in state #157

Open nathanielrindlaub opened 1 year ago

nathanielrindlaub commented 1 year ago

I think we only really use this to block keydown listeners in other components while users are typing in the new label input field. We also have other keyboard input needs not related to adding labels (e.g. filling out forms, typing out custom filters) so this should probably be called something else and structured differently.

Maybe we call it keyboardFocus and pass it string values like new-label-input/form-input etc., which would allow us to listen for general review and increment/decrement image hotkeys while reviewing images (i.e. keyboardFocus: null), but maintain the ability to granularly control keydown listeners when other inputs are focused.