You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local history max entries not visually applied to timeline #145721
bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderstimelineTimeline view issuesverifiedVerification succeeded
Set workbench.localHistory.maxFileEntries to something small like 2
Make some local history changes
🐛 Sometimes the list has 3 or more items in it as the deletes get processed. I would expect that even though file deletions and updates are async we should not render the extras in the list since this is the users specified max.
However the timeline view behaves weird: I am sending an event that the entries have changed but unless I set reset: true, entries are just added on top:
When I change to always set reset: true, I see no more than the configured number of entries in the timeline, but I also think this will reset view state in case the user has scrolled down or selected an entry...
changed the title [-]`workbench.localHistory.maxFileEntries` should be max list length regardless of async behavior[/-][+]Local history max entries not visually applied to timeline[/+]on Mar 23, 2022
never actually gets called. I would expect that when the limit is hit, every new save event would trigger two events, one adding a new entry and one deleting the oldest entry. But I only see the one event firing to add the entry.
Also, I am able to click into the events past the limit and their contents are correct, so the limit isn't being applied in some way.
Jackson Kearl (@JacksonKearl) imho the timeline API misses a way for me to indicate that an entry is removed. For performance reasons, local history entries are only removed on shutdown because otherwise every editor save is not only a file operation for creating the history entry but also a delete.
I now gave up to be clever and just always set reset: true in the change event for the timeline to re-render everything 🤷
reset: true// there is no other way to indicate that items might have been replaced/removed
If we had the onDidRemoveEntry event together with the onDidAddEntry it would actually be worse because the first event would cause a change to the timeline to show the added entry and the second entry would reset the timeline.
bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderstimelineTimeline view issuesverifiedVerification succeeded
Activity
bpasero commentedon Mar 23, 2022
We actually apply this setting in a way that we make sure to never return more than configured entries:
vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts
Lines 238 to 241 in 3d7f75d
However the timeline view behaves weird: I am sending an event that the entries have changed but unless I set
reset: true, entries are just added on top:vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.ts
Lines 98 to 102 in 422b41d
Jackson Kearl (@JacksonKearl) any clue how I am supposed to set
reset?When I change to always set
reset: true, I see no more than the configured number of entries in the timeline, but I also think this will reset view state in case the user has scrolled down or selected an entry...[-]`workbench.localHistory.maxFileEntries` should be max list length regardless of async behavior[/-][+]Local history max entries not visually applied to timeline[/+]JacksonKearl commentedon Mar 24, 2022
Stepping through this it would seem
vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.ts
Line 83 in 422b41d
Also, I am able to click into the events past the limit and their contents are correct, so the limit isn't being applied in some way.
bpasero commentedon Mar 24, 2022
Jackson Kearl (@JacksonKearl) imho the timeline API misses a way for me to indicate that an entry is removed. For performance reasons, local history entries are only removed on shutdown because otherwise every editor save is not only a file operation for creating the history entry but also a delete.
I now gave up to be clever and just always set
reset: truein the change event for the timeline to re-render everything 🤷vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.ts
Line 101 in 777b386
If we had the
onDidRemoveEntryevent together with theonDidAddEntryit would actually be worse because the first event would cause a change to the timeline to show the added entry and the second entry would reset the timeline.Local history max entries not visually applied to timeline (fix micro…