revision: fix double rendering of inline describe content#403
revision: fix double rendering of inline describe content#403idursun merged 2 commits intoidursun:mainfrom
Conversation
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`.
|
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. 🙌🏿 |
|
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 to reproduce:
|
idursun
left a comment
There was a problem hiding this comment.
Thanks, I was able to reproduce the issue with your instructions and these changes are fixing it!
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. |
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) ([#​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 ([#​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 ([#​396](idursun/jjui#396)) ##### Operation Log (oplog) - Added `jj op revert` functionality with `R` key binding ([#​400](idursun/jjui#400)) ##### Revset Handling - Pressing up arrow in empty revset field now sets the current revset ([#​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 ([#​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 ([#​403](idursun/jjui#403), [#​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 ([#​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 ([#​387](idursun/jjui#387), [#​386](idursun/jjui#386)) - Removed incorrect space trimming in renderer ([#​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 ([#​398](idursun/jjui#398)) - Ignore virtual selection on refresh ([#​381](idursun/jjui#381)) ##### Operation Log (oplog) - Fixed an issue in operation ID detection ([#​380](idursun/jjui#380), [#​377](idursun/jjui#377)) ##### Command Execution - Added a mechanism for restoring failed commands to input field, allowing retries without retyping ([#​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" ([#​358](idursun/jjui#358), [#​228](idursun/jjui#228), [#​372](idursun/jjui#372)) #### What's Changed - Remove teatest package and simplify tests by [@​idursun](https://github.com/idursun) in [#​379](idursun/jjui#379) - internal/parser: get revision ids with template prefixes by [@​baggiiiie](https://github.com/baggiiiie) in [#​372](idursun/jjui#372) - fix(oplog): improve operation id detection by [@​idursun](https://github.com/idursun) in [#​380](idursun/jjui#380) - refactor: serialise command execution by [@​idursun](https://github.com/idursun) in [#​378](idursun/jjui#378) - Revert "refactor: serialise command execution" by [@​idursun](https://github.com/idursun) in [#​383](idursun/jjui#383) - revisions: fix scrolling at the top and bottom of revset by [@​baggiiiie](https://github.com/baggiiiie) in [#​387](idursun/jjui#387) - refactor: introduce and implement common.Model by [@​idursun](https://github.com/idursun) in [#​384](idursun/jjui#384) - refactor: Replace custom cell buffer implementation with `cellbuf` package by [@​idursun](https://github.com/idursun) in [#​388](idursun/jjui#388) - refactor: use simple layout functions to lay out the main UI by [@​idursun](https://github.com/idursun) in [#​389](idursun/jjui#389) - Coming back to previous state when exec command failed by [@​ArnaudBger](https://github.com/ArnaudBger) in [#​392](idursun/jjui#392) - feat: add basic mouse support by [@​idursun](https://github.com/idursun) in [#​391](idursun/jjui#391) - list/renderer: fix viewport adjustment on PageDown by [@​baggiiiie](https://github.com/baggiiiie) in [#​395](idursun/jjui#395) - Make preview horizontally scrollable by [@​idursun](https://github.com/idursun) in [#​396](idursun/jjui#396) - revset: fix revset not using default when empty by [@​baggiiiie](https://github.com/baggiiiie) in [#​399](idursun/jjui#399) - operation: add op log revert by [@​baggiiiie](https://github.com/baggiiiie) in [#​400](idursun/jjui#400) - revision: fix double rendering of inline describe content by [@​baggiiiie](https://github.com/baggiiiie) in [#​403](idursun/jjui#403) - refactor: replace usages of scattered width/height pairs with `ViewNode` by [@​idursun](https://github.com/idursun) in [#​401](idursun/jjui#401) - describe: catch cursor blinking to avoid unnecessary rendering by [@​baggiiiie](https://github.com/baggiiiie) in [#​404](idursun/jjui#404) #### New Contributors - [@​ArnaudBger](https://github.com/ArnaudBger) made their first contribution in [#​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-->
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
revisionLineRenderedto properly sequencethe description overlay rendering, which tracks revision line rendering.
Following checks are made before rendering the description overlay:
Fixes #369
revision: break down item_renderer Render logic
revision: break down item_renderer Render logic
Refactored
Renderlogic to smaller functions, separated into differentrendering logic, such as rendering for:
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