Skip to content
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

diff editor: bundle a new :builtin-web GUI diff editor #3292

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on May 6, 2024

  1. Run cargo update

    ilyagr committed May 6, 2024
    Configuration menu
    Copy the full SHA
    c5749e3 View commit details
    Browse the repository at this point in the history
  2. diff editor: bundle a new :builtin-web GUI diff editor

    When called with `--tool :builtin-web`, `jj` will start a local web server and
    open a web browser with a GUI to edit the diff. See
    https://github.com/ilyagr/diffedit3 for more details (or to run it as a
    standalone executable). This is the diff editor previously advertised in
    martinvonz#3094, based on CodeMirror5, with
    some improvements since.
    
    I would like to bundle it with `jj` so that everybody has access to a GUI diff
    editor that can be run locally or over SSH (with port forwarding). It is
    intended for situations where it is a fuss (or impossible) for a user to install
    Meld and use the `meld-3` configuration.
    
    Some TODOs and thoughts:
    
    - This diff editor is somewhat restricted; it will ignore symlinks and currently
    has no support for executable bits for example. There are some known bugs, see
    e.g. the end of [the `diffedit3
    README](https://github.com/ilyagr/diffedit3/?tab=readme-ov-file#shorter-term-todos-and-known-bugs).
    I'm hoping it's already usable.
    
    - Bundling the diff editor seems to add ~1.5MB to the `jj` binary. This is more
    than I expected. Unless there's a way to optimize this, I'm thinking of making
    the diff editor an optional feature, but I'd like it enabled by default, at
    least in release binaries. Or we could not worry about it.
    
    - I'm considering folding the `diffedit3` repo (or the majority of it) into the
    jj source repo, so that it benefits from Dependabot, established code review
    procedures, and the reviewers we have for `jj`. The downside is that `jj` will
    then contain some Typescript code. However, there will be no need to install
    `node` or `npm` *unless* you are specifically working on the webapp; the
    "compiled" webapp is included in the repo.
    
    - Currently, `:builtin-web` works just like an external diff editor, creating a
    temporary directory on disk and then modifying it. At some point, we might want
    to switch to keeping the tree in-memory.
    ilyagr committed May 6, 2024
    Configuration menu
    Copy the full SHA
    4121a41 View commit details
    Browse the repository at this point in the history