Comments (8)
I thought it was a great idea and extended a bit: moving the rows one column to the right and putting simple ascii characters (v
and ^
to indicate if there are more items below or above. Up until now I've avoided using non-ascii characters in the interface.
It looks good if the page size is large enough but a bit cluttered with small page sizes and the difference in size between "v" and "^" bothers me, here are some examples: https://asciinema.org/a/PUfZvHkio1YWve9lRbxC2cqff
On the other hand, using unicode triangles makes it look a bit better: https://asciinema.org/a/yQtrRCrUqXMhr7IM4t1M8SSAH
Still not feeling really good with the layouts though
from inquire.
If you even add theming feature, anybody would able to change "arrow" chracters :) Now I am agree that sticking to ASCII makes everything work everywhere and with any font.
I used unicode arrows to emphasize my idea.
from inquire.
At this moment I can only suggest this: there is always a space between cursor >
and an item. What if replace the space with ↑
(for top line) and ↓
(for bottom line) when the item is not the very first/last one? E.g, we have list ['First', 'Second', 'Third', 'Fourth', 'Fifth'] and display only 3 items at a time:
>↑Second
Third
↓Fourth
> First
Second
↓Third
It can be done for all lists: regular and checkbox ones.
from inquire.
In my opinion, one column also look good. When we are at the top of the list, there is no "up" triangle, and this place can be occupied by a pointer to an item in the list:
▶ Banana
Apple
Strawberry
Grapes
▼ Lemon
Banana
Apple
▶ Strawberry
Grapes
▼ Lemon
▲ Apple
Strawberry
▶ Grapes
Lemon
▼ Tangerine
▲ Grapes
Lemon
▶ Tangerine
Watermelon
Orange
from inquire.
That's an awesome idea, I've implemented it and it looks great.
from inquire.
One question: How does it look in case of Banana
is not the first and there is something above it?
As far as I understand the idea, If there is anything hidden above or below, the cursor is always in the middle of the list? Correct? If so, that's neat. Good idea!
from inquire.
As far as I understand the idea, If there is anything hidden above or below, the cursor is always in the middle of the list? Correct?
Exactly :)
If so, that's neat. Good idea!
Completely inspired on similar libs from other languages!
from inquire.
Closed by 5a74c48
from inquire.
Related Issues (20)
- Adding separator for multi select HOT 2
- help: how can I validate this? HOT 1
- inquire's prompt causes spurious wake-ups HOT 1
- Allow re-rendering after the data in a prompt becomes stale (maybe by allowing cancellation?) HOT 2
- Doubt about the example provided in the documentation HOT 1
- Editer can't capture the data.. HOT 1
- Allow DateSelect to return multiple dates
- Print to stdout while in a prompt HOT 1
- Release HOT 1
- Use tty instead of stdin HOT 1
- with_starting_cursor does not apply HOT 2
- Fully support piped inputs in parallel with interactive inputs.
- Prompt crashes if program is run with crossterm+piped input+macos
- Add code coverage metrics to get a better idea of test coverage
- inquire derive and attribute macro HOT 3
- Show proper error message for CustomType prompt HOT 1
- Alt+{left, right, backspace} support HOT 3
- DateSelect default help message incorrect ? HOT 2
- Support for up-arrow previous prompt history, and control-keys HOT 2
- Inquire leaves the terminal in a broken state HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inquire.