Skip to content

v0.13.0#150

Merged
yimsk merged 2 commits intomainfrom
develop
Jan 13, 2026
Merged

v0.13.0#150
yimsk merged 2 commits intomainfrom
develop

Conversation

@yimsk
Copy link
Copy Markdown
Contributor

@yimsk yimsk commented Jan 13, 2026

Summary

Changes

  • New SettingsView modal showing all config sections
  • Config file path, runtime/startup settings, theme, timeouts, etc.
  • CLI override indicators when runtime differs from config
  • Unit tests for SettingsView

* feat(view): add :settings command to display config (#145)

- Add ModalWidthSettings = 70 constant
- Create settings_view.go with 10 sections:
  Config File, Runtime, Startup, Theme, Timeouts,
  Concurrency, CloudWatch, Navigation, Autosave, AI
- Add :settings command handler and autocomplete
- Show CLI overrides with (CLI) suffix
- Scrollable with j/k and mouse
- Add Ctrl+C to close modals globally

* chore: ignore .sisyphus directory

* fix(view): add style caching and nil-safe Update to SettingsView

* docs(view): add :settings to help documentation

* refactor(view): use slices.Equal instead of custom method

* test(view): add SettingsView unit tests
@claude

This comment was marked as resolved.

- Fix ThemeChanged test to compare content instead of addresses
- Add bounds check for separator width (prevents panic)
- Add tests for buildContent, getThemeOverrides, formatProfiles, getProfileIDs
@claude
Copy link
Copy Markdown

claude Bot commented Jan 13, 2026

Pull Request Review - v0.13.0 (Settings Command)

Summary

This PR adds a :settings command that displays current configuration in a modal view. The implementation is well-structured and follows existing codebase patterns. Overall quality is good with comprehensive test coverage.

Code Quality ✅

Strengths:

  • Follows established patterns from similar views (HelpView, ProfileDetailView)
  • Proper separation of concerns with dedicated test file
  • Consistent naming conventions and code structure
  • Good use of string builder for efficient string concatenation
  • Proper handling of viewport initialization and theme changes

Style Consistency:

  • Matches the codebase style (lipgloss styling, viewport pattern)
  • Proper error handling for ThemeChangedMsg
  • Consistent with existing modal implementations

Potential Issues & Suggestions

1. Modal Close Behavior (Minor Issue)

File: internal/app/app.go:602

Added ctrl+c as a modal close trigger. While this may be intentional, ctrl+c typically terminates the entire application in terminal UIs. This could create inconsistent UX where ctrl+c closes modals in some contexts but terminates the app in others.

Recommendation: Consider whether ctrl+c should close modals or remain as app termination. If keeping this, document the behavior clearly.

2. Runtime vs Startup Comparison Logic (Medium Priority)

File: internal/view/settings_view.go:123-142

The (CLI) indicator logic assumes that when runtime differs from startup, the difference must be from CLI overrides. However, this could also occur if user changed regions/profiles via UI commands or configuration was modified during runtime.

Recommendation: Consider renaming "(CLI)" to "(override)" or "(modified)" for accuracy, or add a mechanism to track the actual source of configuration changes.

3. Theme Override Display (Minor - Code Duplication)

File: internal/view/settings_view.go:283-354

The getThemeOverrides() method has 23 nearly identical if-statements checking theme properties. This is repetitive but acceptable given it is clear, explicit, and easy to maintain.

4. Test Coverage ✅

Strengths:

  • Good basic test coverage for all public methods
  • Tests lifecycle (Init, Update, SetSize, ViewString)
  • Tests theme change behavior
  • Tests edge cases (empty profiles, empty overrides)

Optional improvements:

  • Integration test showing actual content contains expected sections
  • Test for profile display names with multi-profile scenarios
  • Test for CLI override indicators
  • Viewport scrolling behavior with long content

5. Separator Width Calculation (Minor)

File: internal/view/settings_view.go:99-100

The separator has a hardcoded 2-space prefix which may affect precise width calculations.

Performance Considerations ✅

  • String building: Efficiently uses strings.Builder
  • Style caching: Styles are cached in struct and only recreated on theme change ✅
  • Content caching: Content is regenerated only when needed ✅
  • Viewport usage: Proper viewport implementation for potentially long content ✅

No performance concerns identified.

Security Considerations ✅

  • No user input - view is read-only ✅
  • No sensitive data exposure ✅
  • No injection risks ✅

No security concerns identified.

Recommendations Summary

  1. High Priority: None
  2. Medium Priority:
    • Clarify ctrl+c behavior in modal close logic
    • Consider renaming "(CLI)" indicator to "(override)" or "(modified)"
  3. Low Priority:
    • Optional: Add more comprehensive integration tests
    • Optional: Adjust separator width calculation for visual precision

Final Assessment

Overall: APPROVED with minor suggestions

This is a well-implemented feature that adds useful functionality for users to inspect their current configuration. The code quality is high, follows established patterns, and includes good test coverage. The identified issues are minor and mostly relate to clarity/accuracy of displayed information rather than functional problems.

Great work!

@yimsk yimsk merged commit 5658544 into main Jan 13, 2026
11 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.

1 participant