Skip to content

Resource metadata item value truncated despite ample space in workspace dashboard table #8887

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

Closed
kconley-sq opened this issue Aug 3, 2023 · 19 comments · Fixed by #9832
Closed
Assignees
Labels
s3 Bugs that confuse, annoy, or are purely cosmetic site Area: frontend dashboard

Comments

@kconley-sq
Copy link
Contributor

In Coder v0.27.3 we're seeing that the value of a resource metadata item is truncated with ellipsis even though there seems to be enough space to show more (or even all) of the value in the workspace dashboard table on the Coder website:

image
resource "coder_metadata" "device" {
  # other fields elided...
  item {
    key   = "Test"
    value = "The quick brown fox jumped over the lazy dog"
  }
}

Can that be improved to show more (or all if possible) of the value?

@cdr-bot cdr-bot bot added the bug label Aug 3, 2023
@matifali matifali added site Area: frontend dashboard s2 Broken use cases or features (with a workaround). Only humans may set this. labels Aug 4, 2023
@matifali
Copy link
Member

matifali commented Aug 4, 2023

cc: @BrunoQuaresma

@bpmct bpmct added the s3 Bugs that confuse, annoy, or are purely cosmetic label Aug 25, 2023
@cdr-bot cdr-bot bot removed the s3 Bugs that confuse, annoy, or are purely cosmetic label Aug 25, 2023
@bpmct bpmct added s3 Bugs that confuse, annoy, or are purely cosmetic and removed s2 Broken use cases or features (with a workaround). Only humans may set this. labels Aug 25, 2023
@BrunoQuaresma
Copy link
Collaborator

More context about this, since we don't control what kind of information the user can add to it, it is hard to control and guess what is the best width so we are setting it statically using a fixed width. We could also re-think the design of it if that is the case.

@BrunoQuaresma
Copy link
Collaborator

@aslilac since you are assigned to this one, do you think you could take care of this one as well? #9457. I think the solution to this issue could solve the problem we have on #9457 🤔

@BrunoQuaresma BrunoQuaresma removed the bug label Sep 18, 2023
@cdr-bot cdr-bot bot added the bug label Sep 18, 2023
@matifali
Copy link
Member

@BrunoQuaresma what do you think about having a field width in coder metadata blocks. So that the user can set a custom width for their agent metadata.

resource "coder_metadata" "device" {
  # other fields elided...
  item {
    key   = "Test"
    value = "The quick brown fox jumped over the lazy dog"
    width = "50px" 
  }
}

@BrunoQuaresma
Copy link
Collaborator

It looks hacky but at the same time an available option 🤔 I would like to have more opinions on this.

@kconley-sq
Copy link
Contributor Author

I'm hoping template developers might not have to specify width manually, I'd prefer to let the Coder website UI decide how best to present the string based on the actual string length received from the agent and the user's screen resolution, device type, etc.

It looks like the Coder website UI has available space to show more of the string in this issue as well as the multiple metadata strings in #9457, so as a first step would it be possible to make the UI show as many metadata strings (and as much of those strings) as possible given the available space in the agent row on the dashboard?

@aslilac
Copy link
Member

aslilac commented Sep 21, 2023

I spent a bunch of time trying to get something "elegant" working and came up quite short. flex and grid are both a pain to work with. One idea I had though that should improve this without too much jank: what if we only enable the grid rules if there is more than one item? I'll play around with that on Friday and see how it feels.

cc @BrunoQuaresma

@BrunoQuaresma
Copy link
Collaborator

@aslilac since you are thinking about this, another "side effect" of this issue is this one: #9457

@aslilac
Copy link
Member

aslilac commented Sep 22, 2023

That's actually kind of a different issue, and the fix I had in mind for this one will not fix that one. 😅

To be honest, I don't even know how possible fixing both of them together is, and I really hate fighting with grids and flexboxes. The desire to grow and shrink in the specific way that we would need is just...not realistic. I spent nearly a whole day butting my head against it and got nowhere.

@BrunoQuaresma
Copy link
Collaborator

@aslilac can I assign this to me? I have an idea how to make that happen if that is ok for you 👀

@aslilac
Copy link
Member

aslilac commented Sep 22, 2023

@aslilac can I assign this to me? I have an idea how to make that happen if that is ok for you 👀

yes please 😂

@aslilac
Copy link
Member

aslilac commented Sep 25, 2023

@BrunoQuaresma I'll let you reopen and reassign if you still wanna do further work on this!

@kconley-sq
Copy link
Contributor Author

I understand the changes in #9832 to help with this issue only take effect if you only have one metadata item for a resource, but unfortunately I have two. 😅 Can we reopen this ticket to track fixing this issue independent of the number of metadata items used?

@kconley-sq
Copy link
Contributor Author

I understand the changes in #9832 to help with this issue only take effect if you only have one metadata item for a resource, but unfortunately I have two. 😅 Can we reopen this ticket to track fixing this issue independent of the number of metadata items used?

cc @bpmct, can we reopen this issue? I can still reproduce the scenario described in the first comment on the issue (where two metadata items are used) in v2.4.0.

@matifali matifali reopened this Dec 9, 2023
@aslilac aslilac assigned BrunoQuaresma and unassigned aslilac Dec 11, 2023
@BrunoQuaresma
Copy link
Collaborator

@kconley-sq we are working on a new workspace page that is probably going to fix that. It is probably going to be available as an experiment around January. Does it work?

@kconley-sq
Copy link
Contributor Author

@kconley-sq we are working on a new workspace page that is probably going to fix that. It is probably going to be available as an experiment around January. Does it work?

Yes that sounds good, thank you @BrunoQuaresma!

@BrunoQuaresma
Copy link
Collaborator

@kconley-sq would it be possible to share some resource metadata you have that might resolve this issue? I want to make sure we are working with real data and see what it looks like outside of the "perfect" simulated data. It does not need to have the values, but rather strings that can represent their length.

@kconley-sq
Copy link
Contributor Author

@BrunoQuaresma sure, here is an example:

key1: xxxxxxxxxxxx
value1: xx

key2: xxxxxxxxxxxxxxxxxxxxxx
value2: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

@BrunoQuaresma
Copy link
Collaborator

@kconley-sq I think this is solved on 2.7.0 but feel free to re-open it in case it is not 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s3 Bugs that confuse, annoy, or are purely cosmetic site Area: frontend dashboard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants