Skip to content

feat: add diff and preview show intents#593

Merged
idursun merged 2 commits intomainfrom
feat/add-diff-preview-show-intents
Mar 14, 2026
Merged

feat: add diff and preview show intents#593
idursun merged 2 commits intomainfrom
feat/add-diff-preview-show-intents

Conversation

@idursun
Copy link
Copy Markdown
Owner

@idursun idursun commented Mar 13, 2026

This change adds show actions to diff and ui.preview, allowing custom actions to populate those panels with the output of commands they run themselves. It restores the old “send command output to diff” workflow.

Example:

config.action("show diff summary in diff", function()
  local output = jj("diff", "-r", context.change_id(), "--summary", "--color", "always")
  diff.show(output)
end, {
  key = "shift+x",
  scope = "revisions",
})

config.action("show diff summary in preview", function()
  local output = jj("diff", "-r", context.change_id(), "--summary", "--color", "always")
  ui.preview.show(output)
end, {
  key = "ctrl+shift+x",
  scope = "revisions",
})

Internally, built-in diff loading was also moved onto the same diff.show path, and show now opens the target panel automatically if needed.

fixes #579
fixes #589

#587

baggiiiie
baggiiiie previously approved these changes Mar 14, 2026
Copy link
Copy Markdown
Collaborator

@baggiiiie baggiiiie left a comment

Choose a reason for hiding this comment

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

nice!

@idursun idursun force-pushed the feat/add-diff-preview-show-intents branch from 7f9045c to db29c64 Compare March 14, 2026 08:05
@idursun
Copy link
Copy Markdown
Owner Author

idursun commented Mar 14, 2026

had to rebase to resolve conflict

@idursun idursun merged commit 79c5365 into main Mar 14, 2026
4 checks passed
@idursun idursun deleted the feat/add-diff-preview-show-intents branch March 14, 2026 08:07
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 17, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [idursun/jjui](https://github.com/idursun/jjui) | patch | `v0.10.1` → `v0.10.2` |

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>idursun/jjui (idursun/jjui)</summary>

### [`v0.10.2`](https://github.com/idursun/jjui/releases/tag/v0.10.2)

[Compare Source](idursun/jjui@v0.10.1...v0.10.2)

Quick release to continue the release early, release often streak.

##### Features

- **Custom diff and preview content** — You can now use `diff.show()` and `ui.preview.show()` in your Lua actions to display custom command output in the diff and preview panels. ([#&#8203;593](idursun/jjui#593))

##### Bug Fixes

- **Rebase source + insert between** — Rebase now correctly uses `-s` (source) instead of `-r` when combining source mode with insert-between. ([#&#8203;598](idursun/jjui#598))
- **Missing actions in status bar** — Actions with the same name in different scopes (e.g. `revset.edit` and `revisions.edit`) are no longer hidden from the status bar. ([#&#8203;595](idursun/jjui#595))
- **Misaligned lines across terminals** — Terminals handle Unicode width calculation differently — Ghostty enables grapheme clustering by default while Kitty does not. We now detect the terminal's width mode and calculate widths accordingly, fixing rendering in both. ([#&#8203;592](idursun/jjui#592))
- **Operation action overrides** — Some built-in actions during operations couldn't be overridden in `config.lua`. For example, `revisions.details.diff`, `revisions.evolog.diff`, and `revisions.rebase.*` actions can now be properly overridden. ([#&#8203;586](idursun/jjui#586), [#&#8203;598](idursun/jjui#598))

#### What's Changed

- fix(render): detect terminal width method by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;592](idursun/jjui#592)
- feat: add diff and preview show intents by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;593](idursun/jjui#593)

**Full Changelog**: <idursun/jjui@v0.10.1...v0.10.2>

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, 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:eyJjcmVhdGVkSW5WZXIiOiI0My43Ny4wIiwidXBkYXRlZEluVmVyIjoiNDMuNzcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
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.

Flickering when using exec_shell to launch external diff viewer Migration doc suggests using jj_async with jj diff,

2 participants