[Question] Adding search to custom widgets
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by comparing the custom ListView based on FormattedTextControl with the existing BufferControl search path. Read the default key bindings, prompt_toolkit.search module, and is_searching filters to understand the current coupling. Done would mean a documented, maintainable way to add search or filtering to custom widgets without duplicating the existing search logic.
Written by the indexing model from the issue text.
Description
Hi,
I am a new user of prompt_toolkit and so far like it. I am using it display and explore data from different APIs on the commandline. One such API is a Work/Task scheduling systems and I need to make information available for ~1000 subtasks at once.
To do this I wrote a widget ListView, which is based on a FormattedTextControl. This was really easy (and I consider how easy it was a major selling point for prompt_toolkit). However I struggle to find a good way to add search/filtering to it.
As far as I know the buildin search functionality is hardwired to BufferControl and even has isinstance checks in place. It's quite intrusive as well in the sense that from default key_bindings, to the prompt_toolkit.search module and the is_searching filters there is a lot that taps into it.
Do you have any suggestions on how to proceed? My current plan of action would be to just duplicate a lot of the logic into the 'ListView'-Widget. Are there any lessons learned from implementing the current search functionality?
I'd be grateful for any advice. Thank you! :-)
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prompt-toolkit/python-prompt-toolkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
prompt-toolkit/python-prompt-toolkit#2073 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
prompt-toolkit/python-prompt-toolkit#1154 · 1 comment ·
All issues in prompt-toolkit/python-prompt-toolkit
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·