How a Developer Portfolio Built a Command Palette and Fake Terminal
The author's portfolio site includes a ⌘K search palette that jumps to pages, projects, and Dota 2 heroes, plus a terminal opened with ~. Both features are built from pure functions for the logic, with React components only rendering state. Search uses a simple scoring system that ranks matches by where they appear in each item, avoiding a fuzzy matching library for a set of about a hundred items. Hero names are fetched only when the palette is first opened, keeping the page lightweight. The terminal supports commands like help, ls, cat, and cd, along with arrow-key history and tab completion, and only the command word is logged for anonymous usage analytics.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in