-
Notifications
You must be signed in to change notification settings - Fork 50
Prototype attachment gallery support #396
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
base: main
Are you sure you want to change the base?
Conversation
- Create AttachmentGalleryNode to wrap 2+ uploaded images - Update gallery grid layout (2-col, 3-col) based on image count - Move cursor outside gallery after upload/deletion to prevent layout issues - Auto-unwrap gallery when reduced to 1 or 0 images - Add CSS grid styling for attachment galleries - Add tests for gallery creation and deletion behavior
|
@jorgemanrubia would appreciate your initial thoughts on this. I had another PR but it diverged too much from main, so this is a fresh one. It also adds support for deleting images from galleries. |
- Ensure empty paragraph exists after gallery when replacing last node - Simplify cursor positioning to only look forward (next sibling) - Create new paragraph after gallery if next node isn't suitable - Fixes cursor appearing in gallery grid cells after drag-and-drop
|
Hey @lylo thank you so much for your work exploring galleries. I will review this one soon, sorry I have been busy with several fronts (new product on its final stage! 😅). |
|
Not a problem! Thanks for taking the time to have a look, really appreciate it. |
|
Just a bump on this to say that I've merged the latest main into it. Still works if someone wants to take a look! 😉 |
|
@zoltanhosszu @samuelpecher do either of you fancy taking a look at this concept? :) |
|
Hey @lylo it's on our list to look at since we want the feature too! |
🥳 🙏 |
This is a proof of concept for basic attachment gallery support. I'm hoping it starts a discussion about whether this is the right direction to take with galleries.
It adds a new AttachmentGalleryNode object which wraps multiple
<action-text-attachment>nodes in a<div>. You can also delete nodes in a gallery and have it correctly reformat based on the remaining nodes.It supports up to 9 images in a 3x3 grid (like Trix). Inserting via the toolbar and drag and drop is supported.
Known limitations