<commit_before>import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnInit, QueryList, ViewChildren} from "@angular/core";
import {AuthService} from "../../auth/auth.service";
import {StatusBarService} from "../../layout/status-bar/status-bar.service";
import {LocalRepositoryService} from "../../repository/local-repository.service";
import {IpcService} from "../../services/ipc.service";
import {MenuItem} from "../../ui/menu/menu-item";
import {DirectiveBase} from "../../util/directive-base/directive-base";
import {TabData} from "../../../../electron/src/storage/types/tab-data-interface";
import {WorkboxService} from "./workbox.service";
import {ReplaySubject} from "rxjs/ReplaySubject";
import {ModalService} from "../../ui/modal/modal.service";
import {noop} from "../../lib/utils.lib";
import {ClosingDirtyAppsModalComponent} from "../modals/closing-dirty-apps/closing-dirty-apps-modal.component";


@Component({
    selector: "ct-workbox",
    styleUrls: ["./workbox.component.scss"],
    template: `
        <div class="head">

            <ul class="tab-bar inset-panel" tabindex="-1">

                <li *ngFor="let tab of tabs; let i = index"
                    [ct-drag-over]="true"
                    (onDragOver)="workbox.openTab(tab)"
                    ct-click
                    (onMouseClick)="onTabClick($event, tab)"
                    [class.active]="tab === (workbox.activeTab | async)"
                    [class.isDirty]="tabComponents[i]?.isDirty"
                    [ct-context]="createContextMenu(tab)"
                    class="tab">

                    <!-- Tab label and title -->
                    <ng-container [ngSwitch]="tab?.type">

                        <!-- Welcome tab-->
                        <ng-template ngSwitchCase="Welcome">
                            <div class="tab-icon">
                                <i class="fa fa-home"></i>
                            </div>

                            <div class="title" 
                                 data-test="welcome-tab-title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'">
                                {{tab.label}}
                            </div>
                        </ng-template>

                        <!-- Code tab-->
                        <ng-template ngSwitchCase="Code">
                            <div class="tab-icon">
                                <i class="fa fa-file-text-o"></i>
                            </div>

                            <div class="title"
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'" 
                                 data-test="file-tab-title"
                                 [attr.data-label]="tab.label">
                                {{tab.label}}
                            </div>
                        </ng-template>

                        <!-- Workflow tab-->
                        <ng-template ngSwitchCase="Workflow">
                            <div class="tab-icon">
                                <i class="fa fa-share-alt"></i>
                            </div>

                            <div class="title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'"
                                 data-test="workflow-tab-title"
                                 [attr.data-label]="tabComponents[i]?.dataModel?.label || tab.label">
                                {{tabComponents[i]?.dataModel?.label || tab.label}}
                            </div>
                        </ng-template>

                        <!-- Command Line Tool tab-->
                        <ng-template ngSwitchCase="CommandLineTool">
                            <div class="tab-icon">
                                <i class="fa fa-terminal"></i>
                            </div>

                            <div class="title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'"
                                 data-test="tool-tab-title"
                                 [attr.data-label]="tabComponents[i]?.dataModel?.label || tab.label">
                                {{tabComponents[i]?.dataModel?.label || tab.label}}
                            </div>
                        </ng-template>

                        <!-- New File tab--><commit_msg>refactor(ui): Remove unnecessary data-label attributes<commit_after>import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnInit, QueryList, ViewChildren} from "@angular/core";
import {AuthService} from "../../auth/auth.service";
import {StatusBarService} from "../../layout/status-bar/status-bar.service";
import {LocalRepositoryService} from "../../repository/local-repository.service";
import {IpcService} from "../../services/ipc.service";
import {MenuItem} from "../../ui/menu/menu-item";
import {DirectiveBase} from "../../util/directive-base/directive-base";
import {TabData} from "../../../../electron/src/storage/types/tab-data-interface";
import {WorkboxService} from "./workbox.service";
import {ReplaySubject} from "rxjs/ReplaySubject";
import {ModalService} from "../../ui/modal/modal.service";
import {noop} from "../../lib/utils.lib";
import {ClosingDirtyAppsModalComponent} from "../modals/closing-dirty-apps/closing-dirty-apps-modal.component";


@Component({
    selector: "ct-workbox",
    styleUrls: ["./workbox.component.scss"],
    template: `
        <div class="head">

            <ul class="tab-bar inset-panel" tabindex="-1">

                <li *ngFor="let tab of tabs; let i = index"
                    [ct-drag-over]="true"
                    (onDragOver)="workbox.openTab(tab)"
                    ct-click
                    (onMouseClick)="onTabClick($event, tab)"
                    [class.active]="tab === (workbox.activeTab | async)"
                    [class.isDirty]="tabComponents[i]?.isDirty"
                    [ct-context]="createContextMenu(tab)"
                    class="tab">

                    <!-- Tab label and title -->
                    <ng-container [ngSwitch]="tab?.type">

                        <!-- Welcome tab-->
                        <ng-template ngSwitchCase="Welcome">
                            <div class="tab-icon">
                                <i class="fa fa-home"></i>
                            </div>

                            <div class="title" 
                                 data-test="welcome-tab-title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'">
                                {{tab.label}}
                            </div>
                        </ng-template>

                        <!-- Code tab-->
                        <ng-template ngSwitchCase="Code">
                            <div class="tab-icon">
                                <i class="fa fa-file-text-o"></i>
                            </div>

                            <div class="title"
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'" 
                                 data-test="file-tab-title">
                                {{tab.label}}
                            </div>
                        </ng-template>

                        <!-- Workflow tab-->
                        <ng-template ngSwitchCase="Workflow">
                            <div class="tab-icon">
                                <i class="fa fa-share-alt"></i>
                            </div>

                            <div class="title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'"
                                 data-test="workflow-tab-title">
                                {{tabComponents[i]?.dataModel?.label || tab.label}}
                            </div>
                        </ng-template>

                        <!-- Command Line Tool tab-->
                        <ng-template ngSwitchCase="CommandLineTool">
                            <div class="tab-icon">
                                <i class="fa fa-terminal"></i>
                            </div>

                            <div class="title" 
                                 [ct-tooltip]="ctt" 
                                 [tooltipPlacement]="'bottom'"
                                 data-test="tool-tab-title">
                                {{tabComponents[i]?.dataModel?.label || tab.label}}
                            </div>
                        </ng-template>

                        <!-- New File tab-->
{'fraction_non_alphanumeric': 0.13997277676950998, 'fraction_numerical': 0.00022686025408348456, 'mean_word_length': 1.0605281607852302, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4320590', 'n_tokens_mistral': 2160, 'n_tokens_neox': 2041, 'n_words': 356}