mirror of
https://github.com/ulyssa/iamb.git
synced 2026-04-03 08:19:08 -06:00
Add support for previewing images in room scrollback #431
Labels
No labels
admin
bug
bug
bug
bug
bug
bug
bug
debugging
documentation
documentation
documentation
documentation
e2ee
e2ee
e2ee
e2ee
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
experimental
experimental
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
image
image
image
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
modalkit
perf
perf
perf
perf
ratatui
releases
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
ui
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github/iamb#431
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @benjajaja on 5/20/2023
An image says more than a thousand words:

There has been some work to get some small change into ratatui that allows for "skipping" of rendering some cells (characters). This in turn allowed to make a crate ratatui-image that provides a image widgets for ratatui, taking care of the terminal's graphics protocol automatically. Currently the supported "protocols" are sixels, kitty, and unicode-halfblocks. iTerm2's protocol should be easy to add, I just don't have access to a mac.
This PR uses ratatui-image widget's
render()method to render images in theScrollBackwidget, in the chat lines. This seems hacky, but this kind of usage was actually intended and recommended for these kind of use cases in the discussion on the ratatui PR.Currently, the download and image processing happens in one spawned tokio task per attachment. I also have a branch where only one "worker" is created, but I don't actually know if that is an actual improvement. I mainly made that branch/version to learn a bit more about tokio/tasks/threads in rust.