<commit_before><template>
<td>
  <span
    class="description"
    v-if="entry.description && entry.description.length > 0 && !full"
    v-html="compileMarkdown(shortenText(entry.description, 20))"
    v-tooltip="tooltipOptions"
    @click="onClick"
  >
  </span>
  <span
    v-html="compileMarkdown(entry.description)"
    v-else
  >
  </span>
</td>
</template>

<script>
import marked from 'marked'
import { mapGetters, mapActions } from 'vuex'
import stringHelpers from '../../lib/string'

export default {
  name: 'description-cell',
  data () {
    return {
      isOpen: false,
      timeout: null
    }
  },

  components: {
  },

  props: {
    entry: {
      type: Object,
      default: () => {}
    },
    full: {
      type: Boolean,
      default: false
    }
  },

  computed: {
    ...mapGetters([
    ]),

    tooltipOptions () {
      return {
        content: this.compileMarkdown(this.entry.description),
        show: this.isOpen,
        trigger: 'manual',
        delay: {
          hide: 5000
        }
      }
    }
  },

  methods: {
    ...mapActions([
    ]),

    compileMarkdown (input) {
      return marked(input || '')
    },

    shortenText: stringHelpers.shortenText,

    onClick () {
      this.isOpen = !this.isOpen
      if (this.isOpen) {
        this.timeout = setTimeout(() => {
          this.isOpen = false
        }, 3000)
      } else {
        clearTimeout(this.timeout)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.no-avatar {
  width: 30px;
}

.last-comment {
  margin-left: 0.6em;
}

.no-comment {
  font-style: italic;
}

.description {
  cursor: pointer;
}
</style>
<commit_msg>Show description for a longer time when displayed<commit_after><template>
<td>
  <span
    class="description"
    v-if="entry.description && entry.description.length > 0 && !full"
    v-html="compileMarkdown(shortenText(entry.description, 20))"
    v-tooltip="tooltipOptions"
    @click="onClick"
  >
  </span>
  <span
    v-html="compileMarkdown(entry.description)"
    v-else
  >
  </span>
</td>
</template>

<script>
import marked from 'marked'
import { mapGetters, mapActions } from 'vuex'
import stringHelpers from '../../lib/string'

export default {
  name: 'description-cell',
  data () {
    return {
      isOpen: false,
      timeout: null
    }
  },

  components: {
  },

  props: {
    entry: {
      type: Object,
      default: () => {}
    },
    full: {
      type: Boolean,
      default: false
    }
  },

  computed: {
    ...mapGetters([
    ]),

    tooltipOptions () {
      return {
        content: this.compileMarkdown(this.entry.description),
        show: this.isOpen,
        trigger: 'manual',
        delay: {
          hide: 6000
        }
      }
    }
  },

  methods: {
    ...mapActions([
    ]),

    compileMarkdown (input) {
      return marked(input || '')
    },

    shortenText: stringHelpers.shortenText,

    onClick () {
      this.isOpen = !this.isOpen
      if (this.isOpen) {
        this.timeout = setTimeout(() => {
          this.isOpen = false
        }, 6000)
      } else {
        clearTimeout(this.timeout)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.no-avatar {
  width: 30px;
}

.last-comment {
  margin-left: 0.6em;
}

.no-comment {
  font-style: italic;
}

.description {
  cursor: pointer;
}
</style>

{'fraction_non_alphanumeric': 0.15403128760529483, 'fraction_numerical': 0.009025270758122744, 'mean_word_length': 2.1016791044776117, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 33, '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': '963469', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1127, 'n_words': 215}