Skip to content

feat(settings): custom terminal icons, category grouping, and task dotenv injection - #415

Merged
simion merged 3 commits into
simion:mainfrom
nvkvin:feature/custom-terminal-icons
Oct 20, 2026
Merged

simion merged 3 commits into
simion:mainfrom
nvkvin:feature/custom-terminal-icons

Conversation

@nvkvin

@nvkvin nvkvin commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What

Introduces custom terminal icons, clear UI grouping for AI agents vs CLI tools/terminals, and automatic task .env / .env.local variable injection into terminal sessions.

  • Curated CLI & Tool Icon Library: Adds a dedicated icon set in src/icons/cli.tsx (Terminal, Database, Server, Globe, CPU, Container/Box, Git, Cloud, Sparkles, Code, Play, Folder) with distinct brand tint colors.
  • Custom Terminal Icon Picker: Embeds a popover icon picker in Settings > Agents when configuring custom terminal tools or agents, allowing users to visually distinguish database clients, servers, or CLI tools.
  • Agent vs Terminal Category Filter: Adds a segmented filter (All, AI Agents, CLI Tools & Terminals) in the Agents settings tabs, grouping entries cleanly by role while preserving tab selection during deletions.
  • Task .env and .env.local Environment Injection: Parses task .env and .env.local files and injects their variables directly into user terminal sessions (ptySpawn) and custom command launches, ensuring tools like Harlequin, usql, and local dev servers automatically inherit task environment configuration while explicit Settings overrides take precedence.
  • Localization: Full English and Simplified Chinese (zh-CN) support for new labels and category filters.

How it works

  • Icon Resolution & Picker: resolveIconId matches agent/terminal configuration against curated icon identifiers. In AgentCard, a Radix Popover renders the 12-icon palette with keyboard focus support, dispatching onPatch({ icon_id }).
  • Category Filter: AgentsTabs filters tab items based on isTerminalEntry. When active entries are removed, selection falls back to the nearest entry matching the active category filter (or reverts to all if no category items remain).
  • Dotenv Parsing & Injection: loadTaskDotEnv parses .env and .env.local files using parseDotEnv, respecting export prefixes, quotes, and inline comments (#). In TerminalPane.tsx and AuxTerminal.tsx, parsed environment variables are merged into ptySpawn.env for non-agent user terminals. Shell commands are wrapped with wrapWithDotEnv to source .env files while re-exporting explicit Settings overrides.

Testing

  • Unit tests:
    • src/components/settings/TerminalIcons.test.ts: Validates tool icon exports, brand colors, icon resolution, agent vs terminal differentiation, and unmounted hook order.
    • src/lib/dotenv.test.ts: Validates .env and .env.local parsing, quotation handling, export prefixes, inline comment stripping, command wrapping, and override precedence.
  • Full test suite: npm test passes all 216 test suites and 3,453 unit tests.
  • Production build: npm run build succeeds cleanly with zero errors.
  • Manual test: Exercised by hand in local development build.
    Verified custom terminal icon picker dropdown in Settings > Agents.
    Verified segmented category filter (All / AI Agents / CLI Tools & Terminals).
    Verified task .env injection into launched terminals and custom CLI tools (e.g. Harlequin).

@simion

simion commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Dotenv injection reads only from the task's own project directory and explicitly skips agent tabs, so it cannot leak secrets into the sandboxed cage or touch sandbox env vars. Worth adding a test that pins that agent-exclusion invariant, since nothing currently guards against it regressing silently. Thanks for the contribution!

— Simion's agent here, he'll take a look at this shortly.

@simion simion left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dotenv injection correctly scoped to task dir and excludes agent tabs, no leak risk. Thanks for the contribution!

— Simion's agent here, he'll take a look at this shortly.

@simion
simion merged commit 353e12a into simion:main Oct 20, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants