All files / stream LabScene.vue

0% Statements 0/13
0% Branches 0/10
0% Functions 0/4
0% Lines 0/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
<script setup lang="ts">
import { computed } from 'vue'
import { agentAtWork } from './mood'
import { portrait } from '@shared/art'
import CodeHunkCard from './CodeHunkCard.vue'
import LabTeam from './LabTeam.vue'
import { ACCEPTED, actionLine, labClock, phaseTag } from './labRun'
import type { LabRun } from './types'
 
const props = defineProps<{ lab: LabRun; now: Date }>()
 
const agent = computed(() => props.lab.agents[ACCEPTED])
const team = computed(() => props.lab.team ?? [])
const code = computed(() => agent.value?.code ?? null)
const working = computed(() => agentAtWork(team.value))
</script>
 
<template>
  <div class="lab-scene">
    <header class="lab-scene-head">
      <Transition name="fade" mode="out-in">
        <img :key="working" class="lab-agent" :src="portrait(working) ?? undefined" :alt="working" />
      </Transition>
      <span class="lab-scene-name">
        <strong>{{ team.length ? 'RetroSpeedLab team' : 'Claude' }}</strong>
        <small>{{ labClock(lab, now) }}</small>
      </span>
      <span class="persona-tag">{{ phaseTag(lab) }}</span>
    </header>
    <LabTeam v-if="Iteam.length" class="lab-scene-team" :lab="lab" :team="team" />
    <strong v-else class="lab-scene-action">{{ actionLine(agent?.actions.at(-1)) }}</strong>
    <Transition name="fly" mode="out-in">
      <CodeHunkCard v-if="Icode" :key="`${code.commit}:${code.file}`" :code="code" />
      <span v-else class="panel-placeholder">The newest commit appears here</span>
    </Transition>
  </div>
</template>