Restore dirty LED for tabs with unseen changes (#715) - #716
Merged
Merged
Conversation
Since the LED logic moved into LedIndicatorService, nothing set LedState.IsDirty and the service tracked its own LedState per window, so activity icons also lost the tail and time-sync indicators. - RegisterWindow takes the window's LedState so there is one source of truth - UpdateWindowActivity marks dirty when the tab is inactive or not tailing - ClearDirty runs on tab activation (BindActiveLogWindow) and tail follow
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.
Fixes #715
Problem
The "dirty" LED stopped working in 698d139, when the LED logic moved into
LedIndicatorService. The dirty LED is the magenta marker in a tab icon's top-right corner that shows the tab has received new lines you haven't seen yet.LedState.IsDirty = true. The old rule inLogTabWindow.OnFileSizeChangedwas lost in the refactor, so the marker never lit up.LedStateobjects per window. The service created its ownLedStateinRegisterWindow, whileLogTabWindowupdated tail, sync and dirty onLogWindowData.LedState. The activity animation (UpdateWindowActivity/OnAnimationTick) drew icons from the service's copy. So whenever lines arrived, the tab icon showed tail as "On" and dropped the time-sync bar, whatever the real state was.OnDockPanelActiveContentChangedsetsCurrentLogWindowfirst. SoOnTabControllerWindowActivatedhit its "already current" guard and returned before its clear-dirty code. This was hidden because dirty was never set.Changes
ILedIndicatorService.RegisterWindow(window, state)now takes the window's ownLedState, so the service andLogTabWindowshare one instance.UpdateWindowActivity(window, lineDiff, markDirty):LogTabWindowmarks a tab dirty when it isn't the current tab or its follow-tail isn't On. This is the pre-refactor rule. The time-sync activity inLogWindowCoordinatorpassesfalse.ClearDirty(window)is called fromBindActiveLogWindow, which both activation paths reach, and fromOnTailFollowedfor the active tab.FileSizeChangedis suppressed upstream inLogWindow.CheckFilterAndHighlight.Tests
New tests in
LedIndicatorServiceTests, written first and failing before the fix:markDirtyis true, and not set when it's falseClearDirtyresets the state and raises the clean icon