Skip to content

revision: fix double rendering of inline describe content#403

Merged
idursun merged 2 commits intoidursun:mainfrom
baggiiiie:yc/item_render
Dec 1, 2025
Merged

revision: fix double rendering of inline describe content#403
idursun merged 2 commits intoidursun:mainfrom
baggiiiie:yc/item_render

Conversation

@baggiiiie
Copy link
Copy Markdown
Collaborator

revision: fix double rendering of inline describe content

Previously, inline describe content was rendered twice when the next
line in the revision list contains only a revision line (no separate
description lines below it)

Added a new tracking flag revisionLineRendered to properly sequence
the description overlay rendering, which tracks revision line rendering.

Following checks are made before rendering the description overlay:

  • currently on a highlighted row AND
  • revision line has already been rendered AND
  • we need to render the description overlay AND
  • we haven't already rendered it AND
  • the current line is highlightable

Fixes #369

revision: break down item_renderer Render logic

revision: break down item_renderer Render logic
Refactored Render logic to smaller functions, separated into different
rendering logic, such as rendering for:

  • before revision line,
  • revision line,
  • gutter
  • etc

Also, removed unused function aceJumpIndex.

others

the second commit is a bigger change with refactor
if the change list is too large, i could separate the two commits and submit individually

Previously, inline describe content was rendered twice when the next
line in the revision list contains only a revision line (no separate
description lines below it)

Added a new tracking flag `revisionLineRendered` to properly sequence
the description overlay rendering, which tracks revision line rendering.

Following checks are made before rendering the description overlay:
- currently on a highlighted row AND
- revision line has already been rendered AND
- we need to render the description overlay AND
- we haven't already rendered it AND
- the current line is highlightable

Fixes idursun#369
Refactored `Render` logic to smaller functions, separated into different
rendering logic, such as rendering for: 
- before revision line, 
- revision line,
- gutter
- etc

Also, removed unused function `aceJumpIndex`.
@idursun
Copy link
Copy Markdown
Owner

idursun commented Dec 1, 2025

Hey, thanks! I'll have a look at this.

I couldn't reproduce it on my end but I assume you could and I am happy to see some tests. 🙌🏿

@baggiiiie
Copy link
Copy Markdown
Collaborator Author

@idursun

i wasn't too sure about this project's test philosophy since it's still being rapidly developed and refactored, but i've seen you are adding quite some tests lately, i'll help out and add tests when appropriate!


the bug happens when a non-root revision's parent in the graph is elided

to reproduce:

  • create a revision with multiple children (in below recording, the parent's change id is u)
  • changes revset to $ParentChangeID.. ( u.. in this case)
  • in each branch, parent node becomes elided
  • press enter on any of the children revision of u

asciicast

Copy link
Copy Markdown
Owner

@idursun idursun left a comment

Choose a reason for hiding this comment

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

Thanks, I was able to reproduce the issue with your instructions and these changes are fixing it!

@idursun
Copy link
Copy Markdown
Owner

idursun commented Dec 1, 2025

i wasn't too sure about this project's test philosophy since it's still being rapidly developed and refactored, but i've seen you are adding quite some tests lately, i'll help out and add tests when appropriate!

The plan is to test as much as possible but writing tests was a lot of pain before. I find it easier to write tests now, therefore adding whenever I can.

@idursun idursun merged commit 8e43994 into idursun:main Dec 1, 2025
3 checks passed
@baggiiiie baggiiiie deleted the yc/item_render branch December 2, 2025 01:01
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 3, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [idursun/jjui](https://github.com/idursun/jjui) | patch | `v0.9.6` -> `v0.9.7` |

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

[Compare Source](idursun/jjui@v0.9.6...v0.9.7)

🎉 This release enhances performance and introduces stability improvements in log parsing and command execution. It also takes back some of the stability by adding basic mouse support.

#### Features

##### 📈 Performance Improvements

Implemented frame-rate limited rendering (capped at 120 FPS) to significantly improve application performance by deferring view generation until the next frame tick. This addresses the slowest path in the application - view generation - making it much more responsive

##### 🐭 Mouse Support

- Clickable and scrollable revisions view (excluding operations) ([#&#8203;391](idursun/jjui#391))
- Clickable and scrollable op log view
- Draggable and scrollable (vertically + horizontally) preview pane
- Scrollable diff window
- Replaced custom viewport with bubbles/viewport for more responsive rendering ([#&#8203;396](idursun/jjui#396))

<https://github.com/user-attachments/assets/7cbad275-713e-4fa3-8d61-4e86c301ab0c>

##### 🔎 Preview

- Replaced surrounding border with divider for more preview space ([#&#8203;396](idursun/jjui#396))

##### Operation Log (oplog)

- Added `jj op revert` functionality with `R` key binding ([#&#8203;400](idursun/jjui#400))

##### Revset Handling

- Pressing up arrow in empty revset field now sets the current revset ([#&#8203;284](idursun/jjui#284))
- Fixed mismatch where empty revset input would use config default instead of session default from `-r` flag. Now correctly updates `CurrentRevset` to session default instead of empty string ([#&#8203;399](idursun/jjui#399))

##### Details View

- Allow quitting from details view when quit key is pressed (e.g. `q`)

#### Bug Fixes

##### Rendering Issues

- Fixed double rendering of inline describe content when next line contains only revision line. Added `revisionLineRendered` tracking flag to properly sequence the description overlay rendering ([#&#8203;403](idursun/jjui#403), [#&#8203;369](idursun/jjui#369))
- Fixed viewport adjustment when PageDown moves cursor below viewport. The renderer now continues rendering until it reaches the focused item, ensuring proper viewport adjustment ([#&#8203;395](idursun/jjui#395))
- Fixed PageUp/Down navigation at top and bottom of revset when less than one page remains. Now includes early return with feedback message when already at boundary ([#&#8203;387](idursun/jjui#387), [#&#8203;386](idursun/jjui#386))
- Removed incorrect space trimming in renderer ([#&#8203;393](idursun/jjui#393))

##### Log Processing

- Applied partial fixes to prevent out-of-order row updates in log streamer

##### Details View

- Handle cases where conflict markers span multiple lines ([#&#8203;398](idursun/jjui#398))
- Ignore virtual selection on refresh ([#&#8203;381](idursun/jjui#381))

##### Operation Log (oplog)

- Fixed an issue in operation ID detection ([#&#8203;380](idursun/jjui#380), [#&#8203;377](idursun/jjui#377))

##### Command Execution

- Added a mechanism for restoring failed commands to input field, allowing retries without retyping ([#&#8203;392](idursun/jjui#392))

##### Template System

- Enhanced `jj log` parsing using native template prefixes for better change ID and commit ID detection. Fixes issues when bookmarks are "HexLike" ([#&#8203;358](idursun/jjui#358), [#&#8203;228](idursun/jjui#228), [#&#8203;372](idursun/jjui#372))

#### What's Changed

- Remove teatest package and simplify tests by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;379](idursun/jjui#379)
- internal/parser: get revision ids with template prefixes by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;372](idursun/jjui#372)
- fix(oplog): improve operation id detection by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;380](idursun/jjui#380)
- refactor: serialise command execution by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;378](idursun/jjui#378)
- Revert "refactor: serialise command execution" by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;383](idursun/jjui#383)
- revisions: fix scrolling at the top and bottom of revset by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;387](idursun/jjui#387)
- refactor: introduce and implement common.Model by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;384](idursun/jjui#384)
- refactor: Replace custom cell buffer implementation with `cellbuf` package by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;388](idursun/jjui#388)
- refactor: use simple layout functions to lay out the main UI by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;389](idursun/jjui#389)
- Coming back to previous state  when exec command failed by [@&#8203;ArnaudBger](https://github.com/ArnaudBger) in [#&#8203;392](idursun/jjui#392)
- feat: add basic mouse support by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;391](idursun/jjui#391)
- list/renderer: fix viewport adjustment on PageDown by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;395](idursun/jjui#395)
- Make preview horizontally scrollable by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;396](idursun/jjui#396)
- revset: fix revset not using default when empty by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;399](idursun/jjui#399)
- operation: add op log revert by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;400](idursun/jjui#400)
- revision: fix double rendering of inline describe content by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;403](idursun/jjui#403)
- refactor: replace usages of scattered width/height pairs with `ViewNode` by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;401](idursun/jjui#401)
- describe: catch cursor blinking to avoid unnecessary rendering by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;404](idursun/jjui#404)

#### New Contributors

- [@&#8203;ArnaudBger](https://github.com/ArnaudBger) made their first contribution in [#&#8203;392](idursun/jjui#392)

**Full Changelog**: <idursun/jjui@v0.9.6...v0.9.7>

</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:eyJjcmVhdGVkSW5WZXIiOiI0Mi4yOS40IiwidXBkYXRlZEluVmVyIjoiNDIuMjkuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

jjui duplicated description before ~

2 participants