[TRADE-790] Link zones in quote failure message.#201
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR enhances the user experience when quote requests fail in the CLI's buy functionality by replacing a generic error message with a more helpful, contextual error message. The change is made within the QuoteAndBuy React component in src/lib/buy/index.tsx.
The original error message "No quote found for the desired order. Try with a different start date, duration, or price." has been replaced with a dynamic message that provides specific, actionable guidance based on the user's current parameters. The new implementation:
- Provides contextual suggestions: Only suggests start time changes if the user didn't explicitly set a start time (defaults to "NOW"), and only suggests quantity reduction if they requested more than 8 GPUs
- Includes a clickable hyperlink: Uses ANSI OSC 8 escape sequences to create a terminal hyperlink to
https://sfcompute.com/dashboard/zonesfor checking current availability - Offers executable commands: Provides copy-pasteable CLI commands like
sf buy -s +3handsf buy -n 8that users can immediately try - Maintains error flow: Still calls
logAndQuit()to terminate execution, preserving the existing error handling behavior
This change fits within the broader CLI architecture by improving the user experience without altering the core quote failure handling logic. The QuoteAndBuy component continues to manage the quote retrieval process and UI state, but now provides more meaningful feedback when quotes cannot be obtained.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only changes error messaging without affecting core functionality
- Score reflects well-structured conditional logic and thoughtful UX improvements, though terminal hyperlink support may vary
- Pay close attention to the ANSI escape sequence formatting in the error message construction
1 file reviewed, no comments
|
We're phasing out |
Changes the quote failure message from this:
To this: