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

Expand/Collapse truncated string #172

Closed
lukaspili opened this issue Feb 17, 2025 · 3 comments · Fixed by #174
Closed

Expand/Collapse truncated string #172

lukaspili opened this issue Feb 17, 2025 · 3 comments · Fixed by #174
Assignees
Labels
user request Requested by user

Comments

@lukaspili
Copy link

lukaspili commented Feb 17, 2025

Currently there is no way to expand a truncated string, when displaying a JSON in read-only mode (edits disabled).

It would be great if we could expand / collapse to see the full content of a string, while keeping it truncated by default, as configured by stringTruncate.

Thanks

@lukaspili lukaspili added the user request Requested by user label Feb 17, 2025
@CarlosNZ CarlosNZ self-assigned this Feb 17, 2025
@CarlosNZ
Copy link
Owner

That's a good point, thanks. Wondering what the best way to handle it should be? Do you think hover/"tooltip" text would be enough? That doesn't really help on mobile, though, although perhaps that's not an issue since it's not really a particularly mobile-friendly element anyway.

Seems like the options would be:

  1. Tooltip/hover text
  2. Double-click to expand text (this would only be when not editable though, since double-clicking starts editing normally)
  3. A separate button (in lieu of the "Edit" button) to expand the text (again, only for non-edit mode)
  4. Something else?

I think I'll put the tooltip text in regardless, since it's non-intrusive and doesn't make any difference to people who don't need it. Unsure about other options.

Let me know your thoughts.

(Just quick note -- technically you can access the full text by copying it to clipboard, although I agree that's not always practical. I use a clipboard manager so can readily see all my copied text, but not everyone's going to have that.)

@CarlosNZ
Copy link
Owner

Actually -- it seems like the best approach would be to make the "..." at the end of the string clickable to expand the full string.

Not sure about collapsing it again though?

@lukaspili
Copy link
Author

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user request Requested by user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants