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

[Create changelist in editor] After saving the new CL keyboard focus should change to the 'Apply now' button #190

Open
nikolodus opened this issue Nov 6, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@nikolodus
Copy link

Describe the bug:
After writing up the new changelist and saving it (CTRL+S) a popup appears
in the lower right corner asking to press 'Apply now' to save the new change

The problem is that the keyboard focus remains on the editor, which forces
the user to use the mouse to hit 'Apply now'

Expected behavior:
The keyboard focus should change to the new dialog on hitting CTRL+S to
allow the user to simply press ENTER again to save the change and dismiss the
dialog and the tmp file;

To Reproduce:

  1. Set P4EDITOR to vscode in the .p4config file:
    P4EDITOR="C:\Program Files\Microsoft VS Code\Code.exe" --wait
  2. Edit a file in p4 workspace and save it
  3. Bring up the command palette and choose "Perforce: Create changelist in editor"
  4. Type up the changelist description and hit CTRL+S to save
  5. Observe the lower-right corner dialog popup and try to press ENTER to "Apply now"
    and dismiss the dialog
  6. At this point you'll have created another empty line in the changelist description
    because the editor was still in focus

Versions & Details:

  • Perforce extension: v4.14.0
  • VSCode version: 1.50.1
  • Operating System: Windows 10 Enterprise v19041.572
  • Perforce server details (if known): /
  • Are you using a multi-root workspace?: No

Additional context

Please open view -> Output, select "Perforce Log" from the dropdown and paste it here, if possible / relevant
@nikolodus nikolodus added the bug Something isn't working label Nov 6, 2020
@nikolodus
Copy link
Author

Perhaps this shouldn't be treated as a bug, but more a enhancement request?

@mjcrouch
Copy link
Owner

mjcrouch commented Nov 6, 2020

Thanks for the suggestion - However I don't think the vs code API exposes anything that would allow us to focus the info dialog, but I'll have another look to make sure

I guess there's an alternative that we could pop up a multiple choice 'quick pick' instead at the top, which would take focus - this might be a little intrusive though!

@mjcrouch mjcrouch added enhancement New feature or request and removed bug Something isn't working labels Nov 6, 2020
@nikolodus
Copy link
Author

Sorry for not responding for a while, I didn't get any notifications for this. :(
Do you even need to display the info dialog? Would you consider changing the flow to sth like this:

  1. Create changelist in editor
  2. Write up the changelist description and save (Ctrl+S or through the menu)
  3. Now you naturally have an option of continuing to edit, or close the tmp file.
  4. If you close the tmp file, instead of showing a dialog, simply treat that as a done-deal and create the new changelist.

This workflow is more similar to how a p4 client works. if you execute p4 client it will bring up your editor and after saving and closing the client tmp file, the client will automatically be saved.

@mjcrouch
Copy link
Owner

While I personally like having an explicit action, your idea might be a possible intuitive flow - Similar problem to the above though, we actually don't have a reliable way to know that the file has been closed in the vs code api, though I think that was being worked on - not sure on the progress of that (in the last couple of months I've moved on from my previous job where I used perforce daily to a new one where we use a custom vs code build and no perforce so I'm a bit out of touch now!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants