-
Couldn't load subscription status.
- Fork 62
feat(ultracompact): Adds setting for ultracompact mode #72
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
base: main
Are you sure you want to change the base?
Conversation
442d4b2 to
fc93cf8
Compare
### What does this PR do? Adds simple navigation to the inspector, to explore a session starting from a single command. This creates a new user flow, where a user can find a history entry in the interactive view (in, say, Global mode), and hit Ctrl+o to navigate back and forward through that command's session. IMAGINED USE-CASE: I remembered that I did a sequence of git steps but I can't remember the order and forgot to document it. I remember that `reflog` was involved and want to see the actual sequence, and only those commands. IMAGINED USE-CASE: I used a curl command to get my IP address for greenlisting before I connected to the bastion server `abc.xyz` over SSH - I could easily find the SSH command with abc.xyz, and go back one step in the session, but without this change, scrolling through all my curl commands ever run to find a forgotten URL/domain would be too much work. Since this gives the inspector tab a broader purpose than viewing analytics, it needs to function even when there are not enough screen rows for charts -- hence, this PR also introduces an ultracompact mode for the inspector that _just_ shows the neighbouring history commands (as simple scrolling three-entry list, with no panes) if there are fewer than `auto_hide_height` rows (default: 8). Otherwise, the inspector behaves as normal, except that Up / Down will change the focused command by navigating through the session. That means there is no "compact" mode for the inspector - when the interactive search is compact (but not ultracompact), the inspector shows its usual chart view. The UX for this could be improved - to keep this PR as lean as it realistically can be, I have tried to keep the flow very minimal, but a follow-up PR could introduce some tooltips, nicer ultracompact formatting, etc. A minor QoL improvement that comes with this - since I had to deal with bold text and would otherwise have need a theming exception, I took the opportunity to ensure the theme engine sets styles completely (so a theme can have bold), not just colours. To limit scope creep, I do not add TOML syntax so (for now) you can only customize colours from config files, but it means that default-bold text (etc.) can now use the theming engine if the code-defined default Meaning is bolded. Key changes: * introduces a simplified inspector tab, with only previous-current-next commands as rows, in compact mode * allows navigation through session history within the inspector (so compact inspector view is still useful) It also (see comments below): * makes `compact` into `compactness`, an enum (to better standardize across inspector/interactive) * makes the inspector _only_ change layout for ultracompact mode, which is still compact+(height<8) * clippy's complexity limit wanted draw split up a little, so not sure if this is a reasonable minimal way to do so for now * adds a `(none)` theme to the theming to enable output testing without styling * ~~additional tests, although keen for input on how best to do these~~ one functional test, as a starting point * ~~documentation~~ [minor doc changes only](atuinsh/docs#72), as I am not sure there is much to say <!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> _Was stacked on #2357, which is now in `main`_ ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing
|
This looks fine to me and I think it should land because atuinsh/atuin#2319 was merged. |
What does this PR do?
Adds the
auto_hide_heightsetting to enable/disable/configure ultracompact mode when fewer than a minimum number of lines are available and thecompactstyle has been configured. The new keybindings for the inspector are outlined also.Notes the new
(none)theme, which will be used for functional code-tests and as a fallback when the requested theme is unloadable.Corresponds to: atuinsh/atuin#2319