Skip to content

related to issue 10466: add short cut ↑, ↓, ←, → to demo console #13513

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Epica3055
Copy link
Member

@Epica3055 Epica3055 commented May 23, 2025

related to #10466

Proposed changes

  • Add ↑, ↓, ←, → shortcut
  • Some minor code refactoring

After

pull_13513

Test methodology

manually

Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.59837%. Comparing base (b0b0e10) to head (f3e4a5c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13513         +/-   ##
===================================================
+ Coverage   76.59791%   76.59837%   +0.00046%     
===================================================
  Files           3230        3230                 
  Lines         639165      639165                 
  Branches       47297       47297                 
===================================================
+ Hits          489587      489590          +3     
+ Misses        146007      145999          -8     
- Partials        3571        3576          +5     
Flag Coverage Δ
Debug 76.59837% <ø> (+0.00046%) ⬆️
integration 18.79061% <ø> (+0.01225%) ⬆️
production 51.00521% <ø> (+0.00104%) ⬆️
test 97.40411% <ø> (ø)
unit 48.39886% <ø> (+0.01326%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeafShi1 LeafShi1 requested a review from Copilot May 23, 2025 10:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds arrow key move shortcuts to the demo console’s design surface and cleans up the initialization loop.

  • Extend the DoAction mapping to include KEYMOVE↑/↓/←/→ commands
  • Hook arrow key Up/Down/Left/Right in MainForm to invoke move actions
  • Refactor InitFormDesigner to use a single loop and unified variable naming

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/test/integration/DesignSurface/DesignSurfaceExt/DesignSurfaceExt.cs Added KEYMOVEUP, KEYMOVEDOWN, KEYMOVELEFT, KEYMOVERIGHT to the DoAction switch
src/test/integration/DesignSurface/DemoConsole/MainForm.cs Consolidated two loops into one, renamed isurf to designSurfaceExtended, and wired up KeyUp handlers for arrow keys
Comments suppressed due to low confidence (1)

src/test/integration/DesignSurface/DesignSurfaceExt/DesignSurfaceExt.cs:353

  • [nitpick] No automated tests verify the new arrow-key commands in DoAction. Add unit or integration tests to ensure KEYMOVEUP, KEYMOVEDOWN, KEYMOVELEFT, and KEYMOVERIGHT are correctly handled.
"KEYMOVEUP" => MenuCommands.KeyMoveUp,

Comment on lines 42 to 45
_selectionService = (ISelectionService)(designSurfaceExtended.GetIDesignerHost().GetService(typeof(ISelectionService)));
if (_selectionService is not null)
{
_selectionService.SelectionChanged += OnSelectionChanged;
Copy link
Preview

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

Reassigning the single _selectionService field inside the loop will overwrite previous services and only keep the last one. Consider storing each surface’s ISelectionService separately or subscribing without relying on a single field.

Suggested change
_selectionService = (ISelectionService)(designSurfaceExtended.GetIDesignerHost().GetService(typeof(ISelectionService)));
if (_selectionService is not null)
{
_selectionService.SelectionChanged += OnSelectionChanged;
var selectionService = (ISelectionService)(designSurfaceExtended.GetIDesignerHost().GetService(typeof(ISelectionService)));
if (selectionService is not null)
{
_selectionServices[i] = selectionService;
selectionService.SelectionChanged += OnSelectionChanged;

Copilot uses AI. Check for mistakes.

LeafShi1
LeafShi1 previously approved these changes May 26, 2025
Copy link
Member

@LeafShi1 LeafShi1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

All LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants