Repository navigation
Conversation
The dashboard re-renders once a second while a chat runs, and the render lost the view. `erase-buffer' collapses every marker into the buffer, `window-start' included, so each window restarted at line 1 with point further down and redisplay recentered it: a window shorter than the content scrolled on every tick. Point resting on a line without a row entity, the footer, fell back to `point-min'. Each window now records the line it starts at and gets it back after the render, and point on an entity-less line is found again by line number.
Contributor
Author
|
@ericdallo CI is red here, but not from this change. The four failing jobs (ubuntu and macos on Emacs 28.1 and 28.2) pass MELPA published |
Member
|
I fixed, can you rebase master pls |
…-and-scroll-on-refresh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The
eca-workspacesdashboard stays where you left it while chats run. Before, the once-a-second refresh scrolled the view and could throw point to the top, which made the buffer impossible to navigate.Problem
eca-workspaces--rendererases the buffer and re-inserts every row, so it has to put the view back afterwards. It restored point by row entity and missed two things:erase-bufferdeletes all text, so every marker into the buffer collapses to position 1,window-startincluded. Nothing restored it, so after the re-insert each window started at line 1 with point further down, and redisplay recentered point. A window shorter than the content, which the bottom side window usually is, scrolled on every tick.eca-workspaces-session-idproperty. Point on the footer or the blank line above it had no entity, soeca-workspaces--restore-pointfell back topoint-min, once a second.Both paths fire continuously while a chat streams: the 1s elapsed-time ticker and the debounced refresh on chat status changes.
Change
eca-workspaces--window-statealso records(line-number-at-pos (window-start window)), and the render restores it withset-window-start ... t, after setting the window point. NOFORCE means redisplay ignores a start that would push point off screen, e.g. when rows above it disappeared.eca-workspaces--restore-pointgives way toeca-workspaces--point-stateandeca-workspaces--point-position. The state is (ENTITY COLUMN LINE): a line without an entity is found again by its line number, so point on the footer survives; a row whose entity is gone still falls back to buffer start.Testing
Two new specs: point on the footer line survives a render, and a window keeps both its start line and its point row. Both fail on master with exactly the reported symptom (window start line 1 instead of 3, point line 1 instead of 4). Full suite: 732 specs, 0 failed. checkdoc clean.
Also verified live: three consecutive
eca-workspaces-refreshcalls in a real window keep the window start line, the point row, and point on the footer.