Skip to content

feat: native CloudWatch Logs viewer (issue #29)#86

Merged
yimsk merged 18 commits intodevelopfrom
feature/internal-log-streamer
Jan 3, 2026
Merged

feat: native CloudWatch Logs viewer (issue #29)#86
yimsk merged 18 commits intodevelopfrom
feature/internal-log-streamer

Conversation

@yimsk
Copy link
Copy Markdown
Contributor

@yimsk yimsk commented Jan 3, 2026

Summary

  • Add native CloudWatch Logs viewer with real-time streaming via polling
  • Navigate with t key from log-groups/log-streams (replaces action menu approach)
  • Remove ActionTypeView dead code in favor of Navigation-based view switching

Changes

  • New: internal/view/log_view.go - Bubbletea view with 3s polling, pause/resume, scroll
  • New: internal/view/log_view_test.go - Comprehensive tests (298 lines)
  • New: render.ViewTypeLogView constant + Navigation.ViewType field
  • New: appaws.Int64Ptr() helper for consistency
  • Removed: ActionTypeView constant and related exec actions (Tail Logs, View Recent)
  • Fixed: LogStreamDAO.Delete idempotency with IsNotFound check

Code Quality

  • ✅ All tests pass
  • ✅ Lint clean
  • ✅ AWS SDK patterns compliant (appaws.*, apperrors.Wrap)
  • ✅ View patterns aligned (ready flag, SetSize, ViewString)

Closes #29

yimsk added 6 commits January 3, 2026 10:28
Replace external 'aws logs tail' dependency with internal TUI log viewer.

- Add LogView with FilterLogEvents polling (3s interval)
- Support both log-groups and log-streams
- Space to pause/resume, g/G for top/bottom, c to clear
- Remove AWS CLI and less dependencies
Move log viewing from Action menu to Navigation shortcut:
- Press 't' directly from log-groups/log-streams to open LogView
- Remove ActionTypeView handling from action_menu
- Cleaner UX: no action menu step needed
- Add ready flag to LogView to prevent uninitialized viewport access
- Remove ActionTypeView constant and related IsAllowedInReadOnly case
- Remove obsolete ActionTypeView test cases
- Remove beads issue tracking setup (not using)
- LogView: use apperrors.Wrap instead of fmt.Errorf
- LogView: use appaws.* helpers instead of raw aws.*
- LogStreamDAO.Delete: add IsNotFound check for idempotency
- helpers.go: add Int64Ptr for consistency with Int32Ptr
@claude

This comment was marked as resolved.

- Add 10s timeout for FilterLogEvents API calls
- Add exponential backoff on throttling (up to 30s)
- Reset poll interval on success
- Add godoc for LogView struct
@claude

This comment was marked as resolved.

@claude

This comment was marked as resolved.

@claude

This comment was marked as resolved.

- Check parent context before starting fetch to prevent resource leaks
- Extract buffer sizes and fetch limit to named constants
@claude

This comment was marked as resolved.

Only continue polling with backoff on throttling errors.
Other errors (access denied, etc.) stop polling to avoid spamming.
@claude

This comment was marked as resolved.

- Check context cancellation before initializing AWS client
- Show throttle status with backoff interval in StatusLine
@claude

This comment was marked as outdated.

Fixes multi-region mode where resources are wrapped with RegionalDAOWrapper.
Without unwrapping, type assertions for logGroupProvider/logStreamProvider fail.
@claude

This comment was marked as outdated.

- Add 'p' key to load 1 hour of older logs (prepends to buffer)
- For log streams, use lastEventTimestamp as starting point
- Track oldestEventTime to enable backward navigation
- Fixes issue where old streams showed 'no log events'
@claude

This comment was marked as outdated.

yimsk added 4 commits January 3, 2026 12:33
- Use ui.NewSpinner() for consistent spinner initialization
- Extract doFetchLogs() to eliminate code duplication (75% reduction)
- Add LogFetchTimeout to config system (default: 10s)
- Add IsNotFound/IsAccessDenied error classification for better UX
- Replace errors.New() with apperrors.Wrap() for consistency
- Document viewportHeaderOffset magic number
- Remove unused Action.Target field
- Remove unused LogView.width/height fields
- Add LogFetch to DefaultFileConfig for consistency
- Restore doc comments for Navigation, ViewTypeLogView, HandleKey
- Add width/height fields for consistency with DetailView, DiffView, etc.
- Remove HasActiveInput() since views without filter don't implement it
@claude

This comment was marked as resolved.

@yimsk yimsk merged commit eeec65c into develop Jan 3, 2026
5 checks passed
@yimsk yimsk deleted the feature/internal-log-streamer branch January 3, 2026 13:20
This was referenced Jan 3, 2026
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