Skip to content

feat(tui): Claude auth field selector and template chip horizontal scrolling - #417

Open
Lingrui98 wants to merge 2 commits into
SaladDay:mainfrom
Lingrui98:fix/claude-auth-field-and-template-scroll
Open

feat(tui): Claude auth field selector and template chip horizontal scrolling#417
Lingrui98 wants to merge 2 commits into
SaladDay:mainfrom
Lingrui98:fix/claude-auth-field-and-template-scroll

Conversation

@Lingrui98

Copy link
Copy Markdown

This PR adds a TUI auth-field selector for Claude providers and keeps the template chip selector visible with horizontal scrolling.

  • Claude providers can now toggle between ANTHROPIC_AUTH_TOKEN (default) and ANTHROPIC_API_KEY.
  • meta.apiKeyField is written only when ANTHROPIC_API_KEY is selected.
  • Template chips stay on a single row and scroll horizontally to keep the focused chip visible.

🤖 Generated with Claude Code

…rolling

Add a TUI row for Claude providers to toggle the authentication field between ANTHROPIC_AUTH_TOKEN (default) and ANTHROPIC_API_KEY, persisting meta.apiKeyField only when ApiKey is selected.

Keep the template chip selector as a single horizontal row and implement horizontal scrolling so the focused chip remains visible in narrow terminals.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 19, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the Rust TUI provider-add/edit experience by (1) introducing a Claude-specific auth-field selector that controls whether Claude Code settings use ANTHROPIC_AUTH_TOKEN (default) or ANTHROPIC_API_KEY, and (2) improving template “chip” rendering so the selected chip remains visible via horizontal windowing instead of wrapping.

Changes:

  • Add ClaudeAnthropicApiKeyField to the provider add/edit form, including help text, keybar behavior, rendering, and Enter-to-toggle handling.
  • Update provider JSON serialization to migrate the entered Claude key between ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY, and to write meta.apiKeyField only when ANTHROPIC_API_KEY is selected.
  • Rework template chip rendering to keep chips on a single row and scroll the visible window to keep the selected chip in view; add UI tests for the new behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src-tauri/src/cli/tui/ui/tests.rs Adds regression tests ensuring template chips keep the selected chip visible and scroll to reveal off-screen chips.
src-tauri/src/cli/tui/ui/forms/shared.rs Implements horizontal “windowing” for template chip rendering and updates keybar behavior for new selector fields.
src-tauri/src/cli/tui/ui/forms/provider.rs Adds label/value rendering for the new Claude auth-field selector in the provider form.
src-tauri/src/cli/tui/help.rs Adds help content for the Claude auth-field selector.
src-tauri/src/cli/tui/form/tests.rs Adds tests covering field presence and correct env/meta output when switching Claude auth-field selection.
src-tauri/src/cli/tui/form/provider_state.rs Exposes the new selector field for applicable Claude providers and treats it as a non-text-edit field.
src-tauri/src/cli/tui/form.rs Introduces the ProviderAddField::ClaudeAnthropicApiKeyField enum variant.
src-tauri/src/cli/tui/app/tests.rs Adds an app-level key-handling test verifying Enter toggles the Claude auth-field selector.
src-tauri/src/cli/tui/app/form_handlers/provider.rs Handles Enter activation for the new Claude selector (shared handling with the existing Codex selector).
src-tauri/src/cli/i18n.rs Refactors shared “auth field” label/value text and adds Claude-specific accessors for UI/help usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…llback

When only one of ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN is configured,

Claude Code may fall back to the other field from the user's global

~/.claude/settings.json. Write an explicit empty string for the unused

alternate field in the temporary launch settings so the provider's

choice is honored.

Co-Authored-By: Claude <noreply@anthropic.com>
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