4 Commits
Author SHA1 Message Date
ibrahim dursunandGitHub 80b1c64db3 feat(lua): make default actions overridable and expose jjui.builtin.* (#577)
* refactor(resolver): resolve lua based actions first

* feat(lua): add `builtin` namespace

This change defines `jjui.builtin` namespace so that they are still accessible even if the custom lua script overrides a default action. Handy for adding extra functionality around the existing actions without changing the bindings.

example:

```lua
  config.action("revisions.move_down", function()
    jjui.builtin.revisions.move_down()
    flash("down")
  end)
  config.action("revisions.refresh", function()
    jjui.builtin.revisions.refresh()
    jjui.wait_refresh()
    flash("refresh completed")
  end)
```

* refactor: don't jump to parent after toggling select

but instead use action override `revisions.toggle_select` to keep backwards compability
2026-03-04 02:58:44 +00:00
ibrahim dursunandGitHub e1fe705d1c Refactor/Lua bridge (#572)
* chore: reorder bindings (so that they match the order in previous releases)

* feat(lua): add `wait_close` and `wait_refresh`

* refactor: make action names consistent

* fix: make sure all operations return close applied message
2026-03-02 13:07:11 +00:00
ibrahim dursunandGitHub 36c0c3dc3e Unified Actions + Bindings system (#533)
* feat: introduce actions + bindings

This removes the leader + custom commands in favour of actions +
bindings system.

All hardcoded keybindings are removed from models and tea.KeyMsg
handling code is removed. Instead, all tea.KeyMsg's are handled by the
dispatcher. 

All the builtin-actions are generated from jjui:bind annotations via a
generator. Dispatcher maps the tea.KeyMsg against a binding and updates
the target model with the action's Intent struct.

* refactor: move dispatch logic out of ui and to its own package

* refactor: file_search bindings

* build: remove treefmt check

we already run `go fmt` before building the appp

* refactor: move and decouple intents

* decouple confirmation model's next/prev actions from using revisions navigate intent
* move ui level `Cancel` and `Apply` intents out of revset

* fix: add missing preview toggle bindings to oplog

* docs: update

* refactor: drop `ui` prefix from most of the panels

`ui` is only used refering to shell actions (e.g. `quit`, `suspend`)

* feat: add custom command migration cli arg

jjui --config --migrate

* copies `config.toml` as `config.old.toml` (if doesn't exist)
* read `config.old.toml`
* converts `custom_command` section to new action + binding system
* saves the rest of the config + new action + binding - custom_commands

* feat: add config.lua

* feat: inline action definitions in config.lua

* feat: load external lua files from `$CONFIG/plugins/*.lua`

* fix: remove dedup of bindings in status list

* refactor: reorder revisions bindings

* refactor: move `desc` from action to binding

It's where it makes more sense because actions can have args which change the meaning of the binding.

* refactor: rename `target` to `target_picker`

* refactor: migrate and remove tests

This is throw away code.

Previous version skipped over keys, didn't convert lua based custom commands and used regex to clean up TOML (which didn't always match)

* fix: cancelling `input` should finish the lua script

* refactor: simplify close/cancel logic

* fix(bookmarks): fix excessive single shortcut assignments

* chore: update README.md, configuration and migration messages
2026-02-17 23:05:13 +00:00
ibrahim dursun ad427aee7a feat(lua): add context module 2026-01-12 20:56:39 +00:00