<commit_before>'use babel'

import {CompositeDisposable} from 'atom'
import Message from './message-element'

export class BottomPanel {
  constructor(scope) {
    this.subscriptions = new CompositeDisposable
    this.element = document.createElement('linter-panel') // TODO: Make this a `div`
    this.panel = atom.workspace.addBottomPanel({item: this.element, visible: false, priority: 500})
    this.visibility = false
    this.length = 0
    this.scope = scope
    this.messages = new Map()

    this.subscriptions.add(atom.config.observe('linter.showErrorPanel', value => {
      this.configVisibility = value
      this.setVisibility(this.length)
    }))
    this.subscriptions.add(atom.workspace.observeActivePaneItem(paneItem => {
      this.paneVisibility = paneItem && paneItem === atom.workspace.getActiveTextEditor()
      this.setVisibility(this.length)
    }))
  }
  refresh(scope) {
    this.scope = scope
    for (let message of this.messages) {<commit_msg>:bug: [bottom-panel] Show message panel when all tabs are closed Because it's demoed out in our README's gif and we wouldn't want to break our README.<commit_after>'use babel'

import {CompositeDisposable} from 'atom'
import Message from './message-element'

export class BottomPanel {
  constructor(scope) {
    this.subscriptions = new CompositeDisposable
    this.element = document.createElement('linter-panel') // TODO: Make this a `div`
    this.panel = atom.workspace.addBottomPanel({item: this.element, visible: false, priority: 500})
    this.visibility = false
    this.length = 0
    this.scope = scope
    this.messages = new Map()

    this.subscriptions.add(atom.config.observe('linter.showErrorPanel', value => {
      this.configVisibility = value
      this.setVisibility(this.length)
    }))
    this.subscriptions.add(atom.workspace.observeActivePaneItem(paneItem => {
      this.paneVisibility = paneItem === atom.workspace.getActiveTextEditor()
      this.setVisibility(this.length)
    }))
  }
  refresh(scope) {
    this.scope = scope
    for (let message of this.messages) {
{'fraction_non_alphanumeric': 0.11540318686624819, 'fraction_numerical': 0.00386286817962337, 'mean_word_length': 3.7962962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3911926', 'n_tokens_mistral': 630, 'n_tokens_neox': 600, 'n_words': 142}