Skip to content

fix: give more room to lonely resource metadata items #9832

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 5 commits into from
Sep 25, 2023
Merged

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Sep 22, 2023

Closes #8887

Not perfect, but it's simple.

  • If there's only one metadata item, give it the entire width
  • Leave the design unchanged otherwise
  • Add a story to storybook, that's specifically designed to make experimenting with this layout easier in the future

We can continue to iterate on this further, because it's still far from perfect in a lot of scenarios, but this at least improves one concrete use case, and gives us a thorough set of test-cases to base future work on.

Screenshot 2023-09-22 at 3 00 55 PM

@matifali
Copy link
Member

matifali commented Sep 23, 2023

I like how you resolved the issue if there is only a single item. I have 1 question/suggesion.
How hard will it be to get the width from the content? And then expand as it needs more space. Most of the metadata will have a fixed width, though. Also, we can restrict the max width to some number.

@aslilac
Copy link
Member Author

aslilac commented Sep 23, 2023

I like how you resolved the issue if there is only a single item. I have 1 question/suggesion. How hard will it be to get the width from the content? And then expand as it needs more space. Most of the metadata will have a fixed width, though. Also, we can restrict the max width to some number.

To get the width in a way that would inspire any confidence, you'd have to just render it to the screen and ask the browser, which would result in flashing

@matifali
Copy link
Member

@aslilac it would flash only once. And we plan to do this for data that is dynamic so naturally keeps flashing

},
};

function getAgentRow(agent: WorkspaceAgent): JSX.Element {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not create a component instead of having a getAgentRow? ExampleAgentRow?

Copy link
Member Author

Choose a reason for hiding this comment

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

idk, this is just the way that it's already set up. 😅

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Since it is an improvement, I'm good with it 👍

@aslilac aslilac merged commit 47d3161 into main Sep 25, 2023
@aslilac aslilac deleted the resource-metadata branch September 25, 2023 15:40
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2023
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.

Resource metadata item value truncated despite ample space in workspace dashboard table
3 participants