vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Clicking PR title looses focus

Open bpasero opened this issue 2 years ago • 15 comments

Recording 2023-10-11 at 05 28 22

bpasero avatar Oct 11 '23 03:10 bpasero

This is so that that screen readers can know that something has opened. @meganrogge FYI.

@bpasero, is there a reason that you expect it to keep focus?

alexr00 avatar Oct 11 '23 08:10 alexr00

@alexr00 all trees/lists should behave consistently:

  • single mouse click: focus remains
  • double click: focus moves
  • enter/cmd+down: focus moves

bpasero avatar Oct 11 '23 09:10 bpasero

Hmm. Looks like the "Open Description" command is special. To pass through the click modifiers, we must use the vscode.open or vscode.diff commands. We don't pass through click modifiers for other commands, and we don't have a way for commands to opt into this. "Open Description" cannot use vscode.open, because it opens a webview.

Because of this, I actually can't handle https://github.com/microsoft/vscode-pull-request-github/issues/5333 right now either.

It looks like we need a way to let commands opt in to receiving click modifiers, or let opening webviews be done with vscode.open.

alexr00 avatar Oct 11 '23 09:10 alexr00

@mjbvz is there a way I can open a webview by using vscode.open?

alexr00 avatar Oct 11 '23 09:10 alexr00

@alexr00 I don't think so. We don't expose a uri for the webview to extension but every WebviewInput does have a unique uri. Maybe if you can get a hold of that vscode.open would work but I've never tested this

mjbvz avatar Oct 11 '23 17:10 mjbvz

The uri changes every time the webview is opened, so it doesn't seem like this will work. Closing as out of scope.

alexr00 avatar Dec 20 '23 14:12 alexr00

I don't understand why this is out of scope. Is this because webviews always get focused when they open?

hediet avatar Mar 15 '24 15:03 hediet

I marked it out of scope because unless something changes with how webviews are allowed to be opened, I don't intend to fix it. We need the current behavior for accessibility.

alexr00 avatar Mar 15 '24 16:03 alexr00

We need the current behavior for accessibility.

Can you only do it when the screen-reader mode is turned on?

I'm quite sure this wouldn't break anyones workflow, but provide a more consistent experience.

hediet avatar Mar 19 '24 09:03 hediet

Yes, only doing this when screen-reader on seems reasonable.

alexr00 avatar Mar 20 '24 09:03 alexr00

@meganrogge is there any way I can tell from an extension whether the user has accessibility mode turned on? I see the setting has an auto option, which means that I can't know for sure just based on the setting.

alexr00 avatar Mar 20 '24 10:03 alexr00

We don't have API for that currently.

meganrogge avatar Mar 25 '24 19:03 meganrogge

Could you check the context key from the extension though? accessibilityModeEnabled

meganrogge avatar Mar 25 '24 19:03 meganrogge

I would need to be able to check the context value dynamically, not in the package.json, as this command is set on the tree item and not through menus in the package.json.

We don't have an API command to get a context value, just the one to set a context value.

alexr00 avatar Apr 03 '24 09:04 alexr00

Moving to the backlog as this requires API.

alexr00 avatar Apr 03 '24 09:04 alexr00