Skip to content

refactor: inline theme styles into renderers#651

Merged
idursun merged 25 commits into
mainfrom
inline-theme-styles-into-renderers
Apr 26, 2026
Merged

refactor: inline theme styles into renderers#651
idursun merged 25 commits into
mainfrom
inline-theme-styles-into-renderers

Conversation

@idursun

@idursun idursun commented Apr 26, 2026

Copy link
Copy Markdown
Owner

We store the resolved styles in the CurrentPalette instance but also models had a reference to styles instances during runtime. This PR moves style resolution to ViewRect functions so that we only rely on the palette cache, effectively allowing theme change during runtime just by updating the palette.

Prerequisite for #641

@idursun idursun force-pushed the inline-theme-styles-into-renderers branch from ba79944 to 3b57fd7 Compare April 26, 2026 09:04
@zerowidth

Copy link
Copy Markdown
Contributor

Nice! Hopefully moving the style resolution to a more central location makes #641 easier. I rebased my branch on top of this, and ignoring all the mechanical changes and focusing on just the light/dark change notifications worked!

@idursun idursun merged commit 05aabbb into main Apr 26, 2026
4 checks passed
@idursun idursun deleted the inline-theme-styles-into-renderers branch April 26, 2026 17:03
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 11, 2026
This MR contains the following updates:

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

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.5`](https://github.com/idursun/jjui/releases/tag/v0.10.5)

[Compare Source](idursun/jjui@v0.10.4...v0.10.5)

This release adds several usability and customisation improvements, including dynamic theme switching, better list and input handling, new UI configuration options, and fixes for a few revision workflow issues.

#### New features

- Added dynamic light/dark theme switching, with support for terminal theme change notifications and a polling fallback where those notifications are unavailable. [#&#8203;641](idursun/jjui#641)
- Added `ui.mouse_support = false` to completely disable jjui mouse handling. [#&#8203;663](idursun/jjui#663) [#&#8203;661](idursun/jjui#661)
- Added `ui.set_window_title = false` to disable jjui's custom terminal window title. [#&#8203;341](idursun/jjui#341)
- Lua/input customisation improvements:
  - `input({ value = ... })` can now open with a pre-filled value. [#&#8203;660](idursun/jjui#660) [#&#8203;653](idursun/jjui#653)
  - `revisions.open_set_bookmark({ value = ... })` can now pre-fill bookmark names. [#&#8203;652](idursun/jjui#652)

#### Improvements

- Added `ctrl+n` / `ctrl+p` as up/down aliases in input-driven lists, so list navigation works without leaving the home row. [#&#8203;667](idursun/jjui#667) [#&#8203;666](idursun/jjui#666)
- Improved the details view styling so explanatory hints remain readable when a file row is selected.
- Custom TOML actions can now define their binding inline with the action, instead of requiring a separate `[[bindings]]` entry.
  ```toml
  [[actions]]
  name = "new after"
  lua = '''
    jj("new", "-A", context.change_id(), "--no-edit")
    revisions.refresh()
  '''
  seq = ["\\", "n", "a"]
  scope = "revisions"
  ```

#### Fixes

- Fixed Lua scripts that chain built-in actions so each step waits for the previous one to finish before continuing.
- Added `@` and `f` bindings in revert mode for jumping to the working copy and ace-jump navigation. [#&#8203;662](idursun/jjui#662)
- Fixed squash preview refresh when moving to the target revision. [#&#8203;658](idursun/jjui#658)
- Fixed split hints in details view so they follow checked files instead of the currently hovered unchecked file. [#&#8203;659](idursun/jjui#659)
- Fixed revision selection after rewrite operations so focus stays on the intended row.

#### What's Changed

- refactor: inline theme styles into renderers by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;651](idursun/jjui#651)
- Dynamic light/dark switching by [@&#8203;zerowidth](https://github.com/zerowidth) in [#&#8203;641](idursun/jjui#641)
- feat(bookmark): pre-fill bookmark name via open\_set\_bookmark value arg by [@&#8203;rdeaton](https://github.com/rdeaton) in [#&#8203;652](idursun/jjui#652)
- feat(input): allow pre-filled value for input field by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;660](idursun/jjui#660)
- feat(ui): config setting to completely disable mouse support by [@&#8203;shoce](https://github.com/shoce) in [#&#8203;663](idursun/jjui#663)
- feat(ui): add ctrl-n/p list navigation aliases by [@&#8203;vvvu](https://github.com/vvvu) in [#&#8203;667](idursun/jjui#667)

#### New Contributors

- [@&#8203;rdeaton](https://github.com/rdeaton) made their first contribution in [#&#8203;652](idursun/jjui#652)
- [@&#8203;shoce](https://github.com/shoce) made their first contribution in [#&#8203;663](idursun/jjui#663)
- [@&#8203;vvvu](https://github.com/vvvu) made their first contribution in [#&#8203;667](idursun/jjui#667)

**Full Changelog**: <idursun/jjui@v0.10.4...v0.10.5>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- 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 [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjkuNCIsInVwZGF0ZWRJblZlciI6IjQzLjE2OS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
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.

2 participants