Skip to content

PR #3: Environment Tab Integration#71

Merged
eyelock merged 2 commits into
mainfrom
feat/pr3-environment-tab-integration
Jan 18, 2026
Merged

PR #3: Environment Tab Integration#71
eyelock merged 2 commits into
mainfrom
feat/pr3-environment-tab-integration

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Jan 18, 2026

Summary

  • Split KeyValueEditor into focused components
  • Add proper error handling for secrets
  • Fix encryption key status updates
  • Add secret visibility toggle in Terminal Details

Changes

KeyValueEditor.swift:

  • Split into KeyValueList (view) + KeyValueAddForm (add) + KeyValueEditor (deprecated wrapper)

SettingsEnvironmentView.swift:

  • Use split components in separate sections
  • Add error alerts (replaced try?)
  • Fix encryption key status race condition

CardEditorEnvironmentTab.swift:

  • Use split components
  • Add secret visibility toggle for inherited globals
  • Add error handling

Localization:

  • Add section headers for better organization

🤖 Generated with Claude Code

@eyelock eyelock force-pushed the feat/pr3-environment-tab-integration branch from be38954 to e6c46ff Compare January 18, 2026 21:50
David Collie and others added 2 commits January 18, 2026 21:50
Apply shared KeyValueEditor component to both Settings > Environment
and Terminal Details > Environment tabs for consistent UI and behavior.

Changes:
- Settings Environment tab: Replace inline form with KeyValueEditor
- Terminal Details Environment tab: Replace inline editor with KeyValueEditor
- Both tabs now use identical shared component with full-width inputs
- Consistent styling with Form .formStyle(.grouped)
- Proper state synchronization between KeyValueItem and EnvironmentVariable

Addresses feedback #4, #7, #8, #9, #11 from implementation plan

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Split KeyValueEditor into focused components (KeyValueList + KeyValueAddForm)
for better UX with separate sections for viewing and adding items.

Changes:
- Split KeyValueEditor.swift into 3 components:
  * KeyValueList - display existing items with delete
  * KeyValueAddForm - add new items with validation
  * KeyValueEditor - legacy wrapper (deprecated)

- SettingsEnvironmentView improvements:
  * Use split components in separate sections
  * Add proper error handling with user-visible alerts
  * Fix encryption key status race condition
  * Remove nested Form wrapper

- CardEditorEnvironmentTab improvements:
  * Use split components in separate sections
  * Add secret visibility toggle for inherited globals
  * Add proper error handling with alerts
  * Store secret values in memory for display

- Add localized section headers:
  * "Global Environment Variables"
  * "Add Environment Variable" (Settings)
  * "Add Environment Variable" (Terminal Details)

Fixes:
- Secrets not being added (silent error swallowing with try?)
- Encryption key status not updating after operations
- Secret values not viewable in Terminal Details inherited list

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@eyelock eyelock force-pushed the feat/pr3-environment-tab-integration branch from e6c46ff to d0e69bf Compare January 18, 2026 21:50
@claude
Copy link
Copy Markdown

claude Bot commented Jan 18, 2026

Code Review

I found 1 issue that requires attention:

❌ Hardcoded string should be localized

Files:

  • Sources/TermQ/Views/CardEditorEnvironmentTab.swift:84
  • Sources/TermQ/Views/SettingsEnvironmentView.swift:33

Issue:
The hardcoded English string "An unknown error occurred" should be added to the localization system to support all 40 languages in this project.

CLAUDE.md Reference:
As specified in commands/localization.md, all user-facing strings must be defined in Strings.swift and Localizable.strings.

Suggested fix:

  1. Add a new key to Strings.swift:
extension Strings.Alert {
    static let unknownError = String(localized: "alert.error.unknown")
}
  1. Add "alert.error.unknown" = "An unknown error occurred"; to en.lproj/Localizable.strings

  2. Run /localization sync to propagate to all 40 language files

  3. Replace both occurrences:

Text(errorMessage ?? Strings.Alert.unknownError)

Context:


Summary: All other changes look good. No bugs found. CLAUDE.md compliance verified except for the localization issue above.

@eyelock eyelock merged commit efaafc0 into main Jan 18, 2026
6 checks passed
@eyelock eyelock deleted the feat/pr3-environment-tab-integration branch January 18, 2026 21:57
@claude
Copy link
Copy Markdown

claude Bot commented Jan 18, 2026

Code Review

Found 1 issue requiring attention:

Hardcoded UI strings should be localized

Locations:

The string "An unknown error occurred" is a user-facing error message that appears in alert dialogs but is not localized.

Why this matters:
Per implementation-checks.md:

If you modified UI strings or Swift files with UI: REQUIRED: Run localization validation

This project supports 40 languages and uses a comprehensive localization system. User-facing strings should use the Strings.* pattern instead of hardcoded literals.

Suggested fix:

// 1. Add to Localizable.strings:
"alert.unknown.error" = "An unknown error occurred";

// 2. Add to Strings.swift:
extension Strings.Alert {
    static let unknownError = NSLocalizedString("alert.unknown.error", comment: "Generic error message")
}

// 3. Replace both occurrences:
Text(errorMessage ?? Strings.Alert.unknownError)

Context:
Both files already use localized strings for the alert title (Strings.Alert.error) and button (Strings.Common.ok), making the hardcoded fallback message inconsistent with the established pattern.

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.

1 participant