feat: configurable startup view with navigation improvements#118
feat: configurable startup view with navigation improvements#118
Conversation
- Change default startup view from Dashboard to ServiceBrowser - Add config.startup.view support (dashboard/services/service/resource) - Add :clear-history command to clear navigation stack - Add config.navigation.max_stack_size (default: 100) - Refactor: deduplicate service parsing into registry.ParseServiceResource() - Fix navigation semantics: preserve stack on home/services navigation - Fix: ~ key now works immediately on startup (before services load) - Add ~ toggle between Dashboard ↔ ServiceBrowser from both views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove duplicated switch in Init(), delegate to resolveStartupView() for all startup paths (CLI and config). - Eliminates code duplication - Single source of truth for view creation - Maintains existing behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This comment was marked as resolved.
This comment was marked as resolved.
- Add startup.view option to config example (dashboard/services/service/resource) - Add navigation.max_stack_size config option - Add -s dashboard/services examples to README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Pull Request Review: Configurable Startup View with Navigation ImprovementsSummaryThis PR adds flexible startup configuration, consolidates service/resource parsing logic, and improves navigation semantics. Overall, this is a well-structured PR with good test coverage and clear intent. Below are my findings organized by category. ✅ Strengths
🐛 Potential Issues1. Inconsistent Stack Clearing Semantics (internal/view/command_input.go:219-243)The PR changes navigation to use // Line 219 - services browser
return nil, &NavigateMsg{View: browser, ClearStack: false}
// Line 233 - pulse/dashboard
return nil, &NavigateMsg{View: dashboard, ClearStack: false}
// Line 248 - services/browse
return nil, &NavigateMsg{View: browser, ClearStack: false}Issue: Previously, dashboard navigation cleared the stack (treated as "home"). Now nothing clears the stack except explicit Recommendation: Consider whether dashboard ( 2. Max Stack Size Could Lose Important Navigation History (internal/app/app.go:686-691)if len(a.viewStack) > maxSize {
// Remove oldest entries
a.viewStack = a.viewStack[len(a.viewStack)-maxSize:]
}Issue: This removes the oldest entries when the stack is full. If a user has a deep navigation path (Services → EC2 → Instance → VPC → Security Group → ...), they'll lose the ability to navigate back to the beginning. Recommendation: Consider whether this is the desired behavior, or if there should be a warning/message when the stack is truncated. Alternatively, consider whether a circular buffer or different strategy might be better. 3. Missing Error Handling in resolveStartupView (internal/app/app.go:847-851)default:
// Try to parse as AWS service/resource (e.g., "ec2", "rds/snapshots")
service, resourceType, err := a.registry.ParseServiceResource(viewName)
if err != nil {
// Fallback to ServiceBrowser on error
return view.NewServiceBrowser(a.ctx, a.registry)
}Issue: Silent fallback on error could mask configuration mistakes. If a user configures Recommendation: Log the error at WARN level before falling back: if err != nil {
log.Warn("invalid startup view, falling back to service browser", "view", viewName, "error", err)
return view.NewServiceBrowser(a.ctx, a.registry)
}4. Redundant Code Pattern in command_input.go (internal/view/command_input.go:337-370)After calling service, resourceType, err := c.registry.ParseServiceResource(input)
if err == nil {
browser := NewResourceBrowserWithType(c.ctx, c.registry, service, resourceType)
return nil, &NavigateMsg{View: browser}
}
// Fallback: prefix matching for partial input
parts := strings.SplitN(input, "/", 2)
service = parts[0]
// ... more prefix matching logicConcern: This fallback re-implements parsing logic that partially duplicates Recommendation: Verify if this fallback is actually needed. If it is, add a comment explaining when and why ⚡ Performance Considerations
🔒 Security ConcernsNone identified. This PR deals with UI navigation and configuration parsing - no security-sensitive operations. 🧪 Test CoverageExcellent. The PR adds:
Suggestion: Consider adding a test for the max stack size enforcement in 📝 Code Quality & Best Practices
💡 RecommendationsHigh Priority:
Medium Priority:
Low Priority:
✅ VerdictLGTM with minor suggestions. This is a solid PR that improves code organization and adds useful features. The issues identified are minor and don't block merging, but addressing them would improve robustness. The core functionality is sound, tests are comprehensive, and the architectural changes (especially Suggested Action: Address the logging in |
Summary
Changes
Test plan
🤖 Generated with Claude Code