Skip to content

fix: move URL install confirmation prompt before spinner (#2783)#2784

Merged
mnriem merged 4 commits into
github:mainfrom
mnriem:fix/2783-url-confirm-spinner
Jun 1, 2026
Merged

fix: move URL install confirmation prompt before spinner (#2783)#2784
mnriem merged 4 commits into
github:mainfrom
mnriem:fix/2783-url-confirm-spinner

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Jun 1, 2026

Summary

Fixes #2783specify extension add --from <url> appears hung on 0.8.18 because the typer.confirm() prompt is rendered inside the console.status() spinner block. Rich's spinner thread overwrites the prompt line, so the user only sees ⠦ Installing extension: ... indefinitely.

Changes

Move the URL validation and default-deny confirmation prompt before the with console.status(...) block so the [y/N] prompt is visible and the user can respond.

Testing

  • Reproduced the bug: spinner overwrites typer.confirm() output
  • Full test suite: 3202 passed, 1 skipped (unrelated Windows PowerShell test), 0 failures

The typer.confirm() prompt inside console.status() was overwritten by
Rich's spinner animation, making extension add --from <url> appear hung.

Move URL validation and the default-deny confirmation prompt before the
spinner block so the user can see and respond to the [y/N] prompt.
Copilot AI review requested due to automatic review settings June 1, 2026 12:27
Copy link
Copy Markdown
Contributor

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 fixes a UX regression in specify extension add --from <url> where the confirmation prompt was rendered inside a Rich console.status() spinner and became invisible (making installs appear hung).

Changes:

  • Move URL validation and the default-deny typer.confirm() prompt to run before entering the spinner block.
  • Remove the duplicated URL validation/prompt logic from the URL install branch inside the spinner.
Show a summary per file
File Description
src/specify_cli/__init__.py Reorders the URL warning/confirmation flow so the prompt is visible before the Rich status spinner starts.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/specify_cli/__init__.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 1, 2026 12:32
Copy link
Copy Markdown
Contributor

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.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread src/specify_cli/__init__.py
Comment thread src/specify_cli/__init__.py Outdated
Address PR review feedback:
- Gate URL confirmation prompt on 'not dev' so --dev + --from does not
  show a confusing prompt for a URL path that will be ignored.
- Escape from_url with rich.markup.escape() in both the warning panel
  and the download message to prevent markup injection via crafted URLs.
Copy link
Copy Markdown
Contributor

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.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread src/specify_cli/__init__.py Outdated
Comment thread src/specify_cli/__init__.py
Address second round of PR review:
- Remove unused urllib.request import from URL install path
- Remove redundant re-import of rich.markup.escape; reuse safe_url
  computed before the spinner for download and error messages
- Add test_add_from_url_prompts_before_spinner: asserts typer.confirm
  fires before console.status spinner to prevent github#2783 regression
- Add test_add_from_url_cancel_exits_cleanly: asserts declining the
  prompt exits with code 0 and prints Cancelled
Copy link
Copy Markdown
Contributor

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new

@mnriem mnriem merged commit 089feca into github:main Jun 1, 2026
11 checks passed
@mnriem mnriem deleted the fix/2783-url-confirm-spinner branch June 1, 2026 12:50
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.

fix: extension add --from URL confirmation prompt hidden by spinner

2 participants