mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-02 07:54:48 -07:00
refactor: migrate to useKeyMatchers hook (#21753)
This commit is contained in:
committed by
GitHub
parent
e406dcc249
commit
ab64b15d51
@@ -6,7 +6,8 @@
|
||||
|
||||
import { useReducer, useCallback, useEffect, useRef } from 'react';
|
||||
import { useKeypress, type Key } from './useKeypress.js';
|
||||
import { keyMatchers, Command } from '../keyMatchers.js';
|
||||
import { Command } from '../keyMatchers.js';
|
||||
import { useKeyMatchers } from './useKeyMatchers.js';
|
||||
|
||||
/**
|
||||
* Options for the useTabbedNavigation hook.
|
||||
@@ -147,6 +148,7 @@ export function useTabbedNavigation({
|
||||
isActive = true,
|
||||
onTabChange,
|
||||
}: UseTabbedNavigationOptions): UseTabbedNavigationResult {
|
||||
const keyMatchers = useKeyMatchers();
|
||||
const [state, dispatch] = useReducer(tabbedNavigationReducer, {
|
||||
currentIndex: Math.max(0, Math.min(initialIndex, tabCount - 1)),
|
||||
tabCount,
|
||||
@@ -231,6 +233,7 @@ export function useTabbedNavigation({
|
||||
goToNextTab,
|
||||
goToPrevTab,
|
||||
isNavigationBlocked,
|
||||
keyMatchers,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user