Skip to content

Commit 8a892d3

Browse files
committed
refactor: clean up unused code and fix linting issues in prompt history
- Remove unused CursorPositionState interface from ChatTextArea - Remove unused destructured variables from usePromptHistory hook - Fix missing dependency in useEffect dependency array - Rename unused parameter with underscore prefix Related to #4139
1 parent 1a0bb9f commit 8a892d3

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ interface ChatTextAreaProps {
4646
modeShortcutText: string
4747
}
4848

49-
interface CursorPositionState {
50-
value: string
51-
afterRender?: "SET_CURSOR_FIRST_LINE" | "SET_CURSOR_LAST_LINE" | "SET_CURSOR_START"
52-
}
53-
5449
const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
5550
(
5651
{
@@ -162,11 +157,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
162157

163158
// Use custom hook for prompt history navigation
164159
const {
165-
historyIndex,
166-
setHistoryIndex,
167-
tempInput,
168-
setTempInput,
169-
promptHistory,
170160
inputValueWithCursor,
171161
setInputValueWithCursor,
172162
handleHistoryNavigation,
@@ -491,7 +481,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
491481
}
492482

493483
setInputValueWithCursor({ value: inputValueWithCursor.value })
494-
}, [inputValueWithCursor])
484+
}, [inputValueWithCursor, setInputValueWithCursor])
495485

496486
// Ref to store the search timeout.
497487
const searchTimeoutRef = useRef<NodeJS.Timeout | null>(null)

webview-ui/src/components/chat/hooks/usePromptHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const usePromptHistory = ({
7979

8080
// Reset history navigation when user types (but not when we're setting it programmatically)
8181
const resetOnInputChange = useCallback(
82-
(newValue: string) => {
82+
(_newValue: string) => {
8383
if (historyIndex !== -1) {
8484
setHistoryIndex(-1)
8585
setTempInput("")

0 commit comments

Comments
 (0)