<commit_before>package x7c1.linen.modern.action.observer

import x7c1.linen.modern.action.observer.CallbackTaskRunner.runAsync
import x7c1.linen.modern.action.{Actions, SourceFocusedEvent, SourceSkipStopped, SourceSkippedEvent}
import x7c1.linen.modern.display.unread.{OnSourceSelectedListener, SourceSelectedEvent}
import x7c1.wheat.macros.logger.Log
import x7c1.wheat.modern.observer.{OnItemFocusedListener, OnItemSkippedListener, OnSkipStoppedListener}


class SourceFocusedObserver(actions: Actions)
  extends OnItemFocusedListener[SourceFocusedEvent] {

  override def onFocused(event: SourceFocusedEvent): Unit = {
    val sync = for {
      _ <- actions.outlineArea onSourceFocused event
      _ <- actions.detailArea onSourceFocused event
    } yield ()

    Seq(sync) foreach runAsync { Log error _.toString }
  }
}

class SourceSelectedObserver(actions: Actions)
  extends OnSourceSelectedListener {

  override def onSourceSelected(event: SourceSelectedEvent): Unit = {
    val sync = for {
      _ <- actions.outlineArea onSourceSelected event
      _ <- actions.sourceArea onSourceSelected event
      _ <- actions.container onSourceSelected event
      _ <- actions.detailArea onSourceSelected event
    } yield ()

    Seq(sync) foreach runAsync { Log error _.toString }
  }
}

class SourceSkippedObserver(actions: Actions)
  extends OnItemSkippedListener[SourceSkippedEvent] {

  override def onSkipped(event: SourceSkippedEvent): Unit = {<commit_msg>fix bug which delays scrolling details<commit_after>package x7c1.linen.modern.action.observer

import x7c1.linen.modern.action.observer.CallbackTaskRunner.runAsync
import x7c1.linen.modern.action.{Actions, SourceFocusedEvent, SourceSkipStopped, SourceSkippedEvent}
import x7c1.linen.modern.display.unread.{OnSourceSelectedListener, SourceSelectedEvent}
import x7c1.wheat.macros.logger.Log
import x7c1.wheat.modern.observer.{OnItemFocusedListener, OnItemSkippedListener, OnSkipStoppedListener}


class SourceFocusedObserver(actions: Actions)
  extends OnItemFocusedListener[SourceFocusedEvent] {

  override def onFocused(event: SourceFocusedEvent): Unit = {
    val sync = for {
      _ <- actions.outlineArea onSourceFocused event
      _ <- actions.detailArea onSourceFocused event
    } yield ()

    Seq(sync) foreach runAsync { Log error _.toString }
  }
}

class SourceSelectedObserver(actions: Actions)
  extends OnSourceSelectedListener {

  override def onSourceSelected(event: SourceSelectedEvent): Unit = {
    val sync = for {
      _ <- actions.outlineArea onSourceSelected event
      _ <- actions.sourceArea onSourceSelected event
      _ <- actions.detailArea onSourceSelected event
      _ <- actions.container onSourceSelected event
    } yield ()

    Seq(sync) foreach runAsync { Log error _.toString }
  }
}

class SourceSkippedObserver(actions: Actions)
  extends OnItemSkippedListener[SourceSkippedEvent] {

  override def onSkipped(event: SourceSkippedEvent): Unit = {
{'fraction_non_alphanumeric': 0.07975667455221358, 'fraction_numerical': 0.008110848259547145, 'mean_word_length': 4.873015873015873, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 3, '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': '18914', 'n_tokens_mistral': 894, 'n_tokens_neox': 861, 'n_words': 177}