Add showTechnicalFormattingAtReview global command, with RGB color info (#8674)#12372
Add showTechnicalFormattingAtReview global command, with RGB color info (#8674)#12372JulienCochuyt wants to merge 1 commit into
showTechnicalFormattingAtReview global command, with RGB color info (#8674)#12372Conversation
See test results for failed build of commit b0f6fb276b |
See test results for failed build of commit 5f2ca71d0d |
|
If I read correctly, test_boundingRectFromOffsetAtBottom seems to fail in AppVeyor but passes locally. |
|
We have failures in a bunch of system tests, it seems. |
See test results for failed build of commit 5f2ca71d0d |
See test results for failed build of commit 4f76b663ad |
…info (nvaccess#8674) Co-authored by: Leonard de Ruijter <leonardder@users.noreply.github.com>
8f53259 to
f718b61
Compare
See test results for failed build of commit 5aa188ba18 |
michaelDCurran
left a comment
There was a problem hiding this comment.
I would much prefer to see the color info be simply included in the NVDA+f1 dev info. Note that the NVDA+f1 dev info script already acts upon the navigator object, so extending it to alsoinclude some info about the current review position seems logical enough.
This then avoids adding an extra script for just one bit of extra info, and avoids extra logic in speech.
Another alternative could be to have an Advanced setting that allows the user to configure if NvDA exposes raw color info when available where ever it speaks or displays color names. Format changes, and formatting info script as examples.
I think I still prefer my first suggestion though.
|
@michaelDCurran I think the dev info is for a different type of user. I'd differentiate between NVDA developers, for whom reading the log / devInfo output is fine, and general developers who happen to use NVDA. This second group want access to more technical information, but not to have to sift through all of the noise of NVDA specific information. I think this more appropriate as a command. I struggle to believe anyone would want to always have the color value reported, but there are occasions for developers where you want only the color value reported. I haven't looked at the implementation yet, and perhaps it is too complicated and just belongs in and addon. |
| f"{color.name}" | ||
| f" (RGB: {color.red}, {color.green}, {color.blue}" | ||
| f" / #{color.red:02x}{color.green:02x}{color.blue:02x})" |
There was a problem hiding this comment.
UX feedback: I hadn't thought about cases like _("{color1} to {color2}") which using this as the replacement will be very long. Perhaps it is best to have a single color format reported. Developers should be able to convert themselves. I'd personally choose Hex, since it is shorter.
From a code design, I really don't like the idea of introducing another parameter. This should be two functions sharing a common interface. Then use something like the strategy pattern with those two implementations. Ideally, nothing in getFormatFieldSpeech needs to know, in reality we might need to make a change to getFormatFieldSpeech to enable a mechanism like this. The upside is, if we do it right we can start to split up getFormatFieldSpeech into a series of formatters.
|
@feerrenrut, @michaelDCurran thoughts on adding a new settings panel in document formatting for this? I propose something like Then, add a We can just use the new function in the custom command to begin with, as the rest of the code is dependent on |
|
@seanbudd I haven't considered the implications of the technical details you suggested, but I think this will have to go down the UI path you recommend, i.e.
Swapping to a preferred technical color description will work for any of the in-line color reporting EG:
I still think there a place for a command (such as |
|
I am a bit concerned with adding a technical option in the formatting settings panel which has already a lot of options; this is also in contradiction with the reason why #8674 was re-opened and with #8674 (comment). There are two requirements that are both legitimate and that are not totally compatible here:
My initial preference was to have this eature in an add-on but this was already discussed in #8674 and it is not the direction we are taking now. |
|
I'm ok with this starting as an advanced option. Users of the advanced settings panel should be more aware of options migrating later on, this makes it easier for us to consolidate the color options later. Thinking about the document formatting panel in settings, these are probably more specific than configuration we are talking about. I think the intention is:
|
|
A few general thoughts:
|
|
It looks like this is stalled due to the fact that we cannot agree on a satisfying implementation. Would it be possible to someone from NV Access to take a look at the discussion including my proposal from the last comment and share their thoughts so that this work can be progressed? |
|
I tend to agree with @lukaszgo1 . We really don't need to over engineer this. We can just include the raw rgb after color names in the Show Formatting browsable message with NvDA+f twice. globalCommand's _reportFormattingHelper should be able to look for colors.RGB objects in the fetched format and change them into strings of |
|
This is marked as a draft, this should be followed up with @michaelDCurran design |
|
cc: @ABuffEr maybe you are interested in this work as well, not sure if @JulienCochuyt is still very active these days. |
|
Closing as abandoned |
Link to issue number:
Fixes #8674
Summary of the issue:
Developers and content authors often need to know the exact color of the text they review in more precise terms than the human-readable form commonly served to end users.
Description of how this pull request fixes the issue:
Add a
showTechnicalFormattingAtReviewglobal command to provide this information along with the rest of the formatting in a browsable message.Testing strategy:
Ran and manually tested from a source copy.
Known issues with pull request:
Change log entries:
New features
More technical information regarding the formatting of the text at the review position can now be obtained by pressing
NVDA+alt+shift+f. For now, it differs from the usual formatting information by providing the exact RGB values for foreground and background colors.Code Review Checklist: