Skip to content

fix: add .context() to dialoguer interact() calls (#167)#169

Merged
Zious11 merged 2 commits intodevelopfrom
worktree-fix-dialoguer-context-167
Apr 5, 2026
Merged

fix: add .context() to dialoguer interact() calls (#167)#169
Zious11 merged 2 commits intodevelopfrom
worktree-fix-dialoguer-context-167

Conversation

@Zious11
Copy link
Copy Markdown
Owner

@Zious11 Zious11 commented Apr 5, 2026

Summary

  • Added anyhow::Context wrapping to all 19 dialoguer::interact() and interact_text() calls across 4 files
  • IO errors now include operation context (e.g., "failed to prompt for board selection") instead of raw std::io::Error
  • Two message patterns: "failed to read <thing>" for text input, "failed to prompt for <thing>" for selection/confirm

Files changed: src/cli/init.rs (6), src/cli/auth.rs (4), src/cli/issue/helpers.rs (7), src/cli/issue/links.rs (2)

Closes #167

Test plan

  • cargo fmt --check — no formatting issues
  • cargo clippy -- -D warnings — zero warnings
  • cargo test — all tests pass (no behavioral change, only error message enrichment)
  • Verified all 19 interact() calls have .context() (grep confirms zero bare calls remain)

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cli/init.rs 0.00% 14 Missing ⚠️
src/cli/issue/helpers.rs 0.00% 14 Missing ⚠️
src/cli/auth.rs 0.00% 8 Missing ⚠️
src/cli/issue/links.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves CLI error reporting by enriching dialoguer interactive prompt failures with anyhow::Context, so IO/TTY issues identify which specific prompt or input operation failed (closes #167).

Changes:

  • Wrapped dialoguer::Select/Confirm/Password/Input interact() / interact_text() calls with .context(<message>) across the CLI.
  • Standardized context message wording for selection vs text entry prompts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/cli/init.rs Adds contextual error messages to init/setup prompts (URL, auth method, board selection, project key, story points field).
src/cli/auth.rs Adds contextual error messages to login prompts (email/token and OAuth client credentials).
src/cli/issue/helpers.rs Adds contextual error messages to team/user/asset disambiguation prompts and shared input helper.
src/cli/issue/links.rs Adds contextual error messages to link type disambiguation prompts for link/unlink flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Zious11 Zious11 merged commit 50a68bf into develop Apr 5, 2026
7 checks passed
@Zious11 Zious11 deleted the worktree-fix-dialoguer-context-167 branch April 5, 2026 23:51
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.

Add .context() to dialoguer interact() calls for better error messages

3 participants