Skip to content

feat: show organization name in workspaces table #14547

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

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

Parkreiner
Copy link
Member

Closes #14278

Changes made

  • Added logic to show organization name when the showOrganization property from useDashboard is true
  • Added text labels for username and organization name to help remove UI ambiguity
  • Added small Storybook test to make sure that organization info is accessible
  • Made a slight tweak to the CSS for the AvatarData component to make sure that its line height can't inherently incorrectly

Screenshot 2024-09-03 at 3 49 25 PM

Comment on lines +284 to +294
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const accessibleTableCell = await canvas.findByRole("cell", {
// Need whitespace classes because different parts of the element
// are going in different spans, and Storybook doesn't consolidate
// these
name: /org\s?(?:anization)?\s?:\s?Limbus Co\./i,
});

expect(accessibleTableCell).toBeDefined();
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Just wanted to make sure that I understand the limitations around decorators: they're basically assumed to always be static values, right? There's no easy way to make a decorator re-render with a 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.

each "decorator" undergoes a small transformation to get turned into a component by storybook. there's no way to force a rerender from the outside, just like any other component. being a component tho, they can call hooks and have state, which is kind of non-obvious.

Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

only thing is that I'm wondering if we really even need the labels. curious what the rationale was.

Comment on lines 213 to 214
org
<span css={{ ...visuallyHidden }}>anization</span>:
Copy link
Member

@aslilac aslilac Sep 3, 2024

Choose a reason for hiding this comment

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

are screen readers going to handle this split well though? my gut feeling is they say "org anization" with some awful disconnected pronounciation

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried it with the built-in Mac screen reader, but (1) I think I was just assuming that any elements that are semantically inline elements wouldn't affect pronunciation, and (2) the Mac screen reader isn't even the most popular reader by a long shot

Let me change this just to be on the safe side

@@ -54,7 +54,7 @@ export const AvatarData: FC<AvatarDataProps> = ({
css={{
fontSize: 13,
color: theme.palette.text.secondary,
lineHeight: "150%",
lineHeight: 1.5,
Copy link
Member

Choose a reason for hiding this comment

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

ah the wonderful subtleties of css. so annoying that this actually means something different. 🙃

Copy link
Member Author

Choose a reason for hiding this comment

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

CSS is so silly sometimes

@Parkreiner
Copy link
Member Author

@aslilac Sorry I didn't get back to this yesterday, but now that I think about it, I think you're right, and that the labels are unnecessary

I guess my worry was that, as we keep cramming multiple values into single table cells, we still need a way to structure the information. Because the HTML spec basically assumes that table cells will basically be like database columns – no more than one value per cell. So anytime we diverge from that, we can't assume that we'll have accessible info just because we're using the correct baseline semantics. I think I'm also just a bit skittish about multiple unlabeled values in general

I still think the labels are good for screen readers, but I do think it's overkill for sighted users. Let me switch things around, which should also make it easier to maintain on our end

@Parkreiner Parkreiner changed the title feat: show organization name in workspaces table based on dashboard settings feat: show organization name in workspaces table Sep 5, 2024
@Parkreiner Parkreiner merged commit c249174 into main Sep 5, 2024
30 checks passed
@Parkreiner Parkreiner deleted the mes/orgs-table-update branch September 5, 2024 16:32
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⭐ Add organization context to the workspaces table
2 participants