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

Add a text-limit to the name column for long non-breaking job names #4

Closed
jakobo opened this issue Sep 19, 2022 · 11 comments · Fixed by #13
Closed

Add a text-limit to the name column for long non-breaking job names #4

jakobo opened this issue Sep 19, 2022 · 11 comments · Fixed by #13
Assignees
Labels
good first issue Good for newcomers pkg: ui @taskless/ui - UI Components for Taskless and the Taskless Dev Server

Comments

@jakobo
Copy link
Member

jakobo commented Sep 19, 2022

In the Taskless Dev Server, the name column of the data table doesn't have a maximum width (see attached for how the column pushes beyond the page bounds).

Some possible fixes:

  • The column could be capped at a reasonable character length with an ellipsis based overflow, using a title attribute. This would result in a very compact data table at the expense of readability
  • On display, a <wbr/> could be injected after every non a-z0-9, letting long names wrap at the browser's discretion. This would let developers see the full job's name, but would make horizontal scanning more difficult
  • Your own ideas for how to improve the DataTable component's layout

image

@jakobo jakobo added good first issue Good for newcomers pkg: ui @taskless/ui - UI Components for Taskless and the Taskless Dev Server labels Sep 19, 2022
@jakobo jakobo changed the title Text-limit of name column [ui, dev] Text-limit of name column Sep 19, 2022
@jakobo jakobo changed the title [ui, dev] Text-limit of name column Add a text-limit to the name column for long non-breaking job names Sep 21, 2022
@takanome-dev
Copy link
Contributor

In my opinion, using the overflow ellipsis in the title would be a good approach.
If there is no way to reduce the characters of the name, maybe I can try implementing that overflow stuff

@jakobo what do you think about it?

@jakobo
Copy link
Member Author

jakobo commented Sep 21, 2022

The name field is pretty variable, as folks tend to use it for namespacing their job IDs. For example, in the screenshot, the name is u/[user-id]/p/[project-id]/[email-template]/[variant] This makes it easy to search a job by user & project.

I think tailwind's truncate would be sufficient, though we may also need to attach a max width to that column. The /ui project doesn't have storybook running yet, so the easiest way to test changes is:

  1. start packages/ui using yarn dev
  2. in another tab, start the taskless dev server in packages/dev using yarn dev available on localhost:3001
  3. Use the "Create a Job" flow to make a job with a sufficiently long name which calls http://localhost:3001 which will run immediately and show up in the dashboard

@takanome-dev
Copy link
Contributor

Oh, so it facilitates the searching.
I will try to do it ASAP 🚀

@jakobo
Copy link
Member Author

jakobo commented Sep 21, 2022

I will try to do it ASAP 🚀

No rush, we'll plan the fix as part of 3.1.3. The layout just looks weird, and most people aren't using super long names yet.

@jakobo jakobo added this to the 3.1.3 milestone Sep 21, 2022
@takanome-dev
Copy link
Contributor

@jakobo I get the following error when trying to start the dev server:

Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error:
 StdoutInstanceError: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (/home/takanome_dev/Projects/OpenSource/jakobo/taskless/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:348:58)
    at MongoInstance.stderrHandler (/home/takanome_dev/Projects/OpenSource/jakobo/taskless/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:287:14)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
Starting the MongoMemoryReplSet Instance failed, enable debug log for more information. Error:
 StdoutInstanceError: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (/home/takanome_dev/Projects/OpenSource/jakobo/taskless/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:348:58)
    at MongoInstance.stderrHandler (/home/takanome_dev/Projects/OpenSource/jakobo/taskless/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:287:14)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
Could not start a mongo server
Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"

@jakobo
Copy link
Member Author

jakobo commented Sep 24, 2022

Usually this is caused by the dev server missing system level dependencies, which can happen when you've brew installed openssl, are using an old version of ubuntu, etc. What OS are you using, as I may need to add some notes about the mongo-memory-server package.

@takanome-dev
Copy link
Contributor

I'm using Ubuntu 22.04.1 LTS x86_64 Host: 24791Q6 ThinkPad L530 Kernel: 5.15.0-48-generic

@jakobo
Copy link
Member Author

jakobo commented Sep 24, 2022

It looks like 22.04 doesn't have libssl1.1, as they went all-in on libssl 3. ref As a result, when mongo-memory-server tries to start, it fails due to the missing library.

There's a few tracker issues in the mongo repository WRT Ubuntu 22.04 support, but it looks like they're a ways off.

There's a workaround for legacy support, but this is 100% optional to try. Otherwise, we can look into some other alternatives for the dev server.

echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1

Dev Server DB

Nothing about the dev server says we need to use mongo, only that DocMQ had support for it and that was the shortest route to getting our dev server running. I've created jakobo/docmq#10 in the DocMQ repo for tracking that.

For now, we might have to leave this issue as blocked :\

@takanome-dev
Copy link
Contributor

❯ sudo apt-get install libssl1.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.1
E: Couldn't find any package by glob 'libssl1.1'
E: Couldn't find any package by regex 'libssl1.1'
❯ sudo apt install libssl1.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.1
E: Couldn't find any package by glob 'libssl1.1'

Humm I agree about blocking this issue for now 🥂

@jakobo jakobo added blocked - upstream Blocked by an upstream dependency. See Comments for linked issue(s) and removed blocked - upstream Blocked by an upstream dependency. See Comments for linked issue(s) labels Sep 26, 2022
@jakobo
Copy link
Member Author

jakobo commented Sep 29, 2022

Fixed as of docmq 0.4.0 and its integration in da0642c where we're using LokiJS to drive the dev server w/o MongoDB. We should be able to return to this UI issue now. ❤️

@takanome-dev
Copy link
Contributor

Sure, I will work on it ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pkg: ui @taskless/ui - UI Components for Taskless and the Taskless Dev Server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants