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

fix: focus indicators table elements #6

Merged
merged 3 commits into from
Dec 6, 2024
Merged

fix: focus indicators table elements #6

merged 3 commits into from
Dec 6, 2024

Conversation

abdul99ahad
Copy link
Contributor

@abdul99ahad abdul99ahad commented Nov 26, 2024

Related to camunda/camunda-modeler#4632

Proposed Changes

Previously, table elements lacked focus states. Since they are interactive elements, focus states have been added.Nov-26-2024 20-39-57

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@philippfromme
Copy link

Changing it to

td:has(.bio-vo-text-button:focus-visible) {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: -2px;
}

ensures that the outline will match the table cell

brave_Zgdk4Uvfh2

What do you think?

@abdul99ahad
Copy link
Contributor Author

Changing it to

td:has(.bio-vo-text-button:focus-visible) {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: -2px;
}

ensures that the outline will match the table cell

brave_Zgdk4Uvfh2 brave_Zgdk4Uvfh2

What do you think?

That's much better. Thanks. didn't know there's a way to do this

@philippfromme
Copy link

philippfromme commented Dec 2, 2024

@abdul99ahad It's a fairly new pseudo-class but supported by all major browsers.

@nikku
Copy link
Member

nikku commented Dec 2, 2024

@philippfromme I think it won't properly represent multiple selectable elements within the same cell. We already have that use case where a variable can have multiple origins.

So I'd not go down that route.

@philippfromme
Copy link

Is multiple selectable elements in a single table cell a pattern we want to support?

@barmac
Copy link
Member

barmac commented Dec 2, 2024

I'd like us to make it clear what elements we want to be focusable. @philippfromme's proposal makes it so only table cells can be focussed from the appearance point of view. However, as displayed in the top-comment example, it is not the cells but only certain elements in the cells which can have focus:
image
So there can be a cell with multiple focusable elements inside, but also a cell with no focusable contents.

As a side note, we could rename the Origin column to properly represent the aspect of supporting multiple places where the variable is written to. Origins sound awkward to me because I'd rather expect a single origin.

@barmac
Copy link
Member

barmac commented Dec 2, 2024

As a side note, we could rename the Origin column to properly represent the aspect of supporting multiple places where the variable is written to. Origins sound awkward to me because I'd rather expect a single origin.

This is scope creep, unrelated to PR ;)

@nikku
Copy link
Member

nikku commented Dec 2, 2024

Is multiple selectable elements in a single table cell a pattern we want to support?

Yes, because approved could be set automatically or via human intervention:

image

@abdul99ahad
Copy link
Contributor Author

@philippfromme I think it won't properly represent multiple selectable elements within the same cell. We already have that use case where a variable can have multiple origins.

Reverted to individual focusable table cells with improved focus alignment.
Dec-03-2024 22-03-31

@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review required labels Dec 4, 2024
@abdul99ahad abdul99ahad requested a review from nikku December 4, 2024 10:15
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review required and removed in progress Currently worked on labels Dec 4, 2024
@nikku
Copy link
Member

nikku commented Dec 6, 2024

I reworked the changes in this PR based of our previous discussions:

  • The buttons should not be buttons, but link like elements
  • So a link outline applies to them
  • That works properly in all cases, also where multiple origins are provided

CC @abdul99ahad @lmbateman


capture SIcLeZ_optimized

@nikku nikku merged commit b15ad96 into main Dec 6, 2024
4 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review required label Dec 6, 2024
@nikku nikku deleted the focus-indicators branch December 6, 2024 08:32
@nikku
Copy link
Member

nikku commented Dec 6, 2024

@abdul99ahad this is ready to be released and incorporated.

@abdul99ahad abdul99ahad mentioned this pull request Dec 9, 2024
4 tasks
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.

4 participants