Skip to content

feat: Complete Settings UI improvements (PR #4/8) - Tab navigation and tags editor#72

Merged
eyelock merged 4 commits into
mainfrom
feat/pr4-tags-settings-tab
Jan 18, 2026
Merged

feat: Complete Settings UI improvements (PR #4/8) - Tab navigation and tags editor#72
eyelock merged 4 commits into
mainfrom
feat/pr4-tags-settings-tab

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Jan 18, 2026

Summary

This PR completes the Settings UI improvement series by fixing the "Edit Global Settings" button and replacing the custom tags editor with KeyValueEditor components.

Changes

1. Fix "Edit Global Settings" Button

  • ✅ Replace problematic sheet/NSWindow approaches with SwiftUI's SettingsLink
  • ✅ Add SettingsCoordinator singleton for tab pre-selection
  • ✅ Settings window now opens with Environment tab selected when accessed from Terminal Details Environment tab
  • ✅ Proper window controls (close, minimize, title bar)
  • ✅ Correct keyboard focus
  • ✅ No nested UI issues

2. Replace Tags Editor with KeyValueEditor

  • ✅ Use KeyValueList component for displaying tags
  • ✅ Use KeyValueAddForm component for adding new tags
  • ✅ Consistent UX with Environment variables editor
  • ✅ Remove obsolete state variables (newTagKey, newTagValue)
  • ✅ Cleaner, more maintainable code

3. Complete Localization

  • ✅ Added "Add Tag" string (editor.section.add.tag) across all 40 languages

Technical Details

Files Created

  • Sources/TermQ/ViewModels/SettingsCoordinator.swift - Coordinates Settings navigation

Files Modified

  • Sources/TermQ/Views/CardEditorEnvironmentTab.swift - Use SettingsLink with tab coordination
  • Sources/TermQ/Views/CardEditorView.swift - Replace custom tags UI with KeyValueEditor
  • Sources/TermQ/Views/SettingsView.swift - Observe coordinator for tab requests
  • Sources/TermQ/Utilities/Strings.swift - Add sectionAddTag constant
  • Sources/TermQ/Resources/*/Localizable.strings (40 files) - Add translations

Testing

Manual Testing Completed ✅

  • "Edit Global Settings" button opens Settings window properly
  • Settings window has proper controls (close, minimize, title bar)
  • Environment tab pre-selected when opening from Terminal Details
  • Keyboard focus works correctly in Settings window
  • Settings not nested inside Terminal Details
  • Tags editor displays existing tags correctly
  • Tags can be added using new KeyValueAddForm
  • Tags can be deleted
  • Visual consistency between Environment and Tags editors
  • App doesn't quit when closing Terminal Details

Automated Testing ✅

  • All 521 tests passing
  • make check passes (build, lint, format-check, test)

Code Quality

  • Lines Changed: +130 / -51 (net reduction through component reuse)
  • Lint Warnings: Only pre-existing warnings (unrelated to changes)
  • Test Coverage: All tests passing

Addresses Feedback Items

From parent plan (.claude/plans/settings-ui-improvements-implementation.md):

Related PRs

This is PR #4 of 8 in the Settings UI improvements series:

🤖 Generated with Claude Code

David Collie and others added 4 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>
…editor

This PR completes the Settings UI improvement series by:

1. Fix "Edit Global Settings" button to properly open Settings window
   - Replace problematic sheet/NSWindow approaches with SettingsLink
   - Add SettingsCoordinator for tab pre-selection
   - Settings now opens with Environment tab selected when accessed from Terminal Details

2. Replace custom tags editor with KeyValueEditor components
   - Use KeyValueList for displaying tags
   - Use KeyValueAddForm for adding new tags
   - Consistent UX with Environment variables editor
   - Remove obsolete state variables (newTagKey, newTagValue)

3. Complete localization for "Add Tag" string across all 40 languages

Technical changes:
- Created SettingsCoordinator singleton for Settings navigation coordination
- Updated SettingsView to observe coordinator and respond to tab requests
- Updated CardEditorEnvironmentTab to use SettingsLink with simultaneousGesture
- Updated CardEditorView metadata tab to use KeyValueEditor pattern
- Added sectionAddTag localization key in all 40 language files

All tests passing (521 tests, 0 failures)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Jan 18, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@eyelock eyelock merged commit f8306ca into main Jan 18, 2026
6 checks passed
@eyelock eyelock deleted the feat/pr4-tags-settings-tab branch January 18, 2026 22:55
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