Skip to content

Commit a65d302

Browse files
davindicodeclaude
andcommitted
Show "not installed" in tool panels, re-check on each open
- nano/vim/tmux panels show yellow "not installed" message if tool missing - Tool versions re-fetched each time a tool tab is opened (catches new installs) - File opener and session picker hidden when tool not available - Tabs always visible for discoverability Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ec75a30 commit a65d302

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

app/components/terminal/InputBox.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useRef, useCallback } from "react";
1+
import { useState, useRef, useCallback, useEffect } from "react";
22
import { useTerminalStore } from "~/stores/terminalStore";
33

44
interface QuickKey {
@@ -260,16 +260,22 @@ export default function InputBox() {
260260
onContextMenu: (e: React.MouseEvent) => e.preventDefault(),
261261
});
262262

263+
// Fetch tool versions (re-fetch each time a tool tab is opened to catch new installs)
263264
const fetchToolVersions = async () => {
264-
if (toolVersionsFetched.current) return;
265-
toolVersionsFetched.current = true;
266265
try {
267266
const res = await fetch("/api/tool-versions");
268267
const data = await res.json();
269268
setToolVersions(data);
270269
} catch {}
271270
};
272271

272+
// Initial fetch
273+
useEffect(() => {
274+
if (toolVersionsFetched.current) return;
275+
toolVersionsFetched.current = true;
276+
fetchToolVersions();
277+
}, []);
278+
273279
const toggleGroup = (id: string) => {
274280
if (activeGroup === id) {
275281
setActiveGroup(null);
@@ -581,6 +587,9 @@ export default function InputBox() {
581587
)}
582588
{activeGroup === NANO_TAB && inEditor !== "nano" && (
583589
<div className="border-b border-gray-700/50 bg-[#12122a] px-3 py-2">
590+
{!toolVersions.nano ? (
591+
<span className="text-[11px] text-yellow-400">nano is not installed. Install it via your package manager.</span>
592+
) : (
584593
<div className="flex items-center gap-2">
585594
<span className="text-[11px] text-gray-500">nano{toolVersions.nano ? ` v${toolVersions.nano}` : ""}</span>
586595
<input
@@ -598,6 +607,7 @@ export default function InputBox() {
598607
Open
599608
</button>
600609
</div>
610+
)}
601611
</div>
602612
)}
603613

@@ -621,8 +631,11 @@ export default function InputBox() {
621631
)}
622632
{activeGroup === VIM_TAB && inEditor !== "vim" && (
623633
<div className="border-b border-gray-700/50 bg-[#12122a] px-3 py-2">
634+
{!toolVersions.vim ? (
635+
<span className="text-[11px] text-yellow-400">vim is not installed. Install it via your package manager.</span>
636+
) : (
624637
<div className="flex items-center gap-2">
625-
<span className="text-[11px] text-gray-500">vim{toolVersions.vim ? ` v${toolVersions.vim}` : ""}</span>
638+
<span className="text-[11px] text-gray-500">vim v{toolVersions.vim}</span>
626639
<input
627640
value={editorFileName}
628641
onChange={(e) => setEditorFileName(e.target.value)}
@@ -638,6 +651,7 @@ export default function InputBox() {
638651
Open
639652
</button>
640653
</div>
654+
)}
641655
</div>
642656
)}
643657

@@ -658,9 +672,10 @@ export default function InputBox() {
658672
)}
659673
{activeGroup === TMUX_TAB && !inTmux && (
660674
<div className="border-b border-gray-700/50 bg-[#12122a] px-3 py-2">
661-
{toolVersions.tmux && (
662-
<span className="text-[10px] text-gray-600 float-right">v{toolVersions.tmux}</span>
663-
)}
675+
{!toolVersions.tmux ? (
676+
<span className="text-[11px] text-yellow-400">tmux is not installed. Install it via your package manager.</span>
677+
) : (<>
678+
<span className="text-[10px] text-gray-600 float-right">v{toolVersions.tmux}</span>
664679
{tmuxLoading ? (
665680
<span className="text-[11px] text-gray-500">Loading...</span>
666681
) : tmuxSessions.length === 0 ? (
@@ -708,6 +723,7 @@ export default function InputBox() {
708723
Create
709724
</button>
710725
</div>
726+
</>)}
711727
</div>
712728
)}
713729

0 commit comments

Comments
 (0)