diff --git a/src/dotnet/APIView/APIViewWeb/LeanModels/ReviewRevisionPageModels.cs b/src/dotnet/APIView/APIViewWeb/LeanModels/ReviewRevisionPageModels.cs index 53d58882e6d..9ebd23fa3a8 100644 --- a/src/dotnet/APIView/APIViewWeb/LeanModels/ReviewRevisionPageModels.cs +++ b/src/dotnet/APIView/APIViewWeb/LeanModels/ReviewRevisionPageModels.cs @@ -33,7 +33,6 @@ public class ReviewContentModel public Dictionary CrossLanguageViewContent { get; set; } = new Dictionary(); } -<<<<<<< HEAD public class ReviewBadgeModel { public ReviewListItemModel Review { get; set; } @@ -43,12 +42,12 @@ public class ReviewBadgeModel public UserPreferenceModel UserPreference { get; set; } public bool? ShowDocumentation { get; set; } public bool? ShowDiffOnly { get; set; } -======= + } + public class ReviewCodePanelData { public IEnumerable Comments { get; set; } public List APIForest { get; set; } = new List(); public CodeDiagnostic[] Diagnostics { get; set; } ->>>>>>> 5c591dacb (Show / Hide Documentation) } } diff --git a/src/dotnet/APIView/ClientSPA/src/app/_components/api-revision-options/api-revision-options.component.scss b/src/dotnet/APIView/ClientSPA/src/app/_components/api-revision-options/api-revision-options.component.scss index 2dedf01cd4a..e97e65689ec 100644 --- a/src/dotnet/APIView/ClientSPA/src/app/_components/api-revision-options/api-revision-options.component.scss +++ b/src/dotnet/APIView/ClientSPA/src/app/_components/api-revision-options/api-revision-options.component.scss @@ -1,5 +1,5 @@ :host ::ng-deep { .selected-item-content{ - max-width: 12dvw; + max-width: 10dvw; } } \ No newline at end of file diff --git a/src/dotnet/APIView/ClientSPA/src/app/_components/review-page/review-page.component.html b/src/dotnet/APIView/ClientSPA/src/app/_components/review-page/review-page.component.html index 820d09ee493..6738075286a 100644 --- a/src/dotnet/APIView/ClientSPA/src/app/_components/review-page/review-page.component.html +++ b/src/dotnet/APIView/ClientSPA/src/app/_components/review-page/review-page.component.html @@ -7,7 +7,7 @@
diff --git a/src/dotnet/APIView/ClientSPA/src/app/_services/worker/worker.service.ts b/src/dotnet/APIView/ClientSPA/src/app/_services/worker/worker.service.ts index 8da3c13489c..f05a7ffaa97 100644 --- a/src/dotnet/APIView/ClientSPA/src/app/_services/worker/worker.service.ts +++ b/src/dotnet/APIView/ClientSPA/src/app/_services/worker/worker.service.ts @@ -5,22 +5,41 @@ import { Observable, Subject } from 'rxjs'; providedIn: 'root' }) export class WorkerService { - private apiTreeBuilder : Worker; + private apiTreeBuilder : Worker | null = null; private apiTreeMessages = new Subject(); + private workerTimeout : any; constructor() { + this.startWorker(); + } + + startWorker() { this.apiTreeBuilder = new Worker(new URL('../../_workers/apitree-builder.worker', import.meta.url)); this.apiTreeBuilder.onmessage = ({ data }) => { this.apiTreeMessages.next(data); + this.resetWorkerTimeout(); }; } postToApiTreeBuilder(message: any) { - this.apiTreeBuilder.postMessage(message); + if (!this.apiTreeBuilder) { + this.startWorker(); + } + + this.apiTreeBuilder!.postMessage(message); + this.resetWorkerTimeout(); } onMessageFromApiTreeBuilder(): Observable { return this.apiTreeMessages.asObservable(); } + + private resetWorkerTimeout() { + clearTimeout(this.workerTimeout); + this.workerTimeout = setTimeout(() => { + this.apiTreeBuilder!.terminate(); + this.apiTreeBuilder = null; + }, 5000); // Terminate worker after 5 seconds of inactivity + } }