<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withContentRect, MeasureProps } from 'react-measure';
import smoothScrollY from 'common/utils/smoothScrollY';
import { compose, branch, renderNothing } from 'recompose';
import { selectCurrentId } from 'features/quiz/QuizSession/selectors';
import { selectInfoDetailLevel, selectInfoDisabled, selectInfoOpen } from './selectors';

import VocabDetail from 'common/components/VocabDetail';
import { Wrapper } from './styles';

class QuizInfo extends React.Component {
  static propTypes = {
    id: PropTypes.number.isRequired,
    detailLevel: PropTypes.number.isRequired,
    isOpen: PropTypes.bool.isRequired,
    isDisabled: PropTypes.bool.isRequired,
    ...MeasureProps,
  };

  componentDidUpdate(prevProps) {
    if (
      (!prevProps.isOpen && this.props.isOpen) ||
      (this.props.isOpen && prevProps.detailLevel !== this.props.detailLevel)
    ) {
      this.scrollIntoView();
    }
  }

<<<<<<< 2676324703b59b8349ee19ec41ad1d9462f08828
  scrollIntoView = () => smoothScrollY(this.props.contentRect.bounds.top - 20, 500);
=======
  scrollIntoView = () => smoothScrollY(this.props.contentRect.bounds.top);
>>>>>>> fix: less aggressive scroll top in quiz info

  render() {
    const { id, detailLevel, isOpen, isDisabled, measureRef } = this.props;
    const isMidDetail = detailLevel >= 1;
    const isHighDetail = detailLevel === 2;

    return (
      <Wrapper innerRef={measureRef} isMinimized={isDisabled || !isOpen}>
        <VocabDetail
          id={id}
          showFuri={isMidDetail}
          showSecondaryReadings={isMidDetail}
          showTags={isMidDetail}
          showLinks={isHighDetail}
          showSentence={isHighDetail}
          showPitch={isHighDetail}
          showStroke={isHighDetail}
          showNotes={isHighDetail}
          showLock={isHighDetail}<commit_msg>refactor: remove debounced input, use uncontrolled wanakana<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withContentRect, MeasureProps } from 'react-measure';
import smoothScrollY from 'common/utils/smoothScrollY';
import { compose, branch, renderNothing } from 'recompose';
import { selectCurrentId } from 'features/quiz/QuizSession/selectors';
import { selectInfoDetailLevel, selectInfoDisabled, selectInfoOpen } from './selectors';

import VocabDetail from 'common/components/VocabDetail';
import { Wrapper } from './styles';

class QuizInfo extends React.Component {
  static propTypes = {
    id: PropTypes.number.isRequired,
    detailLevel: PropTypes.number.isRequired,
    isOpen: PropTypes.bool.isRequired,
    isDisabled: PropTypes.bool.isRequired,
    ...MeasureProps,
  };

  componentDidUpdate(prevProps) {
    if (
      (!prevProps.isOpen && this.props.isOpen) ||
      (this.props.isOpen && prevProps.detailLevel !== this.props.detailLevel)
    ) {
      this.scrollIntoView();
    }
  }

  scrollIntoView = () => smoothScrollY(this.props.contentRect.bounds.top - 20, 500);

  render() {
    const { id, detailLevel, isOpen, isDisabled, measureRef } = this.props;
    const isMidDetail = detailLevel >= 1;
    const isHighDetail = detailLevel === 2;

    return (
      <Wrapper innerRef={measureRef} isMinimized={isDisabled || !isOpen}>
        <VocabDetail
          id={id}
          showFuri={isMidDetail}
          showSecondaryReadings={isMidDetail}
          showTags={isMidDetail}
          showLinks={isHighDetail}
          showSentence={isHighDetail}
          showPitch={isHighDetail}
          showStroke={isHighDetail}
          showNotes={isHighDetail}
          showLock={isHighDetail}
{'fraction_non_alphanumeric': 0.11793084963816672, 'fraction_numerical': 0.011793084963816671, 'mean_word_length': 3.700251889168766, 'pattern_counts': {'":': 0, '<': 14, '<?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': '2266065', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1092, 'n_words': 224}