Skip to content

Refactor withSpinner to accept a callback with spinner control and dynamic success/failure messages - #20

Merged
adelrodriguez merged 1 commit into
mainfrom
08-05-refactor_withspinner_to_accept_a_callback_and_rename_spinner_message_options
Aug 6, 2026
Merged

Refactor withSpinner to accept a callback with spinner control and dynamic success/failure messages#20
adelrodriguez merged 1 commit into
mainfrom
08-05-refactor_withspinner_to_accept_a_callback_and_rename_spinner_message_options

Conversation

@adelrodriguez

Copy link
Copy Markdown
Collaborator

Refactor withSpinner to support dynamic messages and mid-spin updates

The withSpinner API on Prompter has been redesigned to be more flexible and expressive:

  • The run argument is now a callback that receives a spinner control object, allowing callers to update the spinner message mid-operation via spinner.message(...). This is used in addPackageCandidate to display a "Fetching and materializing" message after the resolution step completes.
  • The success option now accepts either a static string or a function that receives the operation's return value, enabling result-aware completion messages (e.g. showing the resolved package identity, or distinguishing between "missing" and "malformed" tsconfig/AGENTS.md outcomes).
  • The error option has been renamed to failure and made optional. When omitted, the spinner stops without a message on failure.
  • The implementation now uses Effect.acquireUseRelease instead of Effect.onExit, ensuring the spinner is always stopped even on interruption.
  • addPackageCandidateReference has been split into resolvePackageCandidateReference and materializePackageCandidateReference to allow the spinner message to be updated between the two phases.
  • Tests have been added for withSpinner covering success, failure, interruption, and omitted failure message cases.

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 26a946207e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@adelrodriguez
adelrodriguez changed the base branch from 08-05-implement_clean_command_with_local_project_clean_and_--global_store_wipe to graphite-base/20 August 6, 2026 02:25
@adelrodriguez
adelrodriguez force-pushed the 08-05-refactor_withspinner_to_accept_a_callback_and_rename_spinner_message_options branch from 26a9462 to aa66d42 Compare August 6, 2026 02:33
@adelrodriguez
adelrodriguez changed the base branch from graphite-base/20 to main August 6, 2026 02:33
@adelrodriguez
adelrodriguez force-pushed the 08-05-refactor_withspinner_to_accept_a_callback_and_rename_spinner_message_options branch from aa66d42 to 4120159 Compare August 6, 2026 02:39
@adelrodriguez
adelrodriguez merged commit 36f15c7 into main Aug 6, 2026
5 checks passed
@adelrodriguez
adelrodriguez deleted the 08-05-refactor_withspinner_to_accept_a_callback_and_rename_spinner_message_options branch August 6, 2026 02:40
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