@@ -268,7 +268,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
268268 const [ menuPosition , setMenuPosition ] = useState ( 0 )
269269 const [ shownTooltipMode , setShownTooltipMode ] = useState < ChatSettings [ "mode" ] | null > ( null )
270270 const [ pendingInsertions , setPendingInsertions ] = useState < string [ ] > ( [ ] )
271- const [ showShiftDragTip , setShowShiftDragTip ] = useState ( false )
272271 const shiftHoldTimerRef = useRef < NodeJS . Timeout | null > ( null )
273272 const [ showUnsupportedFileError , setShowUnsupportedFileError ] = useState ( false )
274273 const unsupportedFileTimerRef = useRef < NodeJS . Timeout | null > ( null )
@@ -1024,45 +1023,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
10241023 }
10251024 } , [ showModelSelector ] )
10261025
1027- // Effect for Shift key hold detection
1028- useEffect ( ( ) => {
1029- const handleKeyDown = ( event : KeyboardEvent ) => {
1030- if ( event . key === "Shift" && ! event . repeat ) {
1031- // Start timer only if Shift is pressed and not already held down
1032- if ( shiftHoldTimerRef . current === null ) {
1033- shiftHoldTimerRef . current = setTimeout ( ( ) => {
1034- setShowShiftDragTip ( true )
1035- } , 250 ) // 250ms delay
1036- }
1037- }
1038- }
1039-
1040- const handleKeyUp = ( event : KeyboardEvent ) => {
1041- if ( event . key === "Shift" ) {
1042- // Clear timer and hide tip when Shift is released
1043- if ( shiftHoldTimerRef . current !== null ) {
1044- clearTimeout ( shiftHoldTimerRef . current )
1045- shiftHoldTimerRef . current = null
1046- }
1047- setShowShiftDragTip ( false )
1048- }
1049- }
1050-
1051- // Add listeners
1052- window . addEventListener ( "keydown" , handleKeyDown )
1053- window . addEventListener ( "keyup" , handleKeyUp )
1054-
1055- // Cleanup listeners on component unmount
1056- return ( ) => {
1057- window . removeEventListener ( "keydown" , handleKeyDown )
1058- window . removeEventListener ( "keyup" , handleKeyUp )
1059- // Clear any running timer on unmount
1060- if ( shiftHoldTimerRef . current !== null ) {
1061- clearTimeout ( shiftHoldTimerRef . current )
1062- }
1063- }
1064- } , [ ] ) // Empty dependency array ensures this runs only once on mount/unmount
1065-
10661026 // Function to show error message for unsupported files for drag and drop
10671027 const showUnsupportedFileErrorMessage = ( ) => {
10681028 // Show error message for unsupported files
@@ -1512,17 +1472,14 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
15121472 { /* ButtonGroup - always in DOM but visibility controlled */ }
15131473 < ButtonGroup
15141474 style = { {
1515- opacity : showShiftDragTip ? 0 : 1 ,
1516- pointerEvents : showShiftDragTip ? "none" : "auto" ,
15171475 position : "absolute" ,
15181476 top : 0 ,
15191477 left : 0 ,
15201478 right : 0 ,
15211479 transition : "opacity 0.3s ease-in-out" ,
1522- transitionDelay : showShiftDragTip ? "0s" : "0.2s" ,
15231480 width : "100%" ,
15241481 height : "100%" ,
1525- zIndex : showShiftDragTip ? 0 : 1 ,
1482+ zIndex : 6 ,
15261483 } } >
15271484 < Tooltip tipText = "Add Context" style = { { left : 0 } } >
15281485 < VSCodeButton
@@ -1592,36 +1549,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
15921549 ) }
15931550 </ ModelContainer >
15941551 </ ButtonGroup >
1595-
1596- { /* Shift Tip - always in DOM but visibility controlled */ }
1597- < div
1598- style = { {
1599- display : "flex" ,
1600- justifyContent : "flex-start" , // Left align horizontally
1601- alignItems : "center" , // Center vertically
1602- height : "100%" , // Fill the container height
1603- padding : "4px 0" , // Add padding to match button group height
1604- boxSizing : "border-box" , // Include padding in height calculation
1605- opacity : showShiftDragTip ? 1 : 0 ,
1606- pointerEvents : showShiftDragTip ? "auto" : "none" ,
1607- position : "absolute" ,
1608- top : 0 ,
1609- left : 0 ,
1610- right : 0 ,
1611- transition : "opacity 0.3s ease-in-out" ,
1612- transitionDelay : showShiftDragTip ? "0.2s" : "0s" ,
1613- width : "100%" ,
1614- zIndex : showShiftDragTip ? 1 : 0 ,
1615- } } >
1616- < span
1617- style = { {
1618- fontSize : "10px" ,
1619- color : "var(--vscode-descriptionForeground)" ,
1620- whiteSpace : "nowrap" ,
1621- } } >
1622- Hold Shift to Drop Files
1623- </ span >
1624- </ div >
16251552 </ div >
16261553 { /* Tooltip for Plan/Act toggle remains outside the conditional rendering */ }
16271554 < Tooltip
0 commit comments