Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Text Editor prompts #1

Closed
mikaelmello opened this issue Jun 24, 2021 · 1 comment
Closed

Implement Text Editor prompts #1

mikaelmello opened this issue Jun 24, 2021 · 1 comment
Assignees

Comments

@mikaelmello
Copy link
Owner

mikaelmello commented Jun 24, 2021

The behavior I'm looking for is similar to Github's CLI.

Basically something like this:

? Description: [(e) to launch nano, enter to skip]

after the user inputs: it calls the formatter, having this by default:

? Description: <received>

or, if skipped:

? Description: <skipped>

@mikaelmello mikaelmello reopened this Jul 26, 2021
@mikaelmello mikaelmello changed the title Implement "open editor" in Input prompts Implement Text Editor prompts Jul 26, 2021
@mikaelmello mikaelmello added this to the announcement-2 milestone Aug 27, 2021
@mikaelmello mikaelmello self-assigned this Sep 5, 2021
@mikaelmello
Copy link
Owner Author

use cases:

  • commit message
  • pr editor
  • edit configuration file
  • edit file before savin

thoughts:

  • default behavior is to open a tmp file on an editor and return the string value

  • should have a way to set a custom file to edit

  • behavior 1: open tmp file with editor, return string value to caller

    • allow pre-defined text on file
  • behavior 2: allow user to edit file content before saving
    e.g. export method, where you set lots of options and then can edit the final file
    should allow user to skip editing

    • can be implemented with (Confirm + Behavior 1): Do you want to review the file? (y/N) + behavior 1 with pre-defined text on file
  • behavior 3: allow user to edit existing file
    e.g. do you want to edit file? -> inquire handles the logic to properly open the file

    • inquire's role on this use-case is not really related to "interactive prompts"
    • the user should just use a Confirm and open the file themselves

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

No branches or pull requests

1 participant