Skip to content

Conversation

@philtweir
Copy link
Contributor

@philtweir philtweir commented Aug 10, 2024

What does this PR do?

Adds an ultracompact mode only for search (interactive.rs) and not the inspector.

  • adds a config parameter to set a line height at which to switch to ultracompact
  • 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)
  • in ultracompact view, compresses indicator row into prompt, removes any non-command lines (except help if show_help is true)

TODO

  • additional tests, although keen for input on how best to do these
  • documentation (once configuration/semantics are aligned on)

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@philtweir philtweir mentioned this pull request Aug 10, 2024
2 tasks
@philtweir philtweir changed the title Ultracompact mode (search-only) Ultracompact Mode (search-only) Aug 10, 2024
@philtweir philtweir force-pushed the feature/ultracompact-mode branch from cebcc11 to 806bf90 Compare August 24, 2024 10:00
@ellie
Copy link
Member

ellie commented Sep 9, 2024

sorry for being slow here, had a tonne on lately - haven't forgotten this and will get to reviewing it soon 🙏

@philtweir
Copy link
Contributor Author

Thanks, no worries @ellie !

@philtweir
Copy link
Contributor Author

philtweir commented Oct 7, 2024

No pressure, so if you're busy don't worry, but just to ping as I'm conscious that I'll struggle to get the necessary PR sequence right at some point, and thought I'd check in :D

Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, been a busy few weeks!

But yep looks great to me, thanks for the work! :shipit:

@ellie ellie merged commit 4c2d820 into atuinsh:main Oct 7, 2024
@ellie
Copy link
Member

ellie commented Oct 7, 2024

I'm happy for a follow up if you'd like to address testing, but tbh I've let this languish for far too long and I'm happy to have it merged as-is (sorry again!)

@philtweir
Copy link
Contributor Author

Thanks @ellie - sorry for the delay in getting back myself but appreciate you merging! Sounds good - will take a look at updating the other PR too.

@ellie
Copy link
Member

ellie commented Oct 20, 2024

Not a problem, much faster than me 🤣

@atuin-bot
Copy link

This issue has been mentioned on Atuin Community. There might be relevant details there:

https://forum.atuin.sh/t/release-v18-4-0-beta-5/614/1

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 28, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [atuinsh/atuin](https://github.com/atuinsh/atuin) | minor | `v18.3.0` -> `v18.4.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>atuinsh/atuin (atuinsh/atuin)</summary>

### [`v18.4.0`](https://github.com/atuinsh/atuin/releases/tag/v18.4.0)

[Compare Source](atuinsh/atuin@v18.3.0...v18.4.0)

#### Theme system

Thanks to [@&#8203;philtweir](https://github.com/philtweir), we now have a theming system! It's too much to write about here, so see the section in the docs: https://docs.atuin.sh/guide/theming/

#### Default changes

With this release, some defaults have changed. The most obvious will likely be the switch to the compact UI style + inline rendering

This can be reverted by setting

    style = "full"
    inline_height = 0

Read more here: atuinsh/atuin#2249

#### `atuin wrapped`

See your stats for 2024 with `atuin wrapped`

![CleanShot 2024-12-27 at 17 10 45@&#8203;2x](https://github.com/user-attachments/assets/c7853c47-4e3e-49c7-b811-c0a62ab8c259)

#### Build changes

Thanks to [@&#8203;senekor](https://github.com/senekor), we no longer require protoc available at build time, and instead use `protox`

##### Bug Fixes

-   *(crate)* Add missing description ([#&#8203;2106](atuinsh/atuin#2106))
-   *(crate)* Add description to daemon crate ([#&#8203;2107](atuinsh/atuin#2107))
-   *(daemon)* Add context to error when unable to connect ([#&#8203;2394](atuinsh/atuin#2394))
-   *(deps)* Pin tiny_bip to 1.0.0 until breaking change resolved ([#&#8203;2412](atuinsh/atuin#2412))
-   *(docker)* Update Dockerfile ([#&#8203;2369](atuinsh/atuin#2369))
-   *(history)* Logic for store_failed=false ([#&#8203;2284](atuinsh/atuin#2284))
-   *(mail)* Incorrect alias and error logs ([#&#8203;2346](atuinsh/atuin#2346))
-   *(mail)* Enable correct tls features for postmark client ([#&#8203;2347](atuinsh/atuin#2347))
-   *(theme)* Restore original colours ([#&#8203;2339](atuinsh/atuin#2339))
-   *(themes)* Restore default theme, refactor ([#&#8203;2294](atuinsh/atuin#2294))
-   *(tui)* Press ctrl-a twice should jump to beginning of line ([#&#8203;2246](atuinsh/atuin#2246))
-   *(tui)* Don't panic when search result is empty and up is pressed ([#&#8203;2395](atuinsh/atuin#2395))
-   Cargo binstall config ([#&#8203;2112](atuinsh/atuin#2112))
-   Unitless sync_frequence = 0 not parsed by humantime ([#&#8203;2154](atuinsh/atuin#2154))
-   Some --help comments didn't show properly ([#&#8203;2176](atuinsh/atuin#2176))
-   Ensure we cleanup all tables when deleting ([#&#8203;2191](atuinsh/atuin#2191))
-   Add idx cache unique index ([#&#8203;2226](atuinsh/atuin#2226))
-   Idx cache inconsistency ([#&#8203;2231](atuinsh/atuin#2231))
-   Ambiguous column name ([#&#8203;2232](atuinsh/atuin#2232))
-   Atuin-daemon optional dependency ([#&#8203;2306](atuinsh/atuin#2306))
-   Windows build error ([#&#8203;2321](atuinsh/atuin#2321))
-   Codespell config still references the ui ([#&#8203;2330](atuinsh/atuin#2330))
-   Remove dbg! macro ([#&#8203;2355](atuinsh/atuin#2355))
-   Disable mail by default, resolve [#&#8203;2404](atuinsh/atuin#2404) ([#&#8203;2405](atuinsh/atuin#2405))
-   Time offset display in `atuin status` ([#&#8203;2433](atuinsh/atuin#2433))
-   Disable the actuated mirror on the x86 docker builder ([#&#8203;2443](atuinsh/atuin#2443))

##### Documentation

-   *(README)* Fix broken link ([#&#8203;2206](atuinsh/atuin#2206))
-   Streamline readme ([#&#8203;2203](atuinsh/atuin#2203))
-   Update quickstart install command ([#&#8203;2205](atuinsh/atuin#2205))

##### Features

-   *(bash/blesh)* Hook into BLE_ONLOAD to resolve loading order issue ([#&#8203;2234](atuinsh/atuin#2234))
-   *(client)* Add filter mode enablement and ordering configuration ([#&#8203;2430](atuinsh/atuin#2430))
-   *(daemon)* Follow XDG_RUNTIME_DIR if set ([#&#8203;2171](atuinsh/atuin#2171))
-   *(history)* Filter out various environment variables containing potential secrets ([#&#8203;2174](atuinsh/atuin#2174))
-   *(tui)* Configurable prefix character ([#&#8203;2157](atuinsh/atuin#2157))
-   *(tui)* Customizable Themes ([#&#8203;2236](atuinsh/atuin#2236))
-   *(tui)* Fixed preview height option ([#&#8203;2286](atuinsh/atuin#2286))
-   Use cargo-dist installer from our install script ([#&#8203;2108](atuinsh/atuin#2108))
-   Add user account verification ([#&#8203;2190](atuinsh/atuin#2190))
-   Add GitLab PAT to secret patterns ([#&#8203;2196](atuinsh/atuin#2196))
-   Add several other GitHub access token patterns ([#&#8203;2200](atuinsh/atuin#2200))
-   Add npm, Netlify and Pulumi tokens to secret patterns ([#&#8203;2210](atuinsh/atuin#2210))
-   Allow advertising a fake version to clients ([#&#8203;2228](atuinsh/atuin#2228))
-   Monitor idx cache consistency before switching ([#&#8203;2229](atuinsh/atuin#2229))
-   Ultracompact Mode (search-only) ([#&#8203;2357](atuinsh/atuin#2357))
-   Right Arrow to modify selected command ([#&#8203;2453](atuinsh/atuin#2453))
-   Provide additional clarity around key management ([#&#8203;2467](atuinsh/atuin#2467))
-   Add `atuin wrapped` ([#&#8203;2493](atuinsh/atuin#2493))

##### Miscellaneous Tasks

-   *(build)* Compile protobufs with protox ([#&#8203;2122](atuinsh/atuin#2122))
-   *(ci)* Do not run current ci for ui ([#&#8203;2189](atuinsh/atuin#2189))
-   *(ci)* Codespell again ([#&#8203;2332](atuinsh/atuin#2332))
-   *(install)* Use posix sh, not bash ([#&#8203;2204](atuinsh/atuin#2204))
-   *(nix)* De-couple atuin nix build from nixpkgs rustc version ([#&#8203;2123](atuinsh/atuin#2123))
-   Add installer e2e tests ([#&#8203;2110](atuinsh/atuin#2110))
-   Remove unnecessary proto import ([#&#8203;2120](atuinsh/atuin#2120))
-   Update to rust 1.78
-   Add audit config, ignore RUSTSEC-2023-0071 ([#&#8203;2126](atuinsh/atuin#2126))
-   Setup dependabot for the ui ([#&#8203;2128](atuinsh/atuin#2128))
-   Cargo and pnpm update ([#&#8203;2127](atuinsh/atuin#2127))
-   Update to rust 1.79 ([#&#8203;2138](atuinsh/atuin#2138))
-   Update to cargo-dist 0.16, enable attestations ([#&#8203;2156](atuinsh/atuin#2156))
-   Do not use package managers in installer ([#&#8203;2201](atuinsh/atuin#2201))
-   Enable record sync by default ([#&#8203;2255](atuinsh/atuin#2255))
-   Remove ui directory ([#&#8203;2329](atuinsh/atuin#2329))
-   Update to rust 1.80 ([#&#8203;2344](atuinsh/atuin#2344))
-   Update rust to `1.80.1` ([#&#8203;2362](atuinsh/atuin#2362))
-   Enable inline height and compact by default ([#&#8203;2249](atuinsh/atuin#2249))
-   Update to rust 1.82 ([#&#8203;2432](atuinsh/atuin#2432))
-   Update cargo-dist ([#&#8203;2471](atuinsh/atuin#2471))

##### Performance

-   *(search)* Benchmark smart sort ([#&#8203;2202](atuinsh/atuin#2202))
-   Create idx cache table ([#&#8203;2140](atuinsh/atuin#2140))
-   Write to the idx cache ([#&#8203;2225](atuinsh/atuin#2225))

##### Testing

-   Add env ATUIN_TEST_LOCAL_TIMEOUT to control test timeout of SQLite ([#&#8203;2337](atuinsh/atuin#2337))

#### Install atuin 18.4.0

##### Install prebuilt binaries via shell script

```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-installer.sh | sh
```

#### Download atuin 18.4.0

|  File  | Platform | Checksum |
|--------|----------|----------|
| [atuin-aarch64-apple-darwin.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-apple-darwin.tar.gz.sha256) |
| [atuin-x86\_64-apple-darwin.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-apple-darwin.tar.gz.sha256) |
| [atuin-aarch64-unknown-linux-gnu.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-unknown-linux-gnu.tar.gz) | ARM64 Linux | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-unknown-linux-gnu.tar.gz.sha256) |
| [atuin-x86\_64-unknown-linux-gnu.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-unknown-linux-gnu.tar.gz.sha256) |
| [atuin-aarch64-unknown-linux-musl.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-unknown-linux-musl.tar.gz) | ARM64 MUSL Linux | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-aarch64-unknown-linux-musl.tar.gz.sha256) |
| [atuin-x86\_64-unknown-linux-musl.tar.gz](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-unknown-linux-musl.tar.gz) | x64 MUSL Linux | [checksum](https://github.com/atuinsh/atuin/releases/download/v18.4.0/atuin-x86\_64-unknown-linux-musl.tar.gz.sha256) |

#### Verifying GitHub Artifact Attestations

The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the [GitHub CLI](https://cli.github.com/manual/gh_attestation_verify):

```sh
gh attestation verify <file-path of downloaded artifact> --repo atuinsh/atuin
```

You can also download the attestation from [GitHub](https://github.com/atuinsh/atuin/attestations) and verify against that directly:

```sh
gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>
```

#### New Contributors

-   [@&#8203;senekor](https://github.com/senekor) made their first contribution in atuinsh/atuin#2122
-   [@&#8203;injust](https://github.com/injust) made their first contribution in atuinsh/atuin#2166
-   [@&#8203;davidolrik](https://github.com/davidolrik) made their first contribution in atuinsh/atuin#2196
-   [@&#8203;julienp](https://github.com/julienp) made their first contribution in atuinsh/atuin#2210
-   [@&#8203;eth3lbert](https://github.com/eth3lbert) made their first contribution in atuinsh/atuin#2246
-   [@&#8203;philtweir](https://github.com/philtweir) made their first contribution in atuinsh/atuin#2236
-   [@&#8203;lucacome](https://github.com/lucacome) made their first contribution in atuinsh/atuin#2257
-   [@&#8203;JRGould](https://github.com/JRGould) made their first contribution in atuinsh/atuin#2284
-   [@&#8203;jaxvanyang](https://github.com/jaxvanyang) made their first contribution in atuinsh/atuin#2337
-   [@&#8203;cultpony](https://github.com/cultpony) made their first contribution in atuinsh/atuin#2369
-   [@&#8203;Reverier-Xu](https://github.com/Reverier-Xu) made their first contribution in atuinsh/atuin#2433
-   [@&#8203;bboynton97](https://github.com/bboynton97) made their first contribution in atuinsh/atuin#2453
-   [@&#8203;pamburus](https://github.com/pamburus) made their first contribution in atuinsh/atuin#2430

**Full Changelog**: atuinsh/atuin@v18.3.0...v18.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44My4zIiwidXBkYXRlZEluVmVyIjoiMzkuODMuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
ellie pushed a commit 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
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.

3 participants