Skip to content

TW-4910: TUI scope mismatch — structured errors, flash safety, q-to-quit#73

Merged
qasim-nylas merged 1 commit intomainfrom
feature/TW-4910-tui-scope-mismatch
May 10, 2026
Merged

TW-4910: TUI scope mismatch — structured errors, flash safety, q-to-quit#73
qasim-nylas merged 1 commit intomainfrom
feature/TW-4910-tui-scope-mismatch

Conversation

@qasim-nylas
Copy link
Copy Markdown
Collaborator

Summary

  • Surface insufficient_scopes API errors with actionable suggestions (nylas auth show, nylas auth login, nylas auth switch) instead of generic error messages; falls back to human-readable text when the API message is empty
  • Add goroutine-safe FlashLoadError helper to prevent data races when TUI views flash errors from background Load() goroutines
  • Add q/Q to quit (k9s/less/top convention), guarded in filter mode, command palette, and detail views (compose/forms)
  • Improve APIError.Error() to surface both message and type for better diagnostics
  • Add structured 429 rate-limit and 5xx server error classification in WrapError

Test plan

  • go test ./internal/domain/ — APIError.Error() all branches + Unwrap
  • go test ./internal/cli/common/ — insufficient_scopes with/empty message, generic 403 fallthrough, 429, 500
  • go test ./internal/tui/ -run TestFlash — deadlock-freedom, pre-run flash visibility
  • go test ./internal/tui/ -run TestAppQKey — q/Q stop behavior
  • Manual: nylas tui → verify q quits, but not during : command mode, / filter, or compose forms

Docs

Copy link
Copy Markdown
Collaborator

@AaronDDM AaronDDM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@qasim-nylas qasim-nylas merged commit af0a7a6 into main May 10, 2026
6 checks passed
@qasim-nylas qasim-nylas deleted the feature/TW-4910-tui-scope-mismatch branch May 10, 2026 02:54
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.

2 participants