633 Commits

Author SHA1 Message Date
LM
4faab403d2
refactor: QOL improvements on channels and CLI override logic (#584)
- Improved determine channel logic, it will make easier to maintain
moving forward
- Fixed hint logic for preview, it had issues for stdin and ad-hoc
channels
- Override logic for CLI UI elements was not handled consistently
- Added few more tests
2025-07-02 14:08:15 +02:00
LM
4ed48ccdad
feat(ui): support for non-fullscreen UI (#578)
fixes #575
2025-07-01 23:24:00 +02:00
alexandre pasmantier
0f8a585c85 fix(preview): default to no offset when offset template formatting fails 2025-07-01 22:14:35 +02:00
alexandre pasmantier
429bfaeb2f chore: remove unused serde renames 2025-07-01 19:02:20 +02:00
Alex Pasmantier
dc75e80fb9
fix(ui): avoid glitches caused by programs outputting control sequences (#579)
Fixes #561
2025-07-01 15:39:56 +02:00
LM
45139457a1
feat: add global/channel input history (#573)
sometimes I want to tweak the previous search, or just run it again.
this solves that problem

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-07-01 12:49:01 +02:00
dependabot[bot]
e6008350d0
chore(deps): bump crazy-max/ghaction-import-gpg from 5 to 6 (#576) 2025-07-01 08:48:38 +02:00
kapobajza
c34fa57312
feat(binary): host our own apt repo (#568)
This PR solves part of
https://github.com/alexpasmantier/television/issues/246, since hosting
our own apt repo is just the first step.

Right now it's a draft, because I put the CD code inside of the
[.github/workflows/static.yml](98a3d7b854/.github/workflows/static.yml)
file and this, most-likely, doesn't belong there. Where exactly to put
it will need to be discussed, but the requirements are:
- to start executing this code after we generate the `.deb` binary
- and to deploy the static GH pages content after we've executed this
code

I've deployed a test version of the `.deb` package to my GH pages and
you can actually already install `television` via `apt` like this:

```sh
# download the repository public key and put it in the trusted directory
curl -sS https://kapobajza.github.io/television/apt/repository-key.asc | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/television.gpg

# put the repository download link inside the apt sources list
echo "deb https://kapobajza.github.io/television/apt stable main" | sudo tee /etc/apt/sources.list.d/television.list

sudo apt update

# install the package 🚀 
sudo apt install television
```

---------

Co-authored-by: Kapobajza <kapobajza@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alex Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-29 23:20:43 +02:00
alexandre pasmantier
292c521205 refactor: use super for linux and windows and cmd for macos 2025-06-29 17:30:58 +02:00
domaschh
9a80919f66 fix(keybindings): add cmd as an option for modifrs 2025-06-29 17:30:58 +02:00
alexandre pasmantier
639caa1a30 feat(stdin): accept various entry separator characters 2025-06-29 17:16:23 +02:00
alexandre pasmantier
07556eac79 fix(cli): fix validation rules when reading from stdin 2025-06-29 13:52:54 +02:00
lalvarezt
ca5808affe fix(cli): fix parsing of arguments for autocomplete-prompt 2025-06-29 13:04:14 +02:00
alexandre pasmantier
141d3e7fb9 chore: update dependencies 2025-06-28 18:09:02 +02:00
Alex Pasmantier
f52d4ef524 docs: update README 2025-06-28 18:09:02 +02:00
alexandre pasmantier
c25a5bd75f docs: update readme and add new format docs 2025-06-28 16:59:57 +02:00
Domasch
090d71aff0 fix(cli): using --exact now works on the --input text aswell (#566) 2025-06-28 16:59:57 +02:00
alexandre pasmantier
d429a9a6ee fix(matcher): better handling of reloading and cycling through sources 2025-06-28 16:59:57 +02:00
Alex Pasmantier
e5a13ef8a1 fix: reset picker selection when cycling through sources 2025-06-28 16:59:57 +02:00
Alex Pasmantier
7b40e769ae feat(cable): migrate windows channels (#567) 2025-06-28 16:59:57 +02:00
LM
42e2728269 test(cli): new cli test suite (#564)
new set of test that cover the overall functionality of the cli

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:59:57 +02:00
LM
23f52d4533 feat(ui): Optional scrollbar and mouse support for the preview panel (#563)
cleaned up keybinding section from config

@alexpasmantier you had this code before, perhaps there was a reason for
it?

```rust
        if cfg!(not(windows)) {
            execute!(buffered_stderr, DisableMouseCapture)?;
        }
```
2025-06-28 16:59:52 +02:00
alexandre pasmantier
94e34c1668 fix(os): no more panicking on cwd-related errors
Display a custom message instead and exit cleanly.

Fixes https://github.com/alexpasmantier/television/issues/552
2025-06-28 16:56:09 +02:00
LM
58d90c6d03 refactor(ui): feature based UI (#562)
- Migrate to a feature based UI
- Introduces television/features.rs with a flags-based Features type
(PREVIEW_PANEL, HELP_PANEL, STATUS_BAR, REMOTE_CONTROL).
- Per-feature configuration sections: [ui.preview_panel],
[ui.status_bar], [ui.remote_control], [ui.help_panel]
- Rename Keybinding panel ➜ Help panel
- CLI & housekeeping
  - new CLI toggle --no-status-bar, updated docs and man page
  - import clean up
2025-06-28 16:56:09 +02:00
LM
ad4e254ae6 feat(ui): new keybindings panel and status bar (#559)
Add a new keybinding manager (à la which-key helix style)

it adapts to the current mode

channel mode

![image](https://github.com/user-attachments/assets/d1748d93-d62b-4377-a4cd-9825318300e0)

remote mode

![image](https://github.com/user-attachments/assets/fa6ab776-a9bd-421c-ae75-a0b6013401fa)

Add sorting for remote entries

---------

Co-authored-by: Alex Pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
Alex Pasmantier
a81a86f1fd fix(preview): don't panic when the previewer attempts to send to a closed channel 2025-06-28 16:56:09 +02:00
alexandre pasmantier
7067a2ba93 feat(remote): rework remote UI and add description and requirements panels 2025-06-28 16:56:09 +02:00
LM
a2ebbb3557 refactor(cli): add validation logic + docs
This PR contains the following changes
- Add validation logic and dependencies
- Remove deprecated frame rate
- Bump string_pipeline to 0.12.0 (solves debug syntax from templates)
- Document cli functionality (markdown and docstrings)

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
601580953a docs(tests): simple documentation for the PtyTester 2025-06-28 16:56:09 +02:00
alexandre pasmantier
a59aab67a9 test: add integration test for --watch 2025-06-28 16:56:09 +02:00
alexandre pasmantier
dd832fcfc9 test: a cleaner integration tests directory structure 2025-06-28 16:56:09 +02:00
LM
18917362be feat(cli): add watch flag to trigger reload of channels (#557)
solves #554

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
Alex Pasmantier
a8fb0f0b0e fix(reload): avoid UI flickering while reloading channel (#556)
Complements #554
2025-06-28 16:56:09 +02:00
LM
2ecbc8a170 feat(cli): initial support for source and preview overrides, layout, take_1 and take_1_fast (#553)
Co-authored-by: Alex Pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
47b99c43d0 test(e2e): better pty tooling and more tests 2025-06-28 16:56:09 +02:00
alexandre pasmantier
b780fa1ba5 test(e2e): add proper e2e tests and pty-testing utils 2025-06-28 16:56:09 +02:00
LM
14804f50a2 perf: pre-allocate result vectors, and reuse picker entries to avoid reallocations (#551)
before

![flamegraph-before](https://github.com/user-attachments/assets/92f30f0f-51da-4d96-b22b-11de99f27c86)

after

![flamegraph-after](https://github.com/user-attachments/assets/39fda567-e7fd-4e17-9c42-9d088a853974)

ran with this command
```
cargo flamegraph --no-inline -c 'record -F 997 --call-graph dwarf --no-inherit' --profile=profiling -- --cable-dir ./cable --config-file ./.config/config.toml files ~/
```
2025-06-28 16:56:09 +02:00
LM
19d1ca1558 perf: more pre-allocations and avoid unnecessary ascii string parsing work (#550)
before

```
cargo bench --bench main -- --save-baseline before
    Finished `bench` profile [optimized] target(s) in 0.13s
     Running benches/main.rs (target/release/deps/main-8151fda9d09b6257)
results_list            time:   [16.002 µs 16.095 µs 16.190 µs]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild

Benchmarking draw: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.6s, or reduce sample count to 80.
draw                    time:   [2.0829 ms 2.2517 ms 2.4277 ms]
```

after

```
cargo bench --bench main -- --baseline before
    Finished `bench` profile [optimized] target(s) in 0.08s
     Running benches/main.rs (target/release/deps/main-8151fda9d09b6257)
results_list            time:   [8.2873 µs 8.3418 µs 8.3963 µs]
                        change: [-49.407% -48.880% -48.360%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) low mild

Benchmarking draw: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.4s, or reduce sample count to 90.
draw                    time:   [1.3345 ms 1.4388 ms 1.5460 ms]
                        change: [-42.872% -36.105% -29.053%] (p = 0.00 < 0.05)
                        Performance has improved.
```

---------

Co-authored-by: Alex Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
2025-06-28 16:56:09 +02:00
lalvarezt
f138e8a591 refactor(screen): remove leftover line number, not used anymore 2025-06-28 16:56:09 +02:00
lalvarezt
80cb6c3606 refactor(picker): new movement system 2025-06-28 16:56:09 +02:00
lalvarezt
2fdb47fc19 refactor(cable): add helper function to get keybindings 2025-06-28 16:56:09 +02:00
lalvarezt
4b338f5242 refactor(shell): make use the new Binding system 2025-06-28 16:56:09 +02:00
lalvarezt
7ac2f28be7 refactor(screen): new result line abstraction that can be reused 2025-06-28 16:56:09 +02:00
alexandre pasmantier
51617b1775 refactor: clearer separation of channels vs remote, better deserialization of prototype sub-structures, etc. 2025-06-28 16:56:09 +02:00
lalvarezt
a49f104670 feat(channel): add channel global shortcuts 2025-06-28 16:56:09 +02:00
alexandre pasmantier
ebca4d2017 refactor(cli): move cli overrides to dedicated function 2025-06-28 16:56:09 +02:00
LM
510e7b6338 feat(ui): add support for customizing input_header, preview_header and preview_footer
This PR adds support for customizing

* input_header
* preview_header
* preview_footer

all the items are of type MultiTemplate, this gives some flexibility
when showing the selected value, let's say on the preview header, if
it's long or you want only a section

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
ab1efed88d chore: remove stale FIXME comment 2025-06-28 16:56:09 +02:00
alexandre pasmantier
e06e5e6a37 refactor(cable): update preview size for files and env 2025-06-28 16:56:09 +02:00
LM
783d96bb67 feat(ui): preview size customization (#545)
This PR adds support for configuring the preview panel size through the CLI, the configuration file, and cable files.
2025-06-28 16:56:09 +02:00