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
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
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
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
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