vscode-perforce icon indicating copy to clipboard operation
vscode-perforce copied to clipboard

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

Open nikolodus opened this issue 5 years ago • 4 comments

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 avatar Nov 06 '20 12:11 nikolodus

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

nikolodus avatar Nov 06 '20 12:11 nikolodus

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 avatar Nov 06 '20 15:11 mjcrouch

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.

nikolodus avatar Nov 18 '20 23:11 nikolodus

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!)

mjcrouch avatar Nov 19 '20 22:11 mjcrouch