<commit_before>import { AppState } from '@/ui_models/app_state';
import { observer } from 'mobx-react-lite';
import { useRef, useEffect } from 'preact/hooks';
import { Icon } from './Icon';

type Props = {
  appState: AppState;
  closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void;
};

export const AutocompleteTagHint = observer(
  ({ appState, closeOnBlur }: Props) => {
    const { autocompleteTagHintFocused } = appState.noteTags;

    const hintRef = useRef<HTMLButtonElement>();

    const { autocompleteSearchQuery, autocompleteTagResults } =
      appState.noteTags;

    const onTagHintClick = async () => {
      await appState.noteTags.createAndAddNewTag();
    };
<commit_msg>fix: focus autocomplete input after adding tag from hint<commit_after>import { AppState } from '@/ui_models/app_state';
import { observer } from 'mobx-react-lite';
import { useRef, useEffect } from 'preact/hooks';
import { Icon } from './Icon';

type Props = {
  appState: AppState;
  closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void;
};

export const AutocompleteTagHint = observer(
  ({ appState, closeOnBlur }: Props) => {
    const { autocompleteTagHintFocused } = appState.noteTags;

    const hintRef = useRef<HTMLButtonElement>();

    const { autocompleteSearchQuery, autocompleteTagResults } =
      appState.noteTags;

    const onTagHintClick = async () => {
      await appState.noteTags.createAndAddNewTag();
      appState.noteTags.setAutocompleteInputFocused(true);
    };

{'fraction_non_alphanumeric': 0.12301587301587301, 'fraction_numerical': 0.0, 'mean_word_length': 4.253472222222222, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5828496', 'n_tokens_mistral': 476, 'n_tokens_neox': 461, 'n_words': 107}