changes magnifier types and function name for clarity#19882
changes magnifier types and function name for clarity#19882seanbudd merged 14 commits intonvaccess:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the magnifier configuration and type model to improve clarity and enable future magnifier mode work (e.g., fixed/docked/lens).
Changes:
- Renames magnifier config keys/functions to drop the “default” wording (e.g.,
getDefaultZoomLevel→getZoomLevel) and updates UI bindings accordingly. - Reworks magnifier geometry/type types (introduces
MagnifierParameters,Size,Coordinates, expandsMagnifierType). - Updates unit tests to align with the refactored APIs and fullscreen magnifier parameter calculation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_magnifier/test_magnifier.py | Updates baseline magnifier tests to reflect removed/abstracted position logic and type changes. |
| tests/unit/test_magnifier/test_fullscreenMagnifier.py | Updates fullscreen magnifier tests to use _getMagnifierParameters and explicit start behavior. |
| source/gui/settingsDialogs.py | Renames magnifier settings controls/config interactions and updates help IDs/labels. |
| source/config/configSpec.py | Renames magnifier config keys in the config spec (drops default* keys). |
| source/_magnifier/utils/types.py | Refactors magnifier-related types (parameters/size/coordinates/type/filter). |
| source/_magnifier/magnifier.py | Updates base magnifier to use renamed config getters and makes parameters computation abstract. |
| source/_magnifier/fullscreenMagnifier.py | Implements _getMagnifierParameters for fullscreen magnifier and adjusts lifecycle behavior. |
| source/_magnifier/config.py | Renames config accessor functions to match new key names and API names. |
| source/_magnifier/commands.py | Updates command messaging to use renamed config accessors. |
Comments suppressed due to low confidence (1)
source/_magnifier/utils/types.py:145
CoordinatesandFilterare defined twice in this module (e.g.,Coordinatesat ~22 and again at ~140;Filterat ~107 and again at ~171). The later definitions override the earlier ones and can lead to inconsistent types (e.g.,MagnifierParameters.filtervsconfig.getFilter()), plus it’s confusing for maintainers. Remove the duplicate definitions and keep a single canonicalCoordinates/Filter(and update references accordingly).
class MagnifierParameters(NamedTuple):
"""Named tuple representing the size and position of the magnifier"""
magnifierSize: Size
coordinates: Coordinates
filter: Filter
class Coordinates(NamedTuple):
"""Named tuple representing x and y coordinates"""
x: int
y: int
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi, Regarding the types, I have a question: could we use Thanks! |
|
|
|
Regarding |
|
I think we should be using Coordinates. |
|
I deleted the dulpicates with the merge of master |
seanbudd
left a comment
There was a problem hiding this comment.
Please ensure the diff doesn't contain any unnecessary changes, like moving classes around arbitrarily
|
I didn’t know about the quoted type annotation for forward references, which is why I moved the classes around. |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
|
Can you also please make sure to resolve conflicts from #19732 being merged? |
Link to issue number:
pre - #19473
parts of #19810
Summary of the issue:
#19810 was still to big so I focused on types changes and some functions renaming to go accordingly.
All these changes are nescessary for futur magnifier implementations.
Description of user facing changes:
"default"s have been removed so it can be seen in the doc
Description of developer facing changes:
replaced MagnifierPosition with MagnifierParameters for better handling of size, place and filter of the magnifier.
added a MagnifierType to handle magnifiers different types.
Description of development approach:
This work was split out from PR #19473 to make review and integration easier.
We first added the new structure: MagnifierParameters for size/position/filter, and MagnifierType for futur mode switching.
Testing strategy:
Unit
Known issues with pull request:
Code Review Checklist: