Welcome back! In the previous chapter, Help System Container, we built the "frame" of our houseβthe window manager that handles opening, sizing, and closing the help dialog.
Now, we need to furnish the first room.
When a user opens the help menu, we don't want to scare them with a massive list of 50 technical commands immediately. We want a friendly "Welcome Mat." This is the General Info Panel.
Think of the General Info Panel as the "Introduction" chapter of a book. It has two simple jobs:
Imagine a new user, Alice, just installed the tool. She types /help.
--verbose or --dry-run. She feels overwhelmed.
We are building the component inside General.tsx. This component is very staticβit doesn't need to calculate math or fetch data from a server. It just displays information.
We use a library called Ink (which is React for terminals) to build the layout.
We need to stack items vertically:
To do this, we use a <Box> with flexDirection="column".
// General.tsx
import { Box } from '../../ink.js';
export function General() {
return (
<Box flexDirection="column" paddingY={1} gap={1}>
{/* Content goes here */}
</Box>
)
}
Explanation:
<div> in HTML. It holds other things.First, we add the friendly introductory text.
<Box>
<Text>
Claude understands your codebase, makes edits with
your permission, and executes commands β right
from your terminal.
</Text>
</Box>
Explanation:
Next, we display the keyboard shortcuts. Instead of hard-coding "Press Up to move up," we use a reusable component called PromptInputHelpMenu.
Why reusable? Because we might want to show these shortcuts in other places, not just the Help window.
import { PromptInputHelpMenu } from '../PromptInput/PromptInputHelpMenu.js';
// Inside the return statement...
<Box flexDirection="column">
<Box>
<Text bold={true}>Shortcuts</Text>
</Box>
<PromptInputHelpMenu gap={2} fixedWidth={true} />
</Box>
Explanation:
How does this component actually render to the screen? Here is the flow when the user clicks the "General" tab.
When we put the pieces together in General.tsx, it looks like this. Note how simple it is because we delegated the hard work of listing keys to PromptInputHelpMenu.
// General.tsx - The Complete Component
export function General() {
return (
<Box flexDirection="column" paddingY={1} gap={1}>
{/* 1. The Mission Statement */}
<Box>
<Text>
Claude understands your codebase...
</Text>
</Box>
{/* 2. The Shortcuts Section */}
<Box flexDirection="column">
<Box><Text bold={true}>Shortcuts</Text></Box>
<PromptInputHelpMenu gap={2} fixedWidth={true} />
</Box>
</Box>
);
}
The General Info Panel is the entry point of our help system. It prioritizes clarity over density.
We learned:
<Box flexDirection="column"> to stack items.<Text> to display the mission statement.PromptInputHelpMenu to show shortcuts without rewriting the logic.Now that we have greeted the user, they are ready to look at the actual commands available to them. But before we can render the commands, we need to figure out how to organize them.
Next Chapter: Command Categorization Strategy
Generated by Code IQ