Skip to content

Conversation

@philtweir
Copy link
Contributor

@philtweir philtweir commented Aug 3, 2024

What does this PR do?

Adds the auto_hide_height setting to enable/disable/configure ultracompact mode when fewer than a minimum number of lines are available and the compact style 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

@philtweir philtweir force-pushed the feat/ultracompact-mode branch from 442d4b2 to fc93cf8 Compare December 29, 2024 14:38
ellie pushed a commit to atuinsh/atuin that referenced this pull request Oct 20, 2025
### 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
@jaywgraves
Copy link

jaywgraves commented Oct 27, 2025

This looks fine to me and I think it should land because atuinsh/atuin#2319 was merged.
I upgraded today and that PR was in the changelog but it wasn't immediately apparent how to navigate in Inspect mode.
(in hindsight it was obvious but I only ever interacted with Inspect mode with Ctrl keybindings so I was expecting something like that rather than the arrow keys)

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