This PR was created by a GitHub Action to update the changelog.
Co-authored-by: alexpasmantier <47638216+alexpasmantier@users.noreply.github.com>
chore(changelog): update changelog (auto) (#387)
This PR was created by a GitHub Action to update the changelog.
Co-authored-by: alexpasmantier <47638216+alexpasmantier@users.noreply.github.com>
chore: bump to 0.10.8
I initially didn't notice that an image previewer was already
implemented but commented out—still, I wanted to finish mine! :)
It works almost instantly on my side. I tested it in different terminals
and only noticed some slowness in the RustRover-integrated terminal.
So far, I’ve tested it with PNG, JPEG, ICO, GIF, and TIFF formats, and
it works well. In theory, it should support all formats that the image
crate can handle. I included them in the file list but commented out the
ones I haven’t tested yet.
To optimize memory usage, images are resized to a maximum of 128x128
before being cached. I’m not really sure what the best size is, since
the image gets resized again when rendered to fit the preview window.
Let me know if you have any feedback! 🚀



---------
Co-authored-by: Alexandre Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
Co-authored-by: alexpasmantier <alex.pasmant@gmail.com>
The state of the UI is now synchronized with the `Television` struct
using a dedicated channel and is available at `Television.ui_state`.
This removes quite a bit of complexity from the existing code and should
allow for nicer implementations of features that need the UI state to
compute things in the background (typically knowing the target size of
an image you wish to construct in the background, as in #363)
The `UiState` currently only holds the UI layout:
```rs
pub struct UiState {
pub layout: Layout,
}
```
Before:
```toml
[shell_integration.commands]
# Add your commands here. Each key is a command that will trigger tv with the
# corresponding channel as value.
# Example: say you want the following prompts to trigger the following channels
# when pressing <CTRL-T>:
# `git checkout` should trigger the `git-branches` channel
# `ls` should trigger the `dirs` channel
# `cat` should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.commands]
# "git checkout" = "git-branch"
# "ls" = "dirs"
# "cat" = "files"
# ```
# environment variables
"export" = "env"
"unset" = "env"
# dirs channel
"cd" = "dirs"
"ls" = "dirs"
"rmdir" = "dirs"
# files channel
"cat" = "files"
"less" = "files"
"head" = "files"
"tail" = "files"
"vim" = "files"
"bat" = "files"
# git-diff channel
"git add" = "git-diff"
# git-branch channel
"git checkout" = "git-branch"
"git branch -d" = "git-branch"
# docker-images channel
"docker run" = "docker-images"
# gitrepos channel
"nvim" = "git-repos"
```
After
```toml
[shell_integration.channel_triggers]
# Add your channel triggers here. Each key is a channel that will be triggered
# by the corresponding commands.
# Example: say you want the following commands to trigger the following channels
# when pressing <CTRL-T>:
# `git checkout` should trigger the `git-branches` channel
# `ls` should trigger the `dirs` channel
# `cat` and `cp` should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.channel_triggers]
# "git-branches" = ["git checkout"]
# "dirs" = ["ls"]
# "files" = ["cat", "cp"]
# ```
"env" = ["export", "unset"]
"dirs" = ["cd", "ls", "rmdir"]
"files" = ["cat", "less", "head", "tail", "vim", "bat"]
"git-diff" = ["git add"]
"git-branch" = ["git checkout", "git branch -d"]
"docker-images" = ["docker run"]
"git-repos" = ["nvim"]
```
This PR adds a benchmark for performance-critical function
`build_results_list` from `television_screen::results`
This should allows `television` to track performances improvements or
regressions across time for that function (and other in the future)
---------
Co-authored-by: alexpasmantier <alex.pasmant@gmail.com>