Skip to content

feat: add SQS queue insights and quit confirmation modal#3

Merged
davidbayo10 merged 15 commits into
masterfrom
feat/queue-insights-and-quit-modal
Apr 14, 2026
Merged

feat: add SQS queue insights and quit confirmation modal#3
davidbayo10 merged 15 commits into
masterfrom
feat/queue-insights-and-quit-modal

Conversation

@davidbayo10

Copy link
Copy Markdown
Owner

Summary

This PR introduces two major features to enhance the SQS queue browsing experience:

  1. SQS Queue Insights: A new panel in queue detail view that displays CloudWatch-backed signals including drain outlook, time-to-empty ETA, completion pressure, oldest message risk, and processing pressure. Gracefully degrades when CloudWatch metrics are unavailable.

  2. Quit Confirmation Modal: A user-friendly confirmation dialog for the 'q' key to prevent accidental application exits while preserving the quick Ctrl+C escape hatch.

Additional Changes

  • Friendly search filtering: Wildcard support (*-dlq, prod-*, queue-??) and combined filter terms for flexible queue/topic discovery
  • Keyboard enhancement protocol: Better key event handling when supported by the terminal
  • CloudWatch service module: New AWS service abstraction for fetching SQS queue metrics
  • Queue insights computation: Sophisticated analysis of queue behavior using SQS attributes and historical throughput data
  • Updated documentation: New AWS permissions section and enhanced feature list

Technical Details

New types in models.rs:

  • QueueCloudWatchMetrics: Historical throughput and age data
  • QueueInsight & QueueInsights: Computed health signals with severity levels
  • InsightSeverity: Normal, Warning, Critical, Unavailable states
  • Wildcard matching utilities

Event system enhancements:

  • AppEvent::SqsDetailLoaded now includes queue_url for metric association
  • New AppEvent::SqsCloudWatchLoaded event for async metric results

App state additions:

  • StatusMessage type with severity levels for improved error handling
  • Queue insights loading state management
  • Quit confirmation state tracking

AWS permissions required:

  • Existing: sqs:ListQueues, sqs:GetQueueAttributes, sns:*
  • New: cloudwatch:GetMetricData (optional, gracefully handled if missing)

Add QueueCloudWatchMetrics, InsightSeverity, QueueInsight, and QueueInsights types.
Implement compute_queue_insights() to analyze queue behavior using SQS attributes
and optional CloudWatch metrics. Add wildcard matching and friendly filter support
for search queries.
Update SqsDetailLoaded to include queue_url for proper metric association.
Add SqsCloudWatchLoaded event for async metric fetch results.
Add StatusMessage type with severity levels (Info, Success, Error).
Add queue insights state management and CloudWatch metrics loading.
Implement 'q' key for quit confirmation modal and Cmd+R for manual refresh.
Update search filtering to use friendly wildcard matching.
Handle async CloudWatch metric fetches and compute insights on load.
Add insights rendering above attributes table showing drain outlook, time-to-empty,
completion pressure, oldest message risk, and processing pressure signals with
color-coded severity indicators.
Add quit confirm view to UI dispatcher and update color constants for better
consistency (DarkGray → Gray). Update help and status messages for new keybindings.
Minor updates to SNS service and config module for CloudWatch metrics support.
Enable crossterm keyboard enhancement when supported by terminal.
Improves key event disambiguation and enables advanced key reporting.
Add SQS queue insights feature with CloudWatch-backed signals.
Document wildcard and friendly search filtering with examples.
Add AWS permissions section detailing required IAM permissions.
Update keybindings for quit confirmation modal (q vs Ctrl+C).
Replace terse state labels (Growing, Draining, Lagging, etc.) with
full-sentence detail messages that describe what is happening and why.
Extract helpers (insight, completion_insight, compute_oldest_message_risk,
compute_processing_pressure) to reduce repetition. Add absolute age
thresholds alongside retention-ratio thresholds, max_severity utility,
and a SeverityMessage trait for inline message pairing. Update tests
to match new state strings and add two new test cases.
Rename "Drain Outlook" → "Backlog Trend", "Oldest Risk" → "Oldest Message"
and "Queue Insights" panel title → "Queue Signals" for clarity.
@davidbayo10 davidbayo10 force-pushed the feat/queue-insights-and-quit-modal branch from df34156 to 4c2564b Compare April 14, 2026 18:47
@davidbayo10 davidbayo10 merged commit 24c1ea9 into master Apr 14, 2026
5 checks passed
@davidbayo10 davidbayo10 deleted the feat/queue-insights-and-quit-modal branch April 14, 2026 18:49
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