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

Bug 1830004: Add listener for keys in search page #5248

Merged
merged 1 commit into from May 7, 2020

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented Apr 30, 2020

Scrshots:
Screenshot from 2020-04-30 22-57-26
Screenshot from 2020-04-30 22-57-21

Mobile view:
Screenshot from 2020-04-30 21-56-17
/assign @spadgett

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Thanks, @bipuladh. This will need a Bugzilla to fix in 4.5.

@@ -83,7 +86,7 @@ const AutocompleteInput: React.FC<AutocompleteInputProps> = (props) => {
ref={textInputRef}
/>
<span className="form-control-feedback form-control-feedback--keyboard-hint">
<kbd>/</kbd>
<kbd>{!isActive ? `/` : 'Esc'}</kbd>
Copy link
Member

Choose a reason for hiding this comment

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

I think this change is a bit more confusing than helpful. We're overloading what the hint means. Previously it always meant focus this element, now it means different things depending on the state. I prefer the previous behavior of just removing the hint on focus.

Copy link
Member

Choose a reason for hiding this comment

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

I notice we're no longer removing the / keyboard hint in other places when the input is focused. That looks like a bug.

Copy link
Contributor Author

@bipuladh bipuladh Apr 30, 2020

Choose a reason for hiding this comment

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

Oh okay. I will remove the Esc. And yes we were missing on the hiding part. I realized while writing this.

Copy link
Member

Choose a reason for hiding this comment

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

@bipuladh I added the hiding back in #5252

Comment on lines 63 to 62
.co-query-filter:focus + .form-control-feedback--keyboard-hint {
right: 10px;
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing this change isn't needed if we remove the Esc hint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

Comment on lines 11 to 14
const textInputKeyHandler = {
Escape: KeyEventModes.HIDE,
'/': KeyEventModes.FOCUS,
};
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a common component instead of repeating it in multiple places? That way we consistently have the same keybindings and behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move it to shared.

@bipuladh bipuladh changed the title Add listener for keys in search page Bug 1830004: Add listener for keys in search page Apr 30, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label Apr 30, 2020
@openshift-ci-robot
Copy link
Contributor

@bipuladh: This pull request references Bugzilla bug 1830004, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1830004: Add listener for keys in search page

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 30, 2020
@bipuladh bipuladh requested a review from spadgett April 30, 2020 17:26
@openshift-ci-robot
Copy link
Contributor

@bipuladh: This pull request references Bugzilla bug 1830004, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1830004: Add listener for keys in search page

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bipuladh
Copy link
Contributor Author

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 30, 2020
@bipuladh
Copy link
Contributor Author

/retest

@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/monitoring Related to monitoring labels May 4, 2020
@bipuladh bipuladh force-pushed the search-listener branch 3 times, most recently from f4347c7 to 3b5226e Compare May 4, 2020 14:17
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Thanks, nice to see so much code removed switching to a common component 👍

frontend/public/components/factory/list-page.jsx Outdated Show resolved Hide resolved
frontend/public/components/RBAC/role.jsx Outdated Show resolved Hide resolved
frontend/public/components/events.jsx Outdated Show resolved Hide resolved
frontend/public/components/monitoring.tsx Outdated Show resolved Hide resolved
frontend/public/style/_forms.scss Outdated Show resolved Hide resolved
frontend/public/components/factory/list-page.jsx Outdated Show resolved Hide resolved
frontend/public/components/factory/list-page.jsx Outdated Show resolved Hide resolved
frontend/public/style/_forms.scss Outdated Show resolved Hide resolved
@bipuladh bipuladh force-pushed the search-listener branch 2 times, most recently from c0f4e17 to 8d38e86 Compare May 5, 2020 16:22
@bipuladh bipuladh requested a review from spadgett May 5, 2020 16:28
@spadgett
Copy link
Member

spadgett commented May 6, 2020

@bipuladh Looks like you introduced a test failure.

Comment on lines 29 to 30
expect(input.props().onChange).toEqual(onChange);
expect(input.props().onChange()).toEqual(((e) => onChange(e))());
Copy link
Member

Choose a reason for hiding this comment

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

Is this change still needed? I thought we went back to onChange={onChange}.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not anymore.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2020
@spadgett
Copy link
Member

spadgett commented May 6, 2020

Thanks @bipuladh, looks good 👍

@spadgett spadgett added this to the v4.5 milestone May 6, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e94e491 into openshift:master May 7, 2020
@openshift-ci-robot
Copy link
Contributor

@bipuladh: All pull requests linked via external trackers have merged: openshift/console#5248. Bugzilla bug 1830004 has been moved to the MODIFIED state.

In response to this:

Bug 1830004: Add listener for keys in search page

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/dev-console Related to dev-console component/monitoring Related to monitoring component/shared Related to console-shared kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants