()
| 942 | onHistoryUp(); |
| 943 | } |
| 944 | function handleHistoryDown() { |
| 945 | if (suggestions.length > 1) { |
| 946 | return; |
| 947 | } |
| 948 | |
| 949 | // Only navigate history/footer when cursor is on the last line. |
| 950 | // In multiline inputs, down arrow should move the cursor (handled by TextInput) |
| 951 | // and only trigger navigation when at the bottom of the input. |
| 952 | if (!isCursorOnLastLine) { |
| 953 | return; |
| 954 | } |
| 955 | |
| 956 | // At bottom of history → enter footer at first visible pill |
| 957 | if (onHistoryDown() && footerItems.length > 0) { |
| 958 | const first = footerItems[0]!; |
| 959 | selectFooterItem(first); |
| 960 | if (first === 'tasks' && !getGlobalConfig().hasSeenTasksHint) { |
| 961 | saveGlobalConfig(c => c.hasSeenTasksHint ? c : { |
| 962 | ...c, |
| 963 | hasSeenTasksHint: true |
| 964 | }); |
| 965 | } |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | // Create a suggestions state directly - we'll sync it with useTypeahead later |
| 970 | const [suggestionsState, setSuggestionsStateRaw] = useState<{ |
nothing calls this directly
no test coverage detected