<commit_before><template>
  <div class="side task-info" v-if="task">
    <div class="page-header">
      <div
        class="flexrow header-title"
      >
        <div class="title flexrow-item">
          <router-link :to="taskEntityPath">
            {{ task ? title : 'Loading...' }}
          </router-link>
        </div>
        <task-type-name
          class="flexrow-item task-type"
          :task-type="currentTaskType"
          :production-id="currentProduction.id"
          v-if="currentTaskType"
        />
      </div>
      <div
        class="flexrow task-information"
      >
        <span class="flexrow-item">{{ $t('tasks.current_status') }}</span>
        <validation-tag
          class="is-medium flexrow-item"
          :task="task"
          :is-static="true"
        />
        <router-link
          :to="taskPath"
        >
          {{ $t('main.history') }}
        </router-link>
      </div>
    </div>

    <div class="task-columns" ref="task-columns">
      <div class="task-column preview-column">
        <div class="preview-column-content">
          <div class="preview-picture">
            <div
              v-if="isMoviePreview"
            >
              <video-player
                :preview="currentPreview"
                :entity-preview-files="taskEntityPreviews"
                :task-type-map="taskTypeMap"
                :light="true"
                @annotationchanged="onAnnotationChanged"
                ref="preview-movie"
              />
            </div>

            <div
              class="preview-standard-file"
              v-else-if="isStandardPreview"
            >
              <a
                class="button"
                ref="preview-file"
                :href="currentPreviewPath"
              >
                <download-icon class="icon" />
                <span class="text">
                  {{ $t('tasks.download_pdf_file', {extension}) }}
                </span>
              </a>
            </div>

            <model-viewer
              :preview-url="currentPreviewPath"
              :light="true"
              v-else-if="is3DModelPreview"
            />

            <picture-viewer
              :preview="currentPreview"
              :light="true"
              @annotation-changed="onAnnotationChanged"
              @add-preview="onAddExtraPreview"
              ref="preview-picture"
              v-else-if="isPicturePreview"
            />
            <div
              class="no-preview"
              v-if="!taskPreviews || taskPreviews.length === 0"
            >
              <em>{{ $t('tasks.no_preview') }}</em>
            </div>
          </div>

        </div>
      </div>

      <div class="task-column comments-column">
        <div>
          <div>
            <add-comment
              ref="add-comment"
              :user="user"
              :task="task"
              :task-status-options="taskStatusOptionsForCurrentUser"
              :light="true"
              :is-loading="loading.addComment"
              :attached-file-name="attachedFileName"
              @add-comment="addComment"
              @add-preview="onAddPreviewClicked"
              v-if="isCommentingAllowed"
            />

            <div class="comments" v-if="taskComments.length > 0">
              <comment
                :key="'comment' + comment.id"
                :comment="comment"
                :light="true"
                :add-preview="onAddPreviewClicked"
                v-for="comment in taskComments"
              />
            </div>
            <div class="no-comment" v-else>
              <em>
                {{ $t('tasks.no_comment')}}
              </em>
            </div>
          </div>
        </div>

        <div class="has-text-centered" v-if="loading.task">
          <spinner />
        </div><commit_msg>Improve task side widget loading UX<commit_after><template>
  <div class="side task-info" v-if="task">
    <div class="page-header">
      <div
        class="flexrow header-title"
      >
        <div class="title flexrow-item">
          <router-link :to="taskEntityPath">
            {{ task ? title : 'Loading...' }}
          </router-link>
        </div>
        <task-type-name
          class="flexrow-item task-type"
          :task-type="currentTaskType"
          :production-id="currentProduction.id"
          v-if="currentTaskType"
        />
      </div>
      <div
        class="flexrow task-information"
      >
        <span class="flexrow-item">{{ $t('tasks.current_status') }}</span>
        <validation-tag
          class="is-medium flexrow-item"
          :task="task"
          :is-static="true"
        />
        <router-link
          :to="taskPath"
        >
          {{ $t('main.history') }}
        </router-link>
      </div>
    </div>

    <div class="task-columns" ref="task-columns">
      <div class="task-column preview-column">
        <div class="preview-column-content">
          <div class="preview-picture">
            <div
              v-if="isMoviePreview"
            >
              <video-player
                :preview="currentPreview"
                :entity-preview-files="taskEntityPreviews"
                :task-type-map="taskTypeMap"
                :light="true"
                @annotationchanged="onAnnotationChanged"
                ref="preview-movie"
              />
            </div>

            <div
              class="preview-standard-file"
              v-else-if="isStandardPreview"
            >
              <a
                class="button"
                ref="preview-file"
                :href="currentPreviewPath"
              >
                <download-icon class="icon" />
                <span class="text">
                  {{ $t('tasks.download_pdf_file', {extension}) }}
                </span>
              </a>
            </div>

            <model-viewer
              :preview-url="currentPreviewPath"
              :light="true"
              v-else-if="is3DModelPreview"
            />

            <picture-viewer
              :preview="currentPreview"
              :light="true"
              @annotation-changed="onAnnotationChanged"
              @add-preview="onAddExtraPreview"
              ref="preview-picture"
              v-else-if="isPicturePreview"
            />
            <div
              class="no-preview"
              v-if="!taskPreviews || taskPreviews.length === 0"
            >
              <em>{{ $t('tasks.no_preview') }}</em>
            </div>
          </div>

        </div>
      </div>

      <div class="task-column comments-column">
        <div>
          <div>
            <add-comment
              ref="add-comment"
              :user="user"
              :task="task"
              :task-status-options="taskStatusOptionsForCurrentUser"
              :light="true"
              :is-loading="loading.addComment"
              :attached-file-name="attachedFileName"
              @add-comment="addComment"
              @add-preview="onAddPreviewClicked"
              v-if="isCommentingAllowed"
            />

            <div
              class="comments"
              v-if="taskComments.length > 0 && !loading.task"
            >
              <comment
                :key="'comment' + comment.id"
                :comment="comment"
                :light="true"
                :add-preview="onAddPreviewClicked"
                v-for="comment in taskComments"
              />
            </div>
            <div class="no-comment" v-else-if="!loading.task">
              <em>
                {{ $t('tasks.no_comment')}}
              </em>
            </div>
          </div>
        </div>

        <div class="has-text-centered" v-if="loading.task">
          <spinner />
        </div>
{'fraction_non_alphanumeric': 0.13803720333547145, 'fraction_numerical': 0.0007697241821680564, 'mean_word_length': 1.2623331398723157, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2343541', 'n_tokens_mistral': 2149, 'n_tokens_neox': 2073, 'n_words': 301}