<commit_before>import React from 'react'
import _ from 'underscore'
import {connect} from 'react-redux'
import 'whatwg-fetch';
import {ConnectedCodeView} from 'components/code-view'
import {
  toggleCodeView,
  updateFileUrl
} from 'reducers/ui-filters'

export const CloseButton = ({handleToggle}) => {
  return (
    <div className="TogglerContainer">
      <button className='Toggler' onClick={handleToggle}>
        Close
      </button>
    </div>
  );
}

export class FileViewer extends React.Component {
  constructor(props) {
    super(props);
    this.handleToggle = this.handleToggle.bind(this);
    this.scrollToFocusedLine = this.scrollToFocusedLine.bind(this);
    this.scrollAmount = 0;
  }

  handleToggle(e) {
    this.props.toggleCodeView(false);
    this.props.updateFileUrl(null);
  }

  scrollToFocusedLine() {
    var target = document.querySelector('.LineNumber--focused');
    if (this.parentView) {
      this.parentView.scrollTop = (this.props.line-1)*20 + 16 - screen.height/4;
    }
  }

  render() {
    var {currentFilePath, line} = this.props;
    return (
      <div className="FullView" ref={(ref) => this.parentView = ref}>
        <CloseButton handleToggle={this.handleToggle}/>
        <ConnectedCodeView
          key={currentFilePath}
          lno={line}
          start={1}
          filePath={currentFilePath}
          setScroll={this.scrollToFocusedLine}
        />
      </div>
    )
  }
}

export const ConnectedFileViewer = connect(
  (state) => ({
    currentFilePath: state.uiFilters.fileUrl,
    line: state.uiFilters.line,
  }),
  {
    updateFileUrl: updateFileUrl,
    toggleCodeView: toggleCodeView
  }
)(FileViewer);
<commit_msg>Fix not scroll<commit_after>import React from 'react'
import _ from 'underscore'
import {connect} from 'react-redux'
import 'whatwg-fetch';
import {ConnectedCodeView} from 'components/code-view'
import {
  toggleCodeView,
  updateFileUrl
} from 'reducers/ui-filters'

export const CloseButton = ({handleToggle}) => {
  return (
    <div className="TogglerContainer">
      <button className='Toggler' onClick={handleToggle}>
        Close
      </button>
    </div>
  );
}

export class FileViewer extends React.Component {
  constructor(props) {
    super(props);
    this.handleToggle = this.handleToggle.bind(this);
    this.scrollToFocusedLine = this.scrollToFocusedLine.bind(this);
    this.scrollAmount = 0;
  }

  handleToggle(e) {
    this.props.toggleCodeView(false);
    this.props.updateFileUrl(null);
  }

  scrollToFocusedLine() {
    var target = document.querySelector('.LineNumber--focused');
    this.parentView.scrollTop = (this.props.line-1)*20 + 16 - screen.height/4;
  }

  render() {
    var {currentFilePath, line} = this.props;
    return (
      <div className="FullView" ref={(ref) => this.parentView = this.parentView || ref}>
        <CloseButton handleToggle={this.handleToggle}/>
        <ConnectedCodeView
          key={currentFilePath}
          lno={line}
          start={1}
          filePath={currentFilePath}
          setScroll={this.scrollToFocusedLine}
        />
      </div>
    )
  }
}

export const ConnectedFileViewer = connect(
  (state) => ({
    currentFilePath: state.uiFilters.fileUrl,
    line: state.uiFilters.line,
  }),
  {
    updateFileUrl: updateFileUrl,
    toggleCodeView: toggleCodeView
  }
)(FileViewer);

{'fraction_non_alphanumeric': 0.12899372947148402, 'fraction_numerical': 0.00477754553598089, 'mean_word_length': 3.2244640605296344, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '3307716', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1046, 'n_words': 191}