Skip to content

Refactored ContentAlignmentEditor. It should work as DockEditor#7831

Merged
Tanya-Solyanik merged 1 commit intodotnet:mainfrom
NikitaSemenovAkvelon:Issue_7800-Refactoring_ContentAligmentEditor
Oct 5, 2022
Merged

Refactored ContentAlignmentEditor. It should work as DockEditor#7831
Tanya-Solyanik merged 1 commit intodotnet:mainfrom
NikitaSemenovAkvelon:Issue_7800-Refactoring_ContentAligmentEditor

Conversation

@NikitaSemenovAkvelon
Copy link
Copy Markdown
Contributor

@NikitaSemenovAkvelon NikitaSemenovAkvelon commented Sep 23, 2022

Fixes #7800

Proposed changes

  • Refactored ContentAlignmentEditor.ContentUI and DockEditor.DockUI.
  • Moved common logic to SelectionPanelBase.
  • Reworked ContentAlignmentEditor.ContentUI, currently it works in the same way as DockEditor.DockUI.

Customer Impact

  • Narrator announcements will be more transparent for users.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

pWY8lJHqQ6

ImageAlign, 10 of 20, expanded,
Expanded
Alignment Picker, Middle Center, radio button, selected,
Middle Center, radio button, non-selected,
Middle Right, radio button, selected,
Middle Right, radio button, non-selected,
Bottom Left, radio button, selected,
Bottom Left, radio button, non-selected,
Bottom Middle, radio button, selected,
Bottom Middle, radio button, non-selected,
Bottom Right, radio button, selected,
Bottom Right, radio button, non-selected,
Middle Right, radio button, selected,
Middle Right, radio button, non-selected,
Middle Center, radio button, selected,
ImageAlign, 10 of 20, collapsed,
MiddleCenter selected.

After

n6awzJaNjX

ImageAlign, 10 of 20, expanded,
Expanded
Alignment Picker, Middle Center, radio button, selected,
Middle Right, radio button, non-selected,
Bottom Left, radio button, non-selected,
Bottom Middle, radio button, non-selected,
Middle Center, radio button, selected,
Top Center, radio button, non-selected,
ImageAlign, 10 of 20, collapsed,
Open, button,
Open, button,
Expanded
Alignment Picker, Top Center, radio button, selected,
Middle Center, radio button, non-selected,
Bottom Middle, radio button, non-selected,
ImageAlign, 10 of 20, collapsed,

Test methodology

  • Manually
  • Accessibility tools
  • CTI

Accessibility testing

  • Narrator
  • Inspect

Test environment(s)

.NET SDK:
Version: 8.0.100-alpha.1.22423.9
Commit: b9635390c8

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621

Microsoft Reviewers: Open in CodeFlow

Copy link
Copy Markdown
Contributor

@dmitrii-drobotov dmitrii-drobotov left a comment

Choose a reason for hiding this comment

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

Nice refactoring!

Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
@Tanya-Solyanik
Copy link
Copy Markdown
Contributor

Build failure:

(NETCORE_ENGINEERING_TELEMETRY=NativeToolsBootstrap) Unable to find directory for cmake 3.21.0; please make sure the tool is installed on this image.

@dreddy-work
Copy link
Copy Markdown
Member

dreddy-work commented Sep 23, 2022 via email

Copy link
Copy Markdown
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Looks good, I added some nits. Please send to testing.

Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
Comment thread src/System.Windows.Forms.Design/src/System/Drawing/Design/SelectionPanelBase.cs Outdated
@Tanya-Solyanik Tanya-Solyanik added waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) waiting-author-feedback The team requires more information from the author labels Sep 23, 2022
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Sep 26, 2022
@NikitaSemenovAkvelon NikitaSemenovAkvelon force-pushed the Issue_7800-Refactoring_ContentAligmentEditor branch from ea70fa4 to f67ac24 Compare September 26, 2022 06:21
Copy link
Copy Markdown
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Please see my comment to confirm that Focus event is raised.

@Tanya-Solyanik Tanya-Solyanik added the waiting-author-feedback The team requires more information from the author label Sep 27, 2022
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Sep 27, 2022
@NikitaSemenovAkvelon NikitaSemenovAkvelon force-pushed the Issue_7800-Refactoring_ContentAligmentEditor branch from f67ac24 to b206590 Compare September 27, 2022 11:23
Tanya-Solyanik
Tanya-Solyanik previously approved these changes Sep 28, 2022
Copy link
Copy Markdown
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Looks good

/// Control we use to provide the content alignment UI.
/// </summary>
private class ContentUI : Control
private class ContentUI : SelectionPanelBase
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this inherited from anywhere internally? Maybe mark it as sealed if not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. It makes sense in this case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@RussKie Should this have been picked up by the analyzer?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I vaguely remember there were discussions in dotnet/runtime about creating an analyzer for this, but I don't know whether this has been done and whether this analyzer is available now. We can certainly enable the analyzer, if it's now available.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, thank you.

We can certainly turn it on, though it doesn't appear to be documented yet. https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812 is another one to consider turning on.
It could be great to turn these on before the change to confirm.

The configs are stored here: https://github.com/dotnet/winforms/blob/main/eng/CodeAnalysis.src.globalconfig.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Created at #7879

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome, thank you!

/// User Interface for the DockEditor.
/// </summary>
private class DockUI : Control
private class DockUI : SelectionPanelBase
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here, not inherited mark as sealed.

@Olina-Zhang Olina-Zhang removed the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label Sep 29, 2022
@Olina-Zhang
Copy link
Copy Markdown
Member

Tested this PR fixing with no new issue found.

@Tanya-Solyanik Tanya-Solyanik added the waiting-author-feedback The team requires more information from the author label Sep 29, 2022
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Sep 30, 2022
@NikitaSemenovAkvelon NikitaSemenovAkvelon force-pushed the Issue_7800-Refactoring_ContentAligmentEditor branch from b206590 to d250500 Compare September 30, 2022 04:52
@Tanya-Solyanik Tanya-Solyanik merged commit 70364ba into dotnet:main Oct 5, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Oct 5, 2022
v-elnovikova pushed a commit to v-elnovikova/winforms that referenced this pull request Oct 18, 2022
…et#7831)

Changes:
Refactored ContentAlignmentEditor.ContentUI and DockEditor.DockUI.
Moved common logic to SelectionPanelBase.
Reworked ContentAlignmentEditor.ContentUI, currently it works in the same way as DockEditor.DockUI.

Customer Impact:
Narrator announcements will be more transparent for users.
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Narrator announces buttons inside ContentAligmentEditor incorrectly.

7 participants