<commit_before><script>
import { watch, computed } from '@vue/composition-api'
import { useRouter } from '@front/util/router'
import { useApps } from '../apps'
import AppHeaderSelect from './AppHeaderSelect.vue'
import { useOrientation } from '../layout/orientation'

export default {
  components: {
    AppHeaderSelect
  },

  setup () {
    const router = useRouter()

    const {
      apps,
      currentAppId,
      currentApp,
      selectApp
    } = useApps()

    watch(apps, () => {
      if (!currentApp.value && apps.value.length && currentAppId.value !== apps.value[0].id) {
        router.push({
          params: {
            appId: apps.value[0].id
          }
        })
      }
    })

    const { orientation } = useOrientation()

    return {
      currentApp,
      apps,
      selectApp,
      orientation
    }
  }
}
</script>

<template>
  <AppHeaderSelect
    :items="apps"
    :selected-item="currentApp"
    option-icon="layers"
    @select="app => selectApp(app.id)"
  >
    <template #trigger>
      <VueButton
        v-tooltip="'Select current app'"
        class="flat"
        icon-left="layers"
        :icon-right="orientation === 'landscape' ? 'arrow_drop_down' : null"
        :class="{
          'icon-button': orientation === 'portrait'
        }"
      >
        <template v-if="orientation === 'landscape'">
          <span v-if="currentApp">
            {{ currentApp.name }}
          </span>
          <span
            v-else
            class="opacity-50"
          >
            No app
          </span>
        </template>
      </VueButton>
    </template>

    <template #default="{ item: app }">
      <div class="app-button flex">
        <span class="truncate flex-1">{{ app.name }}</span>
        <span class="opacity-50 flex-none flex items-center">
          <img
            src="~@front/assets/logo.png"
            class="w-4 h-4 mr-2"
            alt="Vue"
          >
          {{ app.version }}
        </span>
      </div>
    </template>
  </AppHeaderSelect>
</template>

<style lang="postcss" scoped>
.app-button {
  width: 220px;
}
</style>
<commit_msg>fix: remove "select app" tooltip<commit_after><script>
import { watch, computed } from '@vue/composition-api'
import { useRouter } from '@front/util/router'
import { useApps } from '../apps'
import AppHeaderSelect from './AppHeaderSelect.vue'
import { useOrientation } from '../layout/orientation'

export default {
  components: {
    AppHeaderSelect
  },

  setup () {
    const router = useRouter()

    const {
      apps,
      currentAppId,
      currentApp,
      selectApp
    } = useApps()

    watch(apps, () => {
      if (!currentApp.value && apps.value.length && currentAppId.value !== apps.value[0].id) {
        router.push({
          params: {
            appId: apps.value[0].id
          }
        })
      }
    })

    const { orientation } = useOrientation()

    return {
      currentApp,
      apps,
      selectApp,
      orientation
    }
  }
}
</script>

<template>
  <AppHeaderSelect
    :items="apps"
    :selected-item="currentApp"
    option-icon="layers"
    @select="app => selectApp(app.id)"
  >
    <template #trigger>
      <VueButton
        class="flat"
        icon-left="layers"
        :icon-right="orientation === 'landscape' ? 'arrow_drop_down' : null"
        :class="{
          'icon-button': orientation === 'portrait'
        }"
      >
        <template v-if="orientation === 'landscape'">
          <span v-if="currentApp">
            {{ currentApp.name }}
          </span>
          <span
            v-else
            class="opacity-50"
          >
            No app
          </span>
        </template>
      </VueButton>
    </template>

    <template #default="{ item: app }">
      <div class="app-button flex">
        <span class="truncate flex-1">{{ app.name }}</span>
        <span class="opacity-50 flex-none flex items-center">
          <img
            src="~@front/assets/logo.png"
            class="w-4 h-4 mr-2"
            alt="Vue"
          >
          {{ app.version }}
        </span>
      </div>
    </template>
  </AppHeaderSelect>
</template>

<style lang="postcss" scoped>
.app-button {
  width: 220px;
}
</style>

{'fraction_non_alphanumeric': 0.15244191559981032, 'fraction_numerical': 0.006164058795637743, 'mean_word_length': 1.8642226748133062, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6198827', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1286, 'n_words': 261}