Originally created by: Quimisagi
This PR finlly introduces the ability to navigate through carousels (using h/l). A small text below the media displays the current index in the carousel. Furthermore, by pressing o, the current media will be opened in the browser.
https://github.com/user-attachments/assets/4b9e3493-fb8f-4eb8-8a45-02cc4b32a20d
Also changed the feed layout so it displays post text at the right of the media (takes around 50% of the space)
With this I believe that the most important features regarding the feed are implemented, though it still may have room for improvements.
Image component introduced on [#104]ListMediaViewer and are not included in TimelineMediaViewer. My apply that to TimelineMediaViewer eventually if there's some demand for it.
Originally posted by: supreme-gg-gg
Super cool new feature, will test soon but make sure you're merging into
ts-migration/maininstead ofmain😄Originally posted by: Quimisagi
Right
Sorry, I forgot, lol
Will do it later
Originally posted by: Adventune
Would love to have this done to be reused for posting (#119).
What comes to this: I am planning to within the same issue (#119) update the image rendering.
terminal-imagepackage seems much better suited. It renders using half blocks for terminals that do not support images and just renders the image if the terminal does support it.Originally posted by: Quimisagi
Yeah, I agree that
terminal-imagedefinitely would work better!It's not yet done but I think it's indeed the way to go
Originally posted by: supreme-gg-gg
Just to let you guys know that @endernoke is working on a package / utility to support image display in most modern emulators (I believe based on
terminal-imageand some other protocols?) and is tracked in [#104]Related
Tickets:
#104Originally posted by: Adventune
Alright. That should be fine then. I think an image/carousel component could be in place. The image rendering seems to be currently left to whatever View/Component wants to use an image. Thinking of a component that takes source (single to multiple, uri or filepath) and renders the image/carousel. Maybe with some style arguments (width, height).
The image rendering work seems to be quite scattered across multiple features/issues (atleast as I am stepping in to the project), so could some combined tracking issue be made? @supreme-gg-gg
Related
Tickets:
#104Originally posted by: Quimisagi
I have already implemented an ASCII rendering for the feed, and I was planning to start working on the implementation of the image rendering too, but looks like @endernoke is already handling it, I'll just wait for that to integrate it to the feed later :P
Currently the ASCII renderer only takes the URL of the image, and it fetches it and adjusts its size based on the terminal size.
Related
Tickets:
#104Originally posted by: endernoke
What about we build a generic Ink component responsible for rendering an image (like
ink-imagebut much more powerful), then we can wrap the media view / posts / carousel around it, so we can modularize the code and abstract away the rendering and protocol implementation details.As @Adventune said the component might take source image and styling props, I think it should accept the following parameters:
src: image URL or filepathwidth,heightin terms of terminal cells or pixelsprotocol: how the image would be rendered, e.g. with ASCII or half blocks or sixel or whatever@Quimisagi @Adventune what do you think?
If you guys are positive about this then we can start by refactoring the ASCII rendering into a standalone component and implement more rendering strategies incrementally.
Related
Tickets:
#104Originally posted by: endernoke
Let's track all image rendering related progress in [#104]
The
terminal-imagelibrary should be a good starting pointRelated
Tickets:
#104Originally posted by: Adventune
@endernoke That sounds great! Would make it possible to use the component while it is improved over time. The props sound good (
srcis the only one I would make required).Originally posted by: supreme-gg-gg
@Quimisagi is this ready for review?
Originally posted by: Quimisagi
Wanted to solve the issue of media not longer automatically render itself when its ready...
Originally posted by: Quimisagi
Ok, now it's ready!
Originally posted by: Quimisagi
Looks like the
feeddoesnt work anymore after merging the changes ints-migration/main....can someone please confirm?Originally posted by: endernoke
I got the following error when testing:
@Quimisagi Is this the same error you got
Originally posted by: Quimisagi
Yes, it's exactly the same!
Originally posted by: endernoke
See my review comment above, it should fix it 😄
Originally posted by: Quimisagi
That definitely fixed the error but still something changed after the merge with
ts-migration/mainThere's no errors now, but looks like
isLoadingbecomes false even before data has finished loading making it display an empty media view for a moment.It wasn't happening before so I think it has to do with the changes in
useInsagramClient.jsOriginally posted by: Quimisagi
Ok, I think it may be ready now anyway ;D
Originally posted by: Quimisagi
I think it also happens to me but haven't figured out the cause yet.
Originally posted by: supreme-gg-gg
I can only reproduce this on iTerm2 lol, it works fine for example on Kitty, seems to be a quite terminal specific issue. I think we can merge it first since it doesn't really affect UX and it fixes the react hook issue above
Ticket changed by: supreme-gg-gg