<commit_before><script>
import { watch } from '@vue/composition-api'
import SplitPane from '@front/features/layout/SplitPane.vue'
import CustomInspectorNode from './CustomInspectorNode.vue'
import CustomInspectorSelectedNodePane from './CustomInspectorSelectedNodePane.vue'
import { useCurrentInspector } from '.'

export default {
  components: {
    SplitPane,
    CustomInspectorNode,
    CustomInspectorSelectedNodePane
  },

  setup () {
    const {
      currentInspector: inspector,
      refreshInspector,
      refreshTree
    } = useCurrentInspector()

    watch(() => inspector.value && inspector.value.treeFilter, (value) => {
      refreshTree()
    })

    watch(inspector, () => {
      refreshInspector()
    }, {
      immediate: true
    })

    return {
      inspector,
      refreshInspector
    }
  }
}
</script>

<template>
  <div v-if="inspector">
    <SplitPane>
      <template #left>
        <div class="flex flex-col h-full">
          <VueInput
            v-model="inspector.treeFilter"
            icon-left="search"
            :placeholder="inspector.treeFilterPlaceholder || 'Search...'"
            class="search flat border-b border-gray-200 dark:border-gray-900"
          />

          <div class="flex-1 p-2 overflow-auto">
            <CustomInspectorNode
              v-for="node of inspector.rootNodes"
              :key="node.id"
              :node="node"
            />
          </div>
        </div>
      </template>

      <template #right>
        <CustomInspectorSelectedNodePane />
      </template>
    </SplitPane>
<commit_msg>feat(custom inspector): save panes split<commit_after><script>
import { watch } from '@vue/composition-api'
import SplitPane from '@front/features/layout/SplitPane.vue'
import CustomInspectorNode from './CustomInspectorNode.vue'
import CustomInspectorSelectedNodePane from './CustomInspectorSelectedNodePane.vue'
import { useCurrentInspector } from '.'

export default {
  components: {
    SplitPane,
    CustomInspectorNode,
    CustomInspectorSelectedNodePane
  },

  setup () {
    const {
      currentInspector: inspector,
      refreshInspector,
      refreshTree
    } = useCurrentInspector()

    watch(() => inspector.value && inspector.value.treeFilter, (value) => {
      refreshTree()
    })

    watch(inspector, () => {
      refreshInspector()
    }, {
      immediate: true
    })

    return {
      inspector,
      refreshInspector
    }
  }
}
</script>

<template>
  <div v-if="inspector">
    <SplitPane
      :save-id="`custom-inspector-${inspector.id}`"
    >
      <template #left>
        <div class="flex flex-col h-full">
          <VueInput
            v-model="inspector.treeFilter"
            icon-left="search"
            :placeholder="inspector.treeFilterPlaceholder || 'Search...'"
            class="search flat border-b border-gray-200 dark:border-gray-900"
          />

          <div class="flex-1 p-2 overflow-auto">
            <CustomInspectorNode
              v-for="node of inspector.rootNodes"
              :key="node.id"
              :node="node"
            />
          </div>
        </div>
      </template>

      <template #right>
        <CustomInspectorSelectedNodePane />
      </template>
    </SplitPane>

{'fraction_non_alphanumeric': 0.12430769230769231, 'fraction_numerical': 0.004923076923076923, 'mean_word_length': 2.2739174219536755, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 43, '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': '3317456', 'n_tokens_mistral': 970, 'n_tokens_neox': 927, 'n_words': 173}