From 00191763cfa68c2d946cafbcbb89a6148742b20d Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 24 Sep 2021 23:29:41 +0200 Subject: [PATCH] fixed #4629 - missing activity highlight --- tabby-core/src/components/baseTab.component.ts | 16 ++++++++++------ tabby-core/src/components/splitTab.component.ts | 7 +++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tabby-core/src/components/baseTab.component.ts b/tabby-core/src/components/baseTab.component.ts index d97056f4..79bf4181 100644 --- a/tabby-core/src/components/baseTab.component.ts +++ b/tabby-core/src/components/baseTab.component.ts @@ -1,4 +1,4 @@ -import { Observable, Subject, distinctUntilChanged, debounceTime } from 'rxjs' +import { Observable, Subject, distinctUntilChanged } from 'rxjs' import { EmbeddedViewRef, ViewContainerRef, ViewRef } from '@angular/core' import { RecoveryToken } from '../api/tabRecovery' import { BaseComponent } from './base.component' @@ -71,7 +71,7 @@ export abstract class BaseTabComponent extends BaseComponent { get blurred$ (): Observable { return this.blurred } get titleChange$ (): Observable { return this.titleChange.pipe(distinctUntilChanged()) } get progress$ (): Observable { return this.progress.pipe(distinctUntilChanged()) } - get activity$ (): Observable { return this.activity.pipe(debounceTime(500)) } + get activity$ (): Observable { return this.activity } get destroyed$ (): Observable { return this.destroyed } get recoveryStateChangedHint$ (): Observable { return this.recoveryStateChangedHint } @@ -113,16 +113,20 @@ export abstract class BaseTabComponent extends BaseComponent { * Shows the acticity marker on the tab header */ displayActivity (): void { - this.hasActivity = true - this.activity.next(true) + if (!this.hasActivity) { + this.hasActivity = true + this.activity.next(true) + } } /** * Removes the acticity marker from the tab header */ clearActivity (): void { - this.hasActivity = false - this.activity.next(false) + if (this.hasActivity) { + this.hasActivity = false + this.activity.next(false) + } } /** diff --git a/tabby-core/src/components/splitTab.component.ts b/tabby-core/src/components/splitTab.component.ts index 18a72174..612322b5 100644 --- a/tabby-core/src/components/splitTab.component.ts +++ b/tabby-core/src/components/splitTab.component.ts @@ -612,6 +612,13 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit this.layoutInternal(this.root, 0, 0, 100, 100) } + clearActivity (): void { + for (const tab of this.getAllTabs()) { + tab.clearActivity() + } + super.clearActivity() + } + private updateTitle (): void { this.setTitle(this.getAllTabs().map(x => x.title).join(' | ')) }