Skip to content
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

Add the 'Add new' button to the Actions page #10550

Merged
3 commits merged into from
Jul 7, 2021

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Jul 2, 2021

Summary of the Pull Request

This adds the "add new" button to the actions page. It build on the work of #10220 by basically just adding a new list item to the top of the key binding list.

This also makes it so that if you click the "accept changes" button when you have an invalid key chord, we don't do anything.

References

#6900 - Actions page Epic
#9427 - Actions page design doc
#10220 - Actions page PR - set action

Detailed Description of the Pull Request / Additional comments

  • ModifyKeyBindingEventArgs is used to introduce new key bindings. We just ignore OldKeys and OldActionName because both didn't exist before.
  • IsNewlyAdded tracks if this is an action that was added, but has not been confirmed to add to the settings model.
  • CancelChanges() is directly bound to the cancel button. This allows us to delete the key binding when it's clicked on a "newly added" action.

Validation Steps Performed

  • Cancel:
    • Deletes the action (because it doesn't truly exist until you confirm changes)
  • Accept:
    • Adds the new action.
    • If you attempt to edit it, the delete button is back.
  • Add Action:
    • Delete button should not be visible (redundant with 'Cancel')
    • Action should be initialized to a value
    • Key chord should be empty
    • Cannot add another action if a newly added action exists
  • Keyboard interaction:
    • escape --> cancel
    • enter --> accept
  • Accessibility:
    • "add new" button has a name
  • Interaction with other key bindings:
    • editing another action --> delete the "newly added" action (it hasn't been added yet)
    • only one action can be edited at a time

@carlos-zamora carlos-zamora added Product-Terminal The new Windows Terminal. Area-Settings UI Anything specific to the SUI labels Jul 2, 2021
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/actions-page/add-action branch from a543625 to 718b6b2 Compare July 2, 2021 22:17
Base automatically changed from dev/cazamor/actions-page/change-action to main July 2, 2021 22:35
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/actions-page/add-action branch from 718b6b2 to b1209ae Compare July 2, 2021 22:36
src/cascadia/TerminalSettingsEditor/Actions.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/Actions.h Outdated Show resolved Hide resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 6, 2021
Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

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

Much clearer. Thanks. Looks good.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

okay i'm cool with this

@@ -1154,4 +1154,8 @@
<value>Edit</value>
<comment>Text label for a button that can be used to begin making changes to a key binding entry.</comment>
</data>
<data name="Actions_AddNewTextBlock.Text" xml:space="preserve">
<value>Add new</value>
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this should be "Add new..."? eh, maybe not though. idc.

KeyChordSerialization::FromString(newKeyChordText), // NewKeys: Attempt to convert the provided key chord text
_IsNewlyAdded ? hstring{} : _CurrentAction, // OldAction
unbox_value<hstring>(_ProposedAction)) }; //
_ModifyKeyBindingRequestedHandlers(*this, *args);
Copy link
Member

Choose a reason for hiding this comment

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

note: this is handled in Actions::_ViewModelModifyKeyBindingHandler

@carlos-zamora carlos-zamora added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 7, 2021
@ghost
Copy link

ghost commented Jul 7, 2021

Hello @carlos-zamora!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 192d6de into main Jul 7, 2021
@ghost ghost deleted the dev/cazamor/actions-page/add-action branch July 7, 2021 23:43
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal Preview v1.10.1933.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Oct 20, 2021

🎉Windows Terminal v1.11.2921.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI AutoMerge Marked for automatic merge by the bot when requirements are met Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants