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

Improve trix and action text support #2715

Open
Paul-Bob opened this issue Apr 22, 2024 · 2 comments
Open

Improve trix and action text support #2715

Paul-Bob opened this issue Apr 22, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working Field

Comments

@Paul-Bob
Copy link
Contributor

Feature

Trix field have some limitations:

  1. File attachment is possible only on persistent records Avo demo error: "You can't upload files into the Trix editor until you save the resource" #2713
  2. File attachment is possible only whit explicit attachment_key
  3. File attachments are corrupt except images on action text. (has_rich_text) After uploading File in ActionText (Trix) it can not be found when rendering (missing attachable) #2538

Let's explore this possibility:

  1. When attachment_key is set that means we need a persistent record with that attachment_key association. So limitation points 1 and 2 still applying.
  2. When attachment_key is not set that means the user do not want to associate the attachments to a fixed key/association. We can generate a random key like here https://trix-editor.org/js/attachments.js and in this case the limitation points 1 and 2 will not apply, i.e there is no need for a record and neither attachment_key.
@davekruse
Copy link
Contributor

Editing an ActionText field with Trix field separates captions from images.

  1. Add an image
  2. Click and change the caption
  3. Save
  4. Edit

In the trix edit view, the caption is rendered as regular text (a couple
line breaks and plain text). Saving the field causes that caption to become part of the body. Rendering the ActionText elsewhere also shows the text as part of the body - no longer attached to the image.

@sedubois
Copy link
Contributor

sedubois commented May 7, 2024

I think a helpful first step would be to ensure models using has_rich_text are added to the test suite and to the demo website. Currently the use of has_rich_text does not seem to be tested/demonstrated/documented anywhere. See issue.

I can also confirm that captions are broken as noted by @davekruse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Field
Projects
Status: Next up
Development

No branches or pull requests

3 participants