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 1807204: Update cursor to show drop status over targets #4486
Bug 1807204: Update cursor to show drop status over targets #4486
Conversation
@jeff-phillips-18: This pull request references Bugzilla bug 1807204, 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. In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! @Veethika can you take a look as well?
/cherry-pick release-4.4 |
@jeff-phillips-18: once the present PR merges, I will cherry-pick it on top of release-4.4 in a new PR and assign it to you. In response to this:
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. |
React.useEffect(() => { | ||
setHover(false); | ||
clearTimeout(unsetHandle.current); | ||
unsetHandle.current = window.setTimeout(() => setHover(true), 2000); | ||
return () => { | ||
clearTimeout(unsetHandle.current); | ||
}; | ||
}, [endPoint.x, endPoint.y]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better off going directly into the DefaultCreateConnector
.
In dev-console we can supply our own prop to renderConnector
which uses DefaultCreateConnector
to supply the custom message.
content="Move sink to service" | ||
trigger="manual" | ||
isVisible={dropTarget && canDrop} | ||
tippyProps={{ duration: 0, delay: 0 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm the behavior with UX? 0 delay will bring up tooltips immediately as you hover your mouse over an intermediate node.
Didn't we try avoid this kind of behavior for label truncation by having a small delay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX spec specifies For connectors, the tooltip should appear the moment the user hovers over a valid drop target.
collect: (monitor) => { | ||
const dragEditInProgress = | ||
monitor.isDragging() && editOperations.includes(monitor.getOperation()); | ||
const dropHints = monitor.getDropHints() || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should change getDropHints
to always return an array (string[]
)?
41c16e9
to
af1fa27
Compare
Updated per comments. Removed the In order to move out the dev-console specific hover treatment for the create connector, I had to refactor a bunch to make the default connector a component rather than a function call that returns a component. |
choices: (ConnectorChoice | React.ReactElement)[]; | ||
}; | ||
|
||
export const CreateConnectorWidget: React.FC<CreateConnectorWidgetProps> = observer((props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer a single default export for component files.
export const CREATE_CONNECTOR_OPERATION = 'createconnector'; | ||
export const CREATE_CONNECTOR_DROP_TYPE = '#createConnector#'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old code but:
export const CREATE_CONNECTOR_OPERATION = 'createconnector'; | |
export const CREATE_CONNECTOR_DROP_TYPE = '#createConnector#'; | |
export const CREATE_CONNECTOR_OPERATION = '#createconnector#'; | |
export const CREATE_CONNECTOR_DROP_TYPE = '#createConnector#'; |
export type CreateConnectorRendererProps = { | ||
startPoint: Point; | ||
endPoint: Point; | ||
dragging: boolean; | ||
hints: string[] | undefined; | ||
tipContents?: React.ReactNode; | ||
className?: string; | ||
}; | ||
|
||
export type CreateConnectorRenderer = React.ComponentType<CreateConnectorRendererProps>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct. The only required props that are expected of a component used in withCreateConnector
are:
startPoint: Point,
endPoint: Point,
hints: string[] | undefined,
|
||
const DefaultCreateConnector: React.FC<DefaultCreateConnectorProps> = ({ | ||
const DefaultCreateConnector: CreateConnectorRenderer = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need a new prop type that includes support for tipContents
and className
.
@@ -5,3 +5,5 @@ export { default as ConnectorArrow } from './ConnectorArrow'; | |||
export { default as EdgeConnectorArrow } from './EdgeConnectorArrow'; | |||
export { default as GraphComponent } from './GraphComponent'; | |||
export { default as VisualizationSurface } from './VisualizationSurface'; | |||
export * from './CreateConnectorWidget'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not expose contents of CreateConnectorWidget
as API. This is for internal use only to withCreateConnector
. If needed, re-export any specific types from withCreateConnector
.
@jeff-phillips-18: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/bugzilla refresh The requirements for Bugzilla bugs have changed, recalculating validity. |
@openshift-bot: This pull request references Bugzilla bug 1807204, which is valid. 3 validation(s) were run on this bug
In response to this:
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. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, jeff-phillips-18, serenamarie125 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 |
@jeff-phillips-18: All pull requests linked via external trackers have merged. Bugzilla bug 1807204 has been moved to the MODIFIED state. In response to this:
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. |
@jeff-phillips-18: new pull request created: #4525 In response to this:
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. |
Fixes:
https://issues.redhat.com/browse/ODC-3028
Analysis / Root cause:
The cursor was not updated during drag operations to indicate drop status.
Solution Description:
Modified the cursor to:
** Sample Screen Shots **
Browser conformance:
cc @openshift/team-devconsole-ux
/kind bug