Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Interactive Mode for the user, an interface of the future #233

Open
bee-san opened this issue Nov 12, 2021 · 1 comment
Open
Assignees

Comments

@bee-san
Copy link
Owner

bee-san commented Nov 12, 2021

I propose we strip out the current PyWhat method of take input -> print and suggest an interactive terminal user interface. We can use Textual for this.

Imagine this. You run pywhat . to load all the files into memory, or pywhat "example text" and it opens up a terminal user interface. Alternatively, you open pywhat and it loads it up.

There will be a "search bar" that lets you search for things, like:

┌─────────────────────────────────────────────────┐
│  Serach here                                    │
├─────────────────────────────────────────────────┤
│ Files in current directory                      │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
│                                                 │
└─────────────────────────────────────────────────┘

When a user clicks on a "file in current directory" it shows a loading screen and then loads it. Alternatively the user can search a file path or enter "." or something to load every file into memory. We can even make buttons at the top like "load all files here into memory"

When a user loads something into memory, they're presented with something like Kibana (look at the "inner" app, not the outer section)
image

tags on the left, search on the top, items in the right bottom. A user can scroll through and "enter" on the tags they want.

In the search box they could write "rarity:" and a menu pops up with a suggested rarity (say 0.1) which removes all item that aren't 0.1 from the screen.

This means 2 things:

  1. When a user selects a tag on the left, it enters it into the search box
  2. When a user types in the search box, we try to auto complete it for them

So if a user searches through the entire file directory for /, they filter by "bug bounty" and exclude "credit cards" and only want rarity 0.1 - 0.6, the search bar will display:

location:"/", includes:"bug bounty", excludes:"credit cards", rarity:"0.1 - 0.6"

When the user presses "search" we search through our newly minted DB of all of these. The way Elastic makes this fast is that they add an index to every possible item (filter, bug bounties) etc to make searching fast.

We could even update as the user writes (although we'd want to be super fast).

This new interactive mode takes PyWhat from being a tool you run once, to being a tool you do analyse in and interact with :)

@Croquembouche
Copy link

Hi bee-san,

We are planning to make this GUI interface along with some regex issues

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

No branches or pull requests

2 participants