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

#2020 expression editor allow for double click to add value #2021

Merged
merged 13 commits into from
Aug 12, 2024

Conversation

veenas1
Copy link
Contributor

@veenas1 veenas1 commented Jun 14, 2024

Fixes: #2020

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@@ -184,6 +176,8 @@
}

.properties-vt-row-selected {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthoward366 Added style here to retain the style until the user click somewhere else. :focus & :active , is not retaining the style after clicking, and shows at the clicking moment only.
Please let me know what looks best.

@matthoward366
Copy link
Member

Overall looks good. Checking with design on some of the interactions.

Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
@veenas1 veenas1 force-pushed the virtualized-table-double-click branch from 9334dd5 to dd7ebdc Compare June 25, 2024 05:13
@matthoward366
Copy link
Member

matthoward366 commented Jun 25, 2024

Keeping the cell active even after double clicking seems wrong. I chatting with design about this and this should only be there while active. After the single or double click action is done it reverts back to the row selected state.

Screenshot 2024-06-25 at 1 45 25 PM

For the mouse pointer it should be over the entire row.

@veenas1
Copy link
Contributor Author

veenas1 commented Jun 26, 2024

@matthoward366 Does it mean we can highlight the row(with the blue border) on single-click as well?

@matthoward366
Copy link
Member

@matthoward366 Does it mean we can highlight the row(with the blue border) on single-click as well?

single-click would highlight the row when clicking the + button. The rest of the row requires double click.

Signed-off-by: Veena S <Veena.S1@ibm.com>
border: 1px solid $button-primary;
background-color: $background-active;
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthoward366 I tried to add :focus and :active here. .properties-vt-row-doubleClick class is being detected, but the style of :focus and :active not working.

@@ -56,6 +56,9 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
this.fields = this._makeDatasetFields(props.controller.getDatasetMetadataFields(), props.controller.getExpressionInfo().fields);
this.resources = get(props.controller.getExpressionInfo(), "resources", {});
this.state = {
doubleClickedFieldRow: [],
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to manage double click different from single click?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthoward366 properties-vt-row-doubleClick class was added for styling the double clicked row(a blue border) which is not required for single click.
For activating this class, I have used doubleClickedFieldRow from props.
Couldn't rely on the doubleclick event alone, as single-clicking the + icon was supposed to act/look the same way as double-click

Copy link
Member

@matthoward366 matthoward366 left a comment

Choose a reason for hiding this comment

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

I would step back and really only handle the onRowDoubleClick and change the pointer. Possibly add focus for the row. I don't think we need to worry about the active state.

@@ -439,6 +444,7 @@ class VirtualizedTable extends React.Component {
className={classNames(className,
{ "properties-vt-row-selected": selectedRow },
{ "properties-vt-row-disabled": rowDisabled },
{ "properties-vt-row-doubleClick": this.getDoubleClickedRow()?.indexOf(rowData.rowKey) > -1 },
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

properties-vt-row-doubleClick class was added for styling the double clicked row(a blue border) which is not required for single click.

@@ -138,7 +138,16 @@
// ReadonlyTable with single row selection is non-interactive. Nothing should happen on hover
background-color: $layer-hover-01;
}

.properties-vt-row-doubleClick{
Copy link
Member

Choose a reason for hiding this comment

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

We should have row focus when a user tabs into the row but I don't think we need something special for double click. Also, active and focus are different things.

border-left: 4px solid $button-primary;
padding-left: 0;
&:not(.properties-vt-row-disabled):hover {
border-left: 4px solid $button-primary;
}
}
.properties-vt-row-doubleClick{
Copy link
Member

Choose a reason for hiding this comment

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

This seems like duplicate code.

@veenas1
Copy link
Contributor Author

veenas1 commented Jul 2, 2024

I would step back and really only handle the onRowDoubleClick and change the pointer. Possibly add focus for the row. I don't think we need to worry about the active state.

ok Matt, I would revert the code added for styling the double clicked row.

@matthoward366
Copy link
Member

@veenas1 let me know when the changes are done and I'll have another look.

Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
@veenas1
Copy link
Contributor Author

veenas1 commented Jul 3, 2024

@veenas1 let me know when the changes are done and I'll have another look.

@matthoward366 I have reverted all the changes added as part of styling double clicked row, the state props etc, also removed active style. The :focus is coming only on the + icon button

Copy link
Member

@matthoward366 matthoward366 left a comment

Choose a reason for hiding this comment

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

I'm seeing the wrong mouse pointer in places outside the expression builder. For example in the field picker the entire selected row has a pointer but it shouldn't since it's not clickable.

@@ -138,7 +138,10 @@
// ReadonlyTable with single row selection is non-interactive. Nothing should happen on hover
background-color: $layer-hover-01;
}

&:focus {
Copy link
Member

Choose a reason for hiding this comment

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

What is this for? This might need to go under expression builder only and not the default for all tables.

@@ -189,6 +192,7 @@
&:hover {
background-color: $layer-accent-hover-01;
}
cursor: pointer;
Copy link
Member

Choose a reason for hiding this comment

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

When does this show up? This might be specific to expression builder.

@@ -200,8 +204,13 @@
// Table rows
.properties-vt-row-class {
padding-left: 3px;
&:focus {
Copy link
Member

Choose a reason for hiding this comment

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

Same comments as above.

}
.properties-vt-row-selected {
cursor: pointer;
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link

sonarcloud bot commented Jul 30, 2024

@veenas1 veenas1 force-pushed the virtualized-table-double-click branch from 0757310 to b53bc7b Compare August 12, 2024 09:46
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
@veenas1
Copy link
Contributor Author

veenas1 commented Aug 12, 2024

@matthoward366 Updated the PR to apply changes only for expression builder's table.

@matthoward366 matthoward366 merged commit 8483035 into elyra-ai:main Aug 12, 2024
2 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.

In expression editor allow for double click to add value
2 participants