<commit_before>import React from 'react'
import { Link } from 'react-router'
import BillboardTitle from './BillboardTitle.js'
import {I18n} from './I18n.js'

import TableOfContents from './TableOfContents.js'

class Sidebar extends React.Component {
  renderTOC() {
    if (this.props.segmentTitles) {
      return (
        <TableOfContents
          segmentTitles={this.props.segmentTitles}
          selectedSegment={this.props.selectedSegment}
          handleEdit={this.props.handleEdit}
        />
      )
    }
  }
  render () {
    let {title, coverURL} = this.props
    return (
      <aside id="Sidebar">
        <Link to={`/${this.props.handleEdit !== null ? "edit/" : ""}`} className="backLink">
          <I18n meaning="back_to_overview" />
        </Link>
        <BillboardTitle title={title} coverURL={coverURL} />
        {this.renderTOC()}
      </aside>
    )
  }
}

export default Sidebar
<commit_msg>Only let the title be editable in edit mode.<commit_after>import React from 'react'
import { Link } from 'react-router'
import BillboardTitle from './BillboardTitle.js'
import {I18n} from './I18n.js'

import TableOfContents from './TableOfContents.js'

class Sidebar extends React.Component {
  renderTOC() {
    if (this.props.segmentTitles) {
      return (
        <TableOfContents
          segmentTitles={this.props.segmentTitles}
          selectedSegment={this.props.selectedSegment}
          handleEdit={this.props.handleEdit}
        />
      )
    }
  }
  render () {
    let {title, coverURL, handleEdit} = this.props
    return (
      <aside id="Sidebar">
        <Link to={`/${this.props.handleEdit !== null ? "edit/" : ""}`} className="backLink">
          <I18n meaning="back_to_overview" />
        </Link>
        <BillboardTitle title={title} coverURL={coverURL} handleEdit={handleEdit} />
        {this.renderTOC()}
      </aside>
    )
  }
}

export default Sidebar

{'fraction_non_alphanumeric': 0.13672079622839184, 'fraction_numerical': 0.006286013619696176, 'mean_word_length': 2.701550387596899, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '1052561', 'n_tokens_mistral': 599, 'n_tokens_neox': 594, 'n_words': 122}