Skip to content

feat: show search results while typing - #1925

Closed
U-L-M-S wants to merge 12 commits into
pystardust:masterfrom
U-L-M-S:feature/live-search
Closed

U-L-M-S wants to merge 12 commits into
pystardust:masterfrom
U-L-M-S:feature/live-search

Conversation

@U-L-M-S

@U-L-M-S U-L-M-S commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • Feature
  • Documentation update

Description

You no longer have to know the exact name. The search prompt is an fzf list: while you type, ani-cli asks the site again and fills the list with what it finds, Enter picks a result and goes straight to the episodes. Typing Da shows every title the site matches on "Da".

grafik

What changed

  • The search prompt reloads the results on every change (debounced 0.3 s, a new keystroke cancels the previous request).
  • Enter on a result skips the old "Select anime" step. Enter on an empty list runs the old search with what you typed. Esc exits.
  • New --search <query> prints the result list, the prompt uses it, scripts can too.
  • Needs fzf 0.25 or newer, older versions keep the plain prompt. ani-cli <name>, -S, -N, rofi and dmenu are unchanged.
  • Version 5.3.0.

Cost

Each keystroke fetches the full search page (about 300 KB), the site has no lighter suggest endpoint. On slow connections the list lags a little behind the typing.

Checklist

  • any anime playing
  • bumped version

  • next, prev, replay and select work
  • -c history and continue work
  • -d downloads work
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • -q quality works
  • -s syncplay works
  • -v vlc works
  • --dub and regular (sub) mode both work
  • --nextep-countdown countdown to next ep works

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Additional Testcases

(these don't block a merge)

  • --skip ani-skip works
  • --no-detach no detach works
  • --exit-after-play auto exit after playing works

Copy Pasta

./ani-cli -V
./ani-cli -S 1 -e 1 -d flcl
./ani-cli -S 1 -e 1 -q worst -v flcl
./ani-cli -c -s --dub
./ani-cli
./ani-cli --search "dan da dan"
sh tests/parse.sh

Search results now carry a details column next to the title.

- Parse type, total, sub and dub episode counts from the search page
- fzf hides the id column and aligns the details before the title
- rofi, dmenu and custom menus get the same details as plain text
- Bump version to 5.2.0
The anime menu shows the facts of the highlighted title next to the list.

- New --info option prints title, Japanese name, aired dates, status,
  score, genres, studios, rating and synopsis of an anime id
- fzf runs the script with --info for the highlighted row, in search
  and in continue mode; ANI_CLI_MENU_FLAGS=--no-preview turns it off
- Entity decoding shared between search results and details
Terminals under 100 columns get the pane at the bottom so titles stay readable.
The details show every season of the highlighted anime and mark the current one.
README FAQ and man page explain the new columns, the --info option and how to hide the pane.
Season names with & or quotes showed their html entities.
The page ends without a newline, so read skipped the final result of every search.
Saved pages feed the search and details parsers, so the regexes can be checked without the network.

- tests/parse.sh loads the functions of ani-cli and compares against expected output
- Search fixture covers Japanese, Chinese and Korean titles, brackets, slashes,
  pipes, backslashes, quotes, ampersands, tabs, missing dub and unknown totals
- Details fixture covers entities, multi-word genres, seasons and a distractor block
- CI runs the tests, CONTRIBUTING and the PR template mention them
shellcheck 0.10 and newer report SC2329 for the network stub that the loaded functions call indirectly.
The search prompt is an fzf list now: every change asks the site again and shows what it found, Enter picks a result straight away.

- New --search option lists the results for a query, the prompt reloads it while typing
- Works with fzf 0.25 and newer, older versions keep the plain prompt
- A query on the command line, -S and -N keep the old flow
- Bump version to 5.3.0
README FAQ and man page mention the live results and the --search option.
Old fzf versions must keep the plain prompt, newer ones get the live results.
@port19x

port19x commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Closing as bloated duplicate of #1923
You may keep your branch around until one of your implementations merges. Up to you.

@port19x port19x closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants