feat: group images into a gallery #639
No reviewers
Labels
No Label
1000k
100k
10k
200k
20k
500k
50k
5k
75k
backend
blocked:design
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
scope:intl
scope:nip
scope:query_tracing
scope:ux
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Kieran/snort#639
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fernandoporazzi/snort:group-post-images"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Solves #626
Results can be found in the attachments and also externally on video: https://streamable.com/q492ui
I've done some testing with different types of combinations, such as:
text -> gallery -> text -> gallery
gallery -> video -> gallery
link -> text -> gallery
hashtag -> gallery -> video -> gallery
and it seems to be working fine. If the
<Text />
component is used elsewhere other than the timeline and the post itself, it might need some extra testing.This npub was created in order to test all those combinations:
npub1027c702nhecpzy6jt3wyvjpw6j8m7n9x0xyvn00xt69zlljv8fts5c34hd
@ -86,3 +130,1 @@
} else if (lenCtr + a.content.length > truncate) {
lenCtr += a.content.length;
return <div className="text-frag">{a.content.slice(0, truncate - lenCtr)}...</div>;
chunks = chunks.concat(null);
This should be
continue
insteadSolved
@ -190,3 +190,3 @@
.map(a => {
if (typeof a === "string") {
if (a.length > 0) {
if (a.trim().length > 0) {
Should not trim because empty
text
frag is important for spacingKeeping that empty text fragment might be a bit of an issue when grouping images. It would break the grouping for loop if the next element is not a media of type image.
We could keep on grouping images if there is an empty text fragment between them, but that would increase the complexity of the code as well.
Maybe we can find a proper way to handle spacing using a CSS-only solution.
Currently the space is not so messed up, I just think the line-height is a bit too high. If we lower that value, it might remove the space between the text you see on the video attached.
Ok we can keep it trimmed for now, but i used to have this and it messed up some of the layout on posts
18c54877d5
to8e34a7a078
Ah yes here it is, its the hashtags: