feat: add /help command with interactive dialog (#303)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
cthomas
2025-12-18 13:37:49 -08:00
committed by GitHub
parent b195b2a70d
commit 1355c44dbc
3 changed files with 257 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ import { CommandMessage } from "./components/CommandMessage";
import { EnterPlanModeDialog } from "./components/EnterPlanModeDialog";
import { ErrorMessage } from "./components/ErrorMessageRich";
import { FeedbackDialog } from "./components/FeedbackDialog";
import { HelpDialog } from "./components/HelpDialog";
import { Input } from "./components/InputRich";
import { MemoryViewer } from "./components/MemoryViewer";
import { MessageSearch } from "./components/MessageSearch";
@@ -409,6 +410,7 @@ export default function App({
| "feedback"
| "memory"
| "pin"
| "help"
| null;
const [activeOverlay, setActiveOverlay] = useState<ActiveOverlay>(null);
const closeOverlay = useCallback(() => setActiveOverlay(null), []);
@@ -1753,6 +1755,12 @@ export default function App({
return { submitted: true };
}
// Special handling for /help command - opens help dialog
if (trimmed === "/help") {
setActiveOverlay("help");
return { submitted: true };
}
// Special handling for /usage command - show session stats
if (trimmed === "/usage") {
const cmdId = uid("cmd");
@@ -4601,6 +4609,9 @@ Plan file path: ${planFilePath}`;
/>
)}
{/* Help Dialog - conditionally mounted as overlay */}
{activeOverlay === "help" && <HelpDialog onClose={closeOverlay} />}
{/* Pin Dialog - for naming agent before pinning */}
{activeOverlay === "pin" && (
<PinDialog