Skip to content

Sapling could use a better pager #1489

Open

Description

@stepancheg

Sapling it is huge productivity booster compared to every other tool.

But I think UI can be improved much further. Default Sapling pager pv is OK, but it can do much more.

Imagine you open sl page, but instead of just readonly tree view, it has two things:

  • it combines sl sl and sl ssl
    • status of the PR (or diff) is loaded asynchronously, so you see tree immediately, and PR status after delay
  • instead of just being pager, it allows navigation to specific commits
image

You press enter, and it shows you the diff (same as if we did sl-tui diff). But it is not simple pager either:

  • it auto-refreshes the diff while preserving scroll position
    • this is must have with agentic development — you agent is doing work in one window, and you see the changes live exactly where you were looking to follow-up
  • current file header is sticky on top!
image

Suppose you want to navigate to a different file. You press s and it shows diffstat view, where enter navigates back to diff view

image

This is what I vibe-coded in a few hours:

https://github.com/stepancheg/sl-tui

It was actually much less vibecoding that figuring out what I want: something that behaves like default sl pager, but with auto-refresh and navigation.

In some sense this is similar to sl isl, but isl feels janky, while this tool is natural extension of sl cli.

So what I want to say. Guys, consider replacing pv with similar UI.

I can try submitting a PR. I believe it would be useless, because I will be just proxy between your comments and my agent. But happy to do so if you are interested. The value here is proof of concept; code is cheap.

In any case, I'd like to point to a potential pitfall: do not use ratatui or most other tui in Rust: they don't handle line-wrapping properly — do text selection in terminal works across line (including double-click, check the following screenshot). There's somewhat tricky algorithm how to do flow of such code in terminal, but nothing a decent AI could not solve.

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions