Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
term: Switch to `indicatif` spinner
Merged did:key:z6MkgFq6...nBGz opened 9 months ago

This replaces the current spinner implementation with the one that is provided by indicatif.

Rationale

The current spinner breaks the output on narrow terminals for long spinner messages. This results in the spinner filling up the terminal with a new line for every progress update.

A few other spinner libraries e.g. spinners where taking into consideration, but indicatif turned out to be the best choice in terms of flexibilty and future maintenance. The drawback is obviously that indicatif is built on top of console, yet another terminal abstraction library that is added to our dependencies besides crossterm. But it can be argued, that crossterm is rather low-level, whereas console is more high-level, thus having both is a valid use case.

In order to be able to replace the current spinner with indicatif, the standard I/O stream abstraction was refactored and now provides a RenderTarget, which supports switching streams.

Additionally, it introduces output macros for warnings and errors.

did:key:z6MkgFq6...nBGz opened with revision f0ab7c0b on base 54fd8c40 +250 -238 9 months ago

This replaces the current spinner implementation with the one that is provided by indicatif.

Rationale

The current spinner breaks the output on narrow terminals for long spinner messages. This results in the spinner filling up the terminal with a new line for every progress update.

A few other spinner libraries e.g. spinners where taking into consideration, but indicatif turned out to be the best choice in terms of flexibilty and future maintenance. The drawback is obviously that indicatif is built on top of console, yet another terminal abstraction library that is added to our dependencies besides crossterm. But it can be argued, that crossterm is rather low-level, whereas console is more high-level, thus having both is a valid use case.

In order to be able to replace the current spinner with indicatif, the standard I/O stream abstraction was refactored and now provides a RenderTarget, which supports switching streams.

Additionally, it introduces output macros for warnings and errors.

did:key:z6MkwcUR...q1kL reviewed · 2 comments 8 months ago

In general this LGTM, but there are two instances where stderr should be used IMHO instead of stdout,… and I am not sure whether stdout is used on purpose (if, a comment would be nice).

lorenz pushed revision 2 790e6906 on base 55cdd880 +250 -245 8 months ago

Rebased and added two review commits.

While the direction is good in terms of UI, I don’t like that signal handling is removed. Erik, do you have a plan there? I would like to get at least the level of signal handling back that we had before, maybe even the ability to forward the intent of the user to stop the process.

did:key:z6MkgFq6...nBGz pushed revision 3 002002c0 on base 646d4360 +247 -101 7 months ago

This revision is a fresh start and aims to leave the inners of the spinner intact as much as possible. It also get’s rid of the newly introduced output macros. These replicate a weird existing pattern that should probably be removed in the future anyways.

fintohaps pushed revision 4 0d08d6b8 on base 646d4360 +246 -102 7 months ago

REVIEW: static template

Use static + LazyLock to ensure that the templates evaluation only happens once and the value can be re-used on each subsequent access.

did:key:z6MkgFq6...nBGz pushed revision 5 fde48ebc on base 646d4360 +246 -102 7 months ago

Incorporate review.

did:key:z6MkgFq6...nBGz pushed revision 6 05736ca6 on base 646d4360 +245 -102 7 months ago

Rename DrawTarget to PaintTarget (since we have a Paint type already).

lorenz pushed revision 7 8cf2b2e0 on base 37903795 +245 -102 7 months ago

Rebase

lorenz merged revision 8cf2b2e0 at 66adbffd 7 months ago