Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Collapse texts that are too long in tasks

Open AbdBarho opened this issue 3 years ago • 6 comments

From comment https://github.com/LAION-AI/Open-Assistant/issues/158#issuecomment-1367630126

When doing tasks on device with a small screen, it may happen that the text for one of the tasks is large enough to cover the entire screen, making interactions such as drag and drop much more difficult.

Proposed solution: Have maximum amount of characters that can be displayed in one field, and collapse the text if more is present.

AbdBarho avatar Dec 31 '22 08:12 AbdBarho

Have maximum amount of characters that can be displayed in one field, and collapse the text if more is present.

would an alternative be to just specify a max-width? might be easier from a css perspective

yk avatar Dec 31 '22 14:12 yk

Unfortunately, that won't solve the problem.

If we have a fixed width, the text will wrap into new lines, and with long enough text, there will be enough lines to cover the entire page.

Other solutions could be dynamic font-size or a pop up that shows the entire text.

AbdBarho avatar Dec 31 '22 15:12 AbdBarho

Ok, I thought of something like overflow: hidden with text-overflow: ellipsis or something like that, but yea might be tricky. Character limit seems fine :)

yk avatar Dec 31 '22 15:12 yk

Hey, I tried to take a look at this issue. My plan was to cut the string after maxLength and add an ellipsis which will be a clickable button that shows a chakra modal with the full text.

On big screen sizes it looks ok: image

But when I try it on smaller sizes, for some reason the modal does not take up the full width/height of the screen: image

I can probably fix it using style tags, but I feel I might be missing something simpler.

kostiak avatar Jan 02 '23 16:01 kostiak

@kostiak I will assign this to you.

I don't know what the problem is, but the modal might need some position attributes?

Could you open a draft PR with your code and maybe we can look over it together?

AbdBarho avatar Jan 02 '23 17:01 AbdBarho

Hey, I added a draft PR, let me know what you think, thanks!

kostiak avatar Jan 03 '23 01:01 kostiak

@AbdBarho hey, my PR has been merged, let me know if anything else needs to be done here.

kostiak avatar Jan 04 '23 08:01 kostiak

@kostiak thanks! If it is merged, we can close this!

AbdBarho avatar Jan 04 '23 08:01 AbdBarho