Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b0c873a
Add ability to report start of paragraphs in braille
nvdaes Jul 24, 2024
ea9d8ad
Reformat files
nvdaes Jul 25, 2024
b4becef
Improve translators comment
nvdaes Jul 25, 2024
6a3ee72
Fix help event for show paragrahph start in braille
nvdaes Jul 25, 2024
4586a5b
Reformat file
nvdaes Jul 25, 2024
646c35b
Improve documentation, suggested by coderabbitai
nvdaes Jul 25, 2024
3c5be80
Apply suggestions from code review
nvdaes Jul 25, 2024
a8cfc6e
Apply suggestion from code review
nvdaes Jul 25, 2024
a3f9061
Improve user guide, addressing review suggestions
nvdaes Jul 25, 2024
53c19b1
Apply suggestions from code review
nvdaes Jul 25, 2024
0d9400b
Use single space as indicator for paragraphs, to get a double space
nvdaes Jul 26, 2024
23c017a
Revert "Use single space as indicator for paragraphs, to get a double…
nvdaes Jul 27, 2024
990c306
Revert "Revert "Use single space as indicator for paragraphs, to get …
nvdaes Jul 27, 2024
37e2ded
Prevent that indicator of paragraphs is kipped if the word wrap optio…
nvdaes Jul 27, 2024
ccc751a
Reformat files
nvdaes Jul 27, 2024
c3ed9ef
Set window poswhen paragraph start indicator should start the raw tex…
nvdaes Jul 28, 2024
078d83c
Improve setting the start position of window when it should start wit…
nvdaes Jul 28, 2024
77383c6
Handle moving to previous window when word wrap is active
nvdaes Jul 28, 2024
fa0e88d
Improvement to prevent skipping paragraph start indicators when word …
nvdaes Jul 28, 2024
9650792
Address review: add type for event
nvdaes Jul 29, 2024
d2c220a
Merge remote-tracking branch 'origin/master' into brailleParagraphs
nvdaes Jul 29, 2024
da68eb8
Add ability to customize paragraph start indicator
nvdaes Jul 29, 2024
e6ade9c
Add ability to customize paragraph start and update user guide
nvdaes Jul 29, 2024
c09f806
Merge remote-tracking branch 'origin/master' into brailleParagraphs
nvdaes Jul 30, 2024
7a4b136
Expand explanation about a case where paragraph start indicator may n…
nvdaes Jul 30, 2024
c497e7b
Add explanatory comment
nvdaes Jul 30, 2024
7452253
Apply format
nvdaes Jul 30, 2024
44c0aac
Add combo box with double space and pillcrow for paragraph start markers
nvdaes Jul 30, 2024
367b849
Update documentation
nvdaes Jul 30, 2024
a57cda1
Apply suggestions from code review
nvdaes Jul 31, 2024
c473f76
Address review: apply standars to user guide
nvdaes Jul 31, 2024
ff00e8c
Merge remote-tracking branch 'origin/master' into brailleParagraphs
nvdaes Jul 31, 2024
7d17001
Merge branch 'master' into brailleParagraphs
seanbudd Aug 1, 2024
1310ffd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2024
b80005d
Remove accidentally committed file
nvdaes Aug 1, 2024
e1d6241
Reset source/speech/commands.py to master, since it's not related to …
nvdaes Aug 1, 2024
40b6ebf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2024
9c5d601
Apply suggestions from code review
nvdaes Aug 1, 2024
f7a5229
Apply suggestions from code review
nvdaes Aug 1, 2024
16de62c
Update source/config/configSpec.py
nvdaes Aug 1, 2024
955a6be
Use paragraph start marker with integer value in config
nvdaes Aug 1, 2024
cc84855
Pre-commit autofix
pre-commit-ci[bot] Aug 1, 2024
3c0ec10
Fix for paragraphStartMarker
nvdaes Aug 1, 2024
69ba267
Pre-commit autofix
pre-commit-ci[bot] Aug 1, 2024
5a7e57e
Merge branch 'master' into brailleParagraphs
nvdaes Aug 1, 2024
a6c1215
Fix paragraphStartMarker in function
nvdaes Aug 1, 2024
a5d351d
Make PILCROW translatable adding a getParagraphStartMarker function i…
nvdaes Aug 1, 2024
43f9ee4
Update source/braille.py
nvdaes Aug 2, 2024
36e2797
Apply review suggestions
nvdaes Aug 2, 2024
f3109bc
Merge remote-tracking branch 'origin/master' into brailleParagraphs
nvdaes Aug 2, 2024
701ba49
Pre-commit auto-fix
pre-commit-ci[bot] Aug 2, 2024
a46c3cd
Pre-commit auto-fix
pre-commit-ci[bot] Aug 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/braille.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@
# used to separate chunks of text when programmatically joined
TEXT_SEPARATOR = " "

# Indicator at the start of paragraphs
PARAGRAPH_START = " "

#: Identifier for a focus context presentation setting that
#: only shows as much as possible focus context information when the context has changed.
CONTEXTPRES_CHANGEDCONTEXT = "changedContext"
Expand Down Expand Up @@ -1083,6 +1086,9 @@ def getFormatFieldBraille(field, fieldCache, isAtStart, formatConfig):
"""
textList = []
if isAtStart:
brailleConfig = config.conf["braille"]
if brailleConfig["readByParagraph"] and brailleConfig["showParagraphStart"]:
textList.append(PARAGRAPH_START)
if formatConfig["reportLineNumber"]:
lineNumber = field.get("line-number")
if lineNumber:
Expand Down
1 change: 1 addition & 0 deletions source/config/configSpec.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
reviewRoutingMovesSystemCaret = featureFlag(\
optionsEnum="ReviewRoutingMovesSystemCaretFlag", behaviorOfDefault="NEVER")
readByParagraph = boolean(default=false)
showParagraphStart = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="disabled")
wordWrap = boolean(default=true)
unicodeNormalization = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="disabled")
focusContextPresentation = option("changedContext", "fill", "scroll", default="changedContext")
Expand Down
18 changes: 18 additions & 0 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4363,8 +4363,22 @@ def makeSettings(self, settingsSizer):
wx.CheckBox(self.followCursorGroupBox, label=readByParagraphText),
)
self.bindHelpEvent("BrailleSettingsReadByParagraph", self.readByParagraphCheckBox)
self.readByParagraphCheckBox.Bind(wx.EVT_CHECKBOX, self.onReadByParagraphChange)
self.readByParagraphCheckBox.Value = config.conf["braille"]["readByParagraph"]

self.showParagraphStartCombo: nvdaControls.FeatureFlagCombo = followCursorGroupHelper.addLabeledControl(
labelText=_(
# Translators: This is a label for a combo-box in the Braille settings panel to select if start of paragraphs will be reported in braille.
"Show para&graph start",
),
wxCtrlClass=nvdaControls.FeatureFlagCombo,
keyPath=["braille", "showParagraphStart"],
conf=config.conf,
)
self.bindHelpEvent("BrailleSettingsShowParagraphStart", self.showParagraphStartCombo)
Comment thread
nvdaes marked this conversation as resolved.
Resolved
if not self.readByParagraphCheckBox.GetValue():
self.showParagraphStartCombo.Disable()

# Translators: The label for a setting in braille settings to select how the context for the focus object should be presented on a braille display.
focusContextPresentationLabelText = _("Focus context presentation:")
self.focusContextPresentationValues = [x[0] for x in braille.focusContextPresentations]
Expand Down Expand Up @@ -4459,6 +4473,7 @@ def onSave(self):
braille.handler.setTether(tetherChoice, auto=False)
self.brailleReviewRoutingMovesSystemCaretCombo.saveCurrentValueToConf()
config.conf["braille"]["readByParagraph"] = self.readByParagraphCheckBox.Value
self.showParagraphStartCombo.saveCurrentValueToConf()
config.conf["braille"]["wordWrap"] = self.wordWrapCheckBox.Value
self.unicodeNormalizationCombo.saveCurrentValueToConf()
config.conf["braille"]["focusContextPresentation"] = self.focusContextPresentationValues[
Expand All @@ -4484,6 +4499,9 @@ def onTetherToChange(self, evt: wx.CommandEvent) -> None:
tetherChoice = [x.value for x in TetherTo][evt.GetSelection()]
self.brailleReviewRoutingMovesSystemCaretCombo.Enable(tetherChoice != TetherTo.FOCUS.value)

def onReadByParagraphChange(self, evt):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a type for event

self.showParagraphStartCombo.Enable(evt.IsChecked())

def _onModeChange(self, evt: wx.CommandEvent):
self.followCursorGroupBox.Enable(not evt.GetSelection())

Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Enhanced Microsoft Word comment command: press twice to present comment content in browsable message. (#16800, @Cary-Rowen)
* Enhanced Microsoft Excel notes command: press twice to present notes content in browsable message. (#16878, @Cary-Rowen)
* NVDA can now be configured to report font attributes in speech and braille separately. (#16755)
* NVDA can now be configured to indicate the start of paragraphs in braille when the reading by paragraph option is enabled (#16895, @nvdaes)
Comment thread
nvdaes marked this conversation as resolved.
Resolved


### Bug Fixes
Expand Down
4 changes: 4 additions & 0 deletions user_docs/en/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,10 @@ This means that you do not have to scroll the display at the end of each line ev
This may allow for more fluent reading of large amounts of text.
It is disabled by default.

##### Show paragraphs start {#BrailleSettingsShowParagraphStart}
Comment thread
nvdaes marked this conversation as resolved.
Resolved

Comment thread
nvdaes marked this conversation as resolved.
Resolved
- If enabled and "Read by paragraph" is checked, two spaces will be displayed to indicate the start of a paragraph.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove leading dash
  • Link the "Read by paragraph" option
Suggested change
- If enabled and "Read by paragraph" is checked, two spaces will be displayed to indicate the start of a paragraph.
If enabled and "[Read by paragraph](#BrailleSettingsReadByParagraph)" is checked, two spaces will be displayed to indicate the start of a paragraph.

Moreover, it would be worth rephrasing this paragraph with a bit more details. But I am not familiar with "Read by paragraph" option and will not be able to test on a braille display before next week, so I won't be able to make a detailed suggestion.

Maybe something like the following (to be adapted and polished):
When "Read by paragraph" option is enabled, we face [issueToBeDescribed, e.g. difficulty to identify paragraph start].
Enabling this option enable to mitigate this issue adding two spaces at the beginning of paragraphs.


##### Avoid splitting words when possible {#BrailleSettingsWordWrap}

If this is enabled, a word which is too large to fit at the end of the braille display will not be split.
Expand Down