Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

Purpose

Small PR for DYN-8893.

  • The "o" hotkey for ungrouping is now disabled when the group context menu search bar is focused.
  • Removed extra right margin that was causing group names to be cut off in some cases.

DYN-8893-SearchBar bug fix

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

  • The "o" hotkey for ungrouping is now disabled when the group context menu search bar is focused.
  • Removed extra right margin that was causing group names to be cut off in some cases.

Reviewers

@DynamoDS/eidos
@jasonstratton.
@zeusongit

FYIs

@dnenov
@achintyabhat

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8893


private void GroupContextMenu_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.O && Keyboard.Modifiers == System.Windows.Input.ModifierKeys.None)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we even have this condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to make sure the user has pressed only "O" and not something like "Ctrl+O".

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I mean why pressing O while context menu is visible should ungroup, but I guess that is unrelated to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did not look logical to me either, but that was the previous behavior and my aim was to replicate it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where did you see this before, that you tried to replicate? in the node context menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The group context menu.
Open Dynamo 3.5.2 (works down to al least 3.0.0), create a group, call the group context menu, pres "o" -> the group is ungrouped

@zeusongit zeusongit requested review from a team and Copilot July 11, 2025 17:28
Copy link
Contributor

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

This PR fixes two UI issues in the group context menu:

  • Disables the "O" hotkey for ungrouping when the in-canvas search bar is focused.
  • Adjusts the header grid’s column span to prevent group names from being cut off.
Comments suppressed due to low confidence (1)

src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs:744

  • Consider adding a UI/unit test to verify that the 'O' key no longer triggers ungrouping when the search bar is focused.
                if (searchBar != null && searchBar.IsKeyboardFocusWithin) return;

// Add ContentPresenter
var contentPresenterFactory = new FrameworkElementFactory(typeof(ContentPresenter));
contentPresenterFactory.SetValue(Grid.ColumnSpanProperty, 3);
contentPresenterFactory.SetValue(Grid.ColumnSpanProperty, 4);
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The hard-coded column span of 4 is a bit opaque; consider defining a named constant or adding a comment to explain why the span changed from 3 to 4.

Suggested change
contentPresenterFactory.SetValue(Grid.ColumnSpanProperty, 4);
// Use a named constant for column span to improve readability and maintainability
contentPresenterFactory.SetValue(Grid.ColumnSpanProperty, ContentPresenterColumnSpan);

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the current line is consistent with the rest of the code

@zeusongit zeusongit merged commit dbfc449 into DynamoDS:master Jul 11, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants