-
Notifications
You must be signed in to change notification settings - Fork 19
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
server assisted comment collapsing #397
Conversation
(edit: specifically because it allows collapsing top level comments. with the current impl you have to live with seeing top level replies no matter what, and in my experience on reddit a lot of times those are just hate speech and intolerance, which I guess is a different reason to collapse now that I think about it most people likely did it due to being done reading a section or cleaning up the interface, I only did it when it was stuff like I said) |
I should have said this from the start, but my plan for this patch is that I'll be remaking the old change what what I learned from the previous attempt, and here's my old impl attempt for reference: https://github.com/asdfzdfj/mbin/tree/monkey/server-assisted-comment-collapse-old
that's part of it, but there's also the fact that the collapse button exists there at all I found kbin.social counterpart of this posts chain, notice that the collapse button only appears when the replies that would be collapsed has a clear visual indentation on it, and no more collapse button on comments of the same depth although the replies chain actually goes deeper my concerns is that for the usual users deep down the replies chain, the presence of the collapsing button can feel rather erratic, and "reading" what would be collapsed can be harder since there's no indentation to read from, unless they're aware that it tries to work on real depth where things might start to make more sense, but they should be able to understand the behavior intuitively and not needing to know what's going on under the hood
ok, so here's the old implementation attempt in a nutshell:
|
71e1b98
to
9e755f4
Compare
well I've decided to added back the minimizing parent and putting the collapse button on the lower right corner, those are just too good to discard (personally). give it a shot. also this means the collapse button could be enabled for any comment for the minimizing effect on comment without reply, |
I do like it better hiding the one you click on, and as you say would like to see it on all posts even if they don't have replies (and yes maybe the words "hide/show" are better descriptive in that case) The only thing I'm uncertain of is the position. It'd be nice if it could not shift the position of elements, like for example, just taking the thread with the most comments https://old.lemmy.world/post/3051842 if I click hide on the top post there the show button is in the exact same place on my mouse, so I can just spam click the hide/show button. That would kind of be my ideal, but I understand if that's difficult to achieve edit: I also didn't quite notice this is mainly JS driven, I guess that's a must because on microblogs it loads replies via ajax requests? with slow to load JS it is a bit weird but I guess it is what it is |
I don't want this all be solely my feedback though, maybe we can get a second opinion. Honestly I think any of the options are improvements so I'd be fine with going ahead with any of them as well, @nobodyatroot any thoughts? |
f8ea0f3
to
f673bf9
Compare
I have added back the button for all comments, and also trying to use show/hide for button label in that case
I think then the collapse button would need to be moved to somewhere near the top of the comment element for this to work, and where I put it at the moment (bottom right) is arguably the worst place to put it this property is desired maybe the collapse button could be put around the same place as the vote buttons but then I don't know how it should be designed
I don't think microblog having to load expanded replies from ajax has anything to do with this, and it's actually possible to do this without using js (Postmill has done it), but in order to do that the comment rendering would need to be restructured so that the replies are nested in a section/div: <post>
<div>main comment body</div>
<div class="replies">
<!-- nested replies ... -->
</div>
</post> (@BentiGorlich has actually mentioned this restructuring before at least once, but for the reason that the act of hiding replies would be as simple as just hiding the but this would be quite a major undertaking, and there're also other js stuff that can insert comments live, those would need to be updated to handle this new structure too. and after doing the sensitive image toggle stuff I have to say that I'm not particularly motivated to do frontend stuff right now, |
Looking at it on your instance, it looks good to me |
f673bf9
to
85727d2
Compare
in any case I added an experiment patch that moves the collapse/expand button to the top right corner of the comment, after the votes button. try switching between the base version and this alternate button version and see which one is more practical this way the button and the screen stays roughly at the same place when collapsing/expanding comment, |
4fc9ce7
to
18b535e
Compare
I also saw this yesterday, added a fix. try update the patch, it should be fine now |
noted, will see what I could do. in any case, it looks like the top right icon collapse button is preferred, it that's settled then I'll go ahead and squash both commits so I could go ahead and focus more on refining the patch |
4d89776
to
4686127
Compare
👍
absolutely. Btw. I looked at how kbin is doing it, and I don't like it :D |
45c16cc
to
aabd8b8
Compare
pushed the update that should add back the collapsed button on deleted comments; squashed both commits together, keeping the top right icon button; and for the most part it seems to work good enough that I think it should be ready for review/merge now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The twig components lgtm. I don't really know how the js controller stuff works, but its working as intended, so I'll approve
add ability to collapse a comment's replies, hiding them away and minimize the parent comment somewhat based on klin's work (https://codeberg.org/Kbin/kbin-core/pulls/167) but with a few of my own differences: - use depth information from twig side, rather than sleuthing from css `comment-level--` class. this means it can collapse comments with >10 depth more accurately - when collapsing a comment's replies and then collapse/expand its comment's parent, the nested reply collapse will be retained (klin's work will always expand all replies although it was collapsed by a different, nested parent) - visual changes only, no dom node insertion/deletion used, nor planned to the collapse button is placed at the top right corner of the comments, after the vote button since collapsing comments will also minimize the parent, it can be attached to comment with no replies for minimizing effect. the collapse button will use slightly different icons to signify this
063cc95
to
2a8ceb2
Compare
NOTE:
this is very much a WIP, things may change wildly, expect frequent rebase/force pusha lot of things has settled down, but still definitely needs some real world tests and feedback, not a UI/UX personadd ability to collapse a comment's replies, hiding them away and minimized the parent comment
somewhat based on klin's work (https://codeberg.org/Kbin/kbin-core/pulls/167) but with a few of my own differences:
comment-level--
class.this means it can collapse comments with >10 depth more accurately
the collapse button is placed at the top right corner of the comments, after the vote button
since collapsing comments will also minimize the parent, it can be attached to comment with no replies for minimizing effect.
the collapse button will use slightly different icons to signify this
it all look something like this
previous concerns
latest version (both commit): icon button at the top right of the comment
![image](https://private-user-images.githubusercontent.com/20770492/295259931-f08c5bbc-6f84-4589-b576-2b302f03c2d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3MzE3OTcsIm5iZiI6MTcyMzczMTQ5NywicGF0aCI6Ii8yMDc3MDQ5Mi8yOTUyNTk5MzEtZjA4YzViYmMtNmY4NC00NTg5LWI1NzYtMmIzMDJmMDNjMmQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDE0MTgxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2NGNlYzMyMTc0MjQ5OGMyYjY1ZGMxM2QxNGIzODMyMDhmMDA5M2I5OTVlYTI0ZTQ5MzMwNWZhMDY0OGVlMjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aFrFTgezCH_npdXLFyLrVBbPfeREpQ9-DdCDSmS1dBs)
![image](https://private-user-images.githubusercontent.com/20770492/295260406-58cb916c-bac9-41ee-9f6b-51ca28a89703.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3MzE3OTcsIm5iZiI6MTcyMzczMTQ5NywicGF0aCI6Ii8yMDc3MDQ5Mi8yOTUyNjA0MDYtNThjYjkxNmMtYmFjOS00MWVlLTlmNmItNTFjYTI4YTg5NzAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDE0MTgxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhYzVlZGZmZGRkZTI2ZWY0Yjg1MTAyZWVmOTIzNTAxOGVhNzg2Y2EyZmY1ZDA3NWVlZTZlZDRkNmQ2NmRjZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HdQ7Yk3vvvvsER-Lo0YmDmAIOBVqcJbhGXfCHSWIVEY)
first commit version: text button at the bottom right of the comment
![image](https://private-user-images.githubusercontent.com/20770492/294749046-6a7eddeb-a1c8-4229-9bf9-48ef066c04d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3MzE3OTcsIm5iZiI6MTcyMzczMTQ5NywicGF0aCI6Ii8yMDc3MDQ5Mi8yOTQ3NDkwNDYtNmE3ZWRkZWItYTFjOC00MjI5LTliZjktNDhlZjA2NmMwNGQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDE0MTgxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZmYmQxMDI5YjBmZmZmZjc4OGIzNDk5OWYzMGY0NGE3NzZlMmEwOWI5MGU1Nzg3YmJiZGEzODRkOWI1YTY0ZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vJdIFNQWZ70GmmbGKBXEfM4eUAodb1vfe7lQcj2zpv4)
![image](https://private-user-images.githubusercontent.com/20770492/294749081-53cd97d3-0617-4835-88c5-b6c5bcda4a2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3MzE3OTcsIm5iZiI6MTcyMzczMTQ5NywicGF0aCI6Ii8yMDc3MDQ5Mi8yOTQ3NDkwODEtNTNjZDk3ZDMtMDYxNy00ODM1LTg4YzUtYjZjNWJjZGE0YTJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDE0MTgxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJkZDA4OTliOTZiZTljZjRhZjIyOTM4MzBiZDk2YzBjMzcxYWM4NjNlODA5YmJlNjUzYTQ2MDcyOWFiZjY0MDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TFwSn_2uhFrzX8nlopi7N-7u4SJXEw_pVgKkiEnU_1Y)
the top corner one seems to be more preferred, if this is settled then I'll squashed both version/commits together so I could focus on refining the patch
there are quite a lot of things that I'm not sure how to go with it, there's probably more but this is what I could think of at the moment:
should the collapsing process strictly relies on visual depth, real comment depth, or some mix of both
klin's work and kbin impl only uses existing depth from
comment-level--{1..10}
css classmy impl used depth from twig side and without cap, which means it could collapse deeper (>10 depth) comment more accurately but could lead to a rather unintuitive experience since you could collapse comments that appeared to be on the same depth (which happens quite often when you're reading Foone posts, see this in action)
but then I have decided to only enable collapse button on top level comments in classic view, which aligns more with the visual depth
should collapsing action only fold the replies or should it 'minimize' the parent? (the one you clicked collapse)
klin's work and my old impl does this, kbin
and this impldoesn't. it does now.where should the collapse button be?
(currently)in menu bar, like the post replies' expand/collapse buttonleft corner, like kbin
right corner, my old impl does this. now this patch does too
perhaps it make a bit more sense with minimizing parents, as the expand button is there when minimized, and so the collapse/expand wouldn't move too far when toggling them
my old impl attempt for reference: https://github.com/asdfzdfj/mbin/tree/monkey/server-assisted-comment-collapse-old