Skip to content

Restore dirty LED for tabs with unseen changes (#715) - #716

Merged
Hirogen merged 1 commit into
Developmentfrom
fix/715-dirty-led
Sep 26, 2026
Merged

Hirogen merged 1 commit into
Developmentfrom
fix/715-dirty-led

Conversation

@Hirogen

@Hirogen Hirogen commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Nothing set LedState.IsDirty = true. The old rule in LogTabWindow.OnFileSizeChanged was lost in the refactor, so the marker never lit up.
  • There were two LedState objects per window. The service created its own LedState in RegisterWindow, while LogTabWindow updated tail, sync and dirty on LogWindowData.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.
  • Activating a tab never cleared dirty. OnDockPanelActiveContentChanged sets CurrentLogWindow first. So OnTabControllerWindowActivated hit 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 own LedState, so the service and LogTabWindow share one instance.
  • UpdateWindowActivity(window, lineDiff, markDirty): LogTabWindow marks 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 in LogWindowCoordinator passes false.
  • New ClearDirty(window) is called from BindActiveLogWindow, which both activation paths reach, and from OnTailFollowed for the active tab.
  • The "Don't dirty LED" highlight action still works because FileSizeChanged is suppressed upstream in LogWindow.CheckFilterAndHighlight.

Tests

New tests in LedIndicatorServiceTests, written first and failing before the fix:

  • dirty is set on activity when markDirty is true, and not set when it's false
  • tail and sync state are kept in the activity icon
  • dirty and tail state survive the activity decay to 0
  • ClearDirty resets the state and raises the clean icon

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
@Hirogen
Hirogen merged commit c9fb5c4 into Development Sep 26, 2026
3 checks passed
@Hirogen
Hirogen deleted the fix/715-dirty-led branch September 26, 2026 11:34
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.

Updates in background - Dirty LED

1 participant