-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Give ui.browseableMessage the ability to show copy and close buttons after the message, and add buttons to some instances #16369
Conversation
See test results for failed build of commit 29b526c98d |
@Qchristensen would you mind trying this build, and commenting on the UX? Specifically, try NVDA+k NVDA+k, and NVDA+f NVDA+f, and observe the buttons which appear in each message. I haven't written dev or user documentation yet, but I want to make sure this is going in a reasonable direction. Also note, that the copy button is optional. Further, note the comment below by @wmhn1872265132, and consider whether that would be a useful alternative. |
I prefer to change the behavior of copying to copy and exit, generally speaking once the information is copied the window loses its necessity to exist |
I am not convinced of the usefulness of this PR. As an experimented user, the change in this PR is a degradation of my personal experience, due to the "select all" issue, i.e. when selecting all, you select both the content and the control buttons. But I understand that this PR rather targets beginners. Though, it seems to me that there has not been so many reporting from beginners or teachers with the current browseable message. Escape or Alt+F4 are classical commands in Windows, so I guess many beginners learn it quite quickly in any case. Also aren't touch device users accustomated to go to previous object in fow to reach the close button? In any case, I guess that teachers (@XLTechie, @britechguy, maybe @cary-rowen) are the best persons to indicate if this PR is useful or not; and I will not go against their choice. I have various remarks though on this PR:
Sorry Luke for this quite negative feedback, but I thought it was worth sharing. |
I believe that is why @nvdaes proposed the "copy" button in the original issue. The copy button specifically avoids copying the footer section.
@Qchristensen originally raised this. That was my only context; I am assuming he, as NV Access, had sufficient complaints to open an issue. I think the debate is supposed to be done in the original issue. Certainly the context is there.
This is a rip-off of Jaws, and in part a response to the request in the original The Jaws UI here, I believe, is just a text line saying "Press escape to close", that for some reason acts as a close button if you happen to interact with it. I could have done that here (with a clickable), but I thought people would find that as objectionable as you find this.
I agree in general, and can easily do that. At this stage of the draft PR, I wished to demonstrate both possibilities. However, add-ons may have other requirements, and I didn't want to insist that they have a copy button.
Agreed. Done in a live region.
"Copy" exists to enable copying without inclusion of the footer. That may be what you're saying there, the translation is unclear of "which loads more this windows", although I think it means that it adds more content to the window. If that is what you meant, then the reason is to provide a copy function that doesn't capture the footer, which is what I got from #14641 (comment)
"Press escape to exit" could be added to the title bar of every message.
I am not sure there is a "good" solution to this. |
34a2764
to
9dfb23d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Re all the comments in #16369 (comment): I have the feeling that we did not investigate enough #14641, i.e. why some people may have difficulty with the browseable message. Are there many such people? What is the profile of these people? Have these people switched recently from Jaws and do they expect the same from NVDA? It seems to me that almost every blind windows user know that pressing Alt+F4 or Escape in any window or dialog allows to close it; a user that would not be aware of this is lacking important information and thus would need extra teaching. My personal need for select all is only to copy the content. So I agree that the "Copy" button does the same thing. Why I am a bit reluctant to the change in this PR is that it seems to me a UX degradation. The browseable message becomes heavier (in term of UX) with the Close button, and moreover adding the Close button causes a new issue, which is resolved by adding the Copy button, which makes this browseable message more heavy and complex. But people have not expressed difficulty in copying the content of current version of the browseable message. Also, I understand why the buttons (presence or not and label) may need to be configurable. However, this configurability will make the experience of browseable message less unified, which is a UX degradation. The wx dialog is not an option due to the Bu if I am the only one feeling that it's a UX degradation, go ahead anyway. Especially if @Qchristensen confirms the "go" for this PR. Thanks for having changed the label of the "Close" button. The speech feedback of the "Copy" button is still needed. And also, what is copied when |
@CyrilleB79 I just want to say that:
Most dialogs in NVDA that are real dialogs (actually all, that I can think of), have some sort of active close feature, be it an OK button, a Close button, or such. So this is not so abnormal. The average user doesn't know that this is not a dialog. I think that may be where some of the confusion comes from.
|
In general this is not a dialog, and in fact it is even not visible on the screen as far as I know. NVDA reports "document" when opening them, and not "dialog" as it does when opening settings dialogs. I agree with @CyrilleB79's doubts on the usefullness of this PR. @XLTechie wrote:
I think it would make more sense to tell users that there is a difference instead of changing the interface so the users don't notice a difference. In NVDA terms virtual browseable documents are commonly used in many discussoins, so it is ok in my view not to treat them as if they were dialogs. |
@Adriani90 wrote:
In general this is not a dialog, and in fact it is even not visible on the screen as far as I know.
It is absolutely visible on the screen.
|
Even the OCR window?Von meinem iPhone gesendetAm 15.04.2024 um 12:46 schrieb Luke Davis ***@***.***>:
@Adriani90 wrote:
In general this is not a dialog, and in fact it is even not visible on the screen as far as I know.
It is absolutely visible on the screen.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@Adriani90 wrote:
Even the OCR window?
no, but that is a custom dialog, not an mshtml document. Not applicable to this
conversation.
|
Is this ready for review? |
This comment was marked as outdated.
This comment was marked as outdated.
WalkthroughThe recent changes enhance user interaction in message dialogs by introducing new parameters to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GlobalCommands
participant UI
participant MessageHtml
User ->> GlobalCommands: Trigger Report Link Destination
GlobalCommands ->> UI: Call browseableMessage with new parameters
UI ->> MessageHtml: Render message with copy & close buttons
User ->> MessageHtml: Click Copy Button
MessageHtml ->> User: Handle copy action
User ->> MessageHtml: Click Close Button
MessageHtml ->> User: Handle close action
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range and nitpick comments (1)
source/ui.py (1)
Line range hint
92-137
: Review the integration ofcloseButtonText
andcopyButton
parameters inbrowseableMessage
.The implementation of the
browseableMessage
function with additional parameters for button text and display options is a good enhancement. However, consider refactoring to encapsulate the button-related logic into a separate function or class. This would improve the maintainability of the code and make it easier to manage changes to the button logic in the future.
Co-authored-by: Sean Budd <[email protected]>
@seanbudd I have updated this and marked it as ready again, pursuant to my comment #16369 (comment) Also, I am interested in the directions from which you see an injection threat coming? Presumably a user could click a link in HTML provided by an add-on, which would then load a secondary malicious page, or could even pull something in via auto-loaded external refs of other kinds. But once the initial HTML is loaded, Python is out of the picture, and obviously we can't sanitize that. Even if an add-on pushes in a third party link via a refresh directive, short of banning those entirely, we wouldn't be able to do anything about it. And maybe we should ban those entirely, I'm just trying to get a sense of the threat vector. |
@XLTechie - I'll need to discuss internally on whether we want to perform the sanitization in this release. The vector we're concerned about is NVDA translations, as these are fairly unregulated, translation strings are the only "code" included in NVDA without a direct review from NV Access or as a dependency. If NVDA translations can perform RCE, we have a problem. I think we can tackle this in 2025.1 as the sanitization rules might break add-on functionality, and there's no active risk right now. |
The vector we're concerned about is NVDA translations, as these are fairly unregulated, translation strings are the only "code" included in NVDA without a direct review from NV Access. If NVDA translations can perform RCE, we have a problem.
Well, I would imagine they could, if we had any HTML based messages in play, which, as you say, we don't. I don't think there are any active proposals that would introduce one, either.
I can even think of a policy based mitigation that would work for the time being, in case some weird need for an HTML message comes up before 2025.1 release.
Specifically, require that all internal HTML messages have only their non-HTML strings translatable, and run those that are through one of the escaping functions.
|
@XLTechie I'll write up an issue to do this in 2025.1. I think we could make the sanitization rules for this message as part of our public API so add-ons can adjust them as necessary |
I've opened #16985 |
Re the "ding" issue, did you try |
@SaschaCowley Yes, with no change in outcome. I also tried other ways of picking up the event than the body onKeyDown handler, but was unsuccessful in even receiving the key then, unless I was doing it wrong.
(E.g. an addEventListener on the button.)
|
…after the message, and add buttons to some instances (2nd try) (#17018) Fixes #14641 Addresses #16995 Addresses #16996 Summary of the issue: In #14641 @Qchristensen reported that some users are confused by browseableMessages, and their lack of definite closure mechanisms. During the conversation, it was pointed out that in some cases, a user might also desire a copy button. During work on the PR (originally #16369), it was requested that the copy button be given an accelerator key. Description of user facing changes Added copy and close buttons to some browseableMessages, and the capability to add them to others. Description of development approach Thanks to @michaelDCurran's change in ui.browseableMessage--namely adding a Scripting.Dictionary to carry arbitrary query-string-equivalent style parameters to the mshtml instance behind browseableMessage, it is now possible to pass in values for two new buttons, and various translatable messages, without any contortions. Tried different methods in the JS and CSS of message.html, and eventually settled on one which displayed the two buttons side-by-side, under a separator. If neither button's label is supplied, the div containing the HR and buttons remains hidden. The "Copy" button can be activated with Ctrl+Shift+C, and the "Close" button by Escape. Alt+C is indicated to the user via an accessibility label. Fixed up some docstring parameter listings to match modern format. Per the issue, modified the Report Link Destination message, to have both a copy button and a close button. Per the issue, added buttons to the Report Character Information message. Per request in PR comments, used a live region to present a "Copy complete" or "copy failed" message to the user. This message remains on screen for five seconds. The AI suggested covering for more failures in the initialization and configuration of MSHTML. I used its suggested exception checking, but added a private function to display an error message to the user when one of the components fail, so at least some kind of user notice can be given. I based it on the already extant private function for messaging the user if a browseableMessage is called on a secure screen. Both of the warning functions for browseableMessage unavailable situations, are now self-contained, with respect to wx. Added an immediate return if the MSHTML window is opened without providing the dialog arguments (i.e. the message and title, at least). That situation should never actually occur, but in the unlikely event that a failure passes the error checking we have in browseableMessage, this will return immediately, instead of stranding the user in a blank window with no obvious close mechanism.
Link to issue number:
Fixes #14641
Summary of the issue:
@Qchristensen reported that some users are confused by browseableMessages, and their lack of definite closure mechanisms.
During the conversation, it was pointed out that in some cases, a user might also desire a copy button.
Description of user facing changes
Added copy and close buttons to some browseableMessages.
Description of development approach
browseableMessage
change--namely adding aScripting.Dictionary
to carry arbitrary query-string-equivalent style parameters to themshtml
instance behindbrowseableMessage
, it is now possible to pass in values for two new buttons, and various translatable messages, without any contortions.message.html
, and eventually settled on one which displayed the two buttons side-by-side, under a separator. If neither button's label is supplied, the div containing the HR and buttons remains hidden.Alt+C
, and the "Close" button byEscape
.Alt+C
is indicated to the user via an accessibility label.browseableMessage
is called on a secure screen.browseableMessage
, this will return immediately, instead of stranding the user in a blank window with no obvious close mechanism.scriptable.dictionary
, instructing the JS to allow the message to be treated as HTML.Testing strategy:
Tested using mainly the report link destination window, and a few other core windows.
Known issues with pull request:
Alt+C
key can not currently be changed to another key by keymap translators, because of the esoteric way javascript maps keys to known character sets. I continue to research this but didn't want to delay the PR for it.Code Review Checklist:
Summary by CodeRabbit
New Features
Documentation