<commit_before>class ActivityAppView extends KDView

  {isKoding, isGroup, isMember} = KD
  {permissions}                 = KD.config

  canListMembers = -> 'list members' in permissions
  isPrivateGroup = -> not isKoding() and isGroup()

  constructor:(options = {}, data)->

    options.cssClass   = 'content-page activity clearfix'
    options.domId      = 'content-page-activity'

    super options, data

    {
      appStorageController
      windowController
      mainView
    }             = KD.singletons
    {entryPoint}  = KD.config

    @appStorage  = appStorageController.storage 'Activity', '2.0'

    @widgetsBar = new ActivityWidgetsBar cssClass : 'hidden'

    @tabs = new KDTabView
      tagName             : 'main'
      hideHandleContainer : yes

    @tabs.on 'PaneDidShow', (pane) =>
      if type = pane.getData()?.typeConstant
        @tabs.setAttribute 'class', KD.utils.curry 'kdview kdtabview', type

    @tabs.unsetClass 'kdscrollview'

  viewAppended: ->

    # @addSubView @groupHeader  unless isKoding()
    # @addSubView @sidebar
    { mainView } = KD.singletons
    @sidebar     = mainView.activitySidebar
    @addSubView @tabs
    @addSubView @widgetsBar


  scroll: ->

    if window.scrollY > 316
    then @setClass 'fixed'
    else @unsetClass 'fixed'


  # type: [topic|post|message|chat|null]
  # slug: [slug|id|name]
  open: (type, slug) ->

    {socialapi, router, notificationController} = KD.singletons

    if type is 'topic' then @widgetsBar.show() else @widgetsBar.hide()

    kallback = (data) =>
      name = if slug then "#{type}-#{slug}" else type
      pane = @tabs.getPaneByName name

      unless @sidebar.selectedItem
        @sidebar.selectItemByRouteOptions type, slug
<commit_msg>Activity: IDE to/from Activity switching scroll problem fixed<commit_after>class ActivityAppView extends KDView

  {isKoding, isGroup, isMember} = KD
  {permissions}                 = KD.config

  canListMembers = -> 'list members' in permissions
  isPrivateGroup = -> not isKoding() and isGroup()

  constructor:(options = {}, data)->

    options.cssClass   = 'content-page activity clearfix'
    options.domId      = 'content-page-activity'

    super options, data

    {
      appStorageController
      windowController
      mainView
    }             = KD.singletons
    {entryPoint}  = KD.config

    @appStorage  = appStorageController.storage 'Activity', '2.0'

    @widgetsBar = new ActivityWidgetsBar cssClass : 'hidden'

    @tabs = new KDTabView
      tagName             : 'main'
      hideHandleContainer : yes
    @tabs.unsetClass 'kdscrollview'

    @tabs.on 'PaneDidShow', (pane) =>
      if type = pane.getData()?.typeConstant
        @tabs.setAttribute 'class', KD.utils.curry 'kdview kdtabview', type


  viewAppended: ->

    # @addSubView @groupHeader  unless isKoding()
    # @addSubView @sidebar
    { mainView } = KD.singletons
    @sidebar     = mainView.activitySidebar
    @addSubView @tabs
    @addSubView @widgetsBar

    @parent.on 'PaneDidShow', =>

      return  unless pane = @tabs.getActivePane()

      KD.utils.defer ->
        pane.applyScrollTops()
        pane.scrollView.verticalTrack.thumb.handleMutation()
        pane.scrollView.horizontalTrack.thumb.handleMutation()


  scroll: ->

    if window.scrollY > 316
    then @setClass 'fixed'
    else @unsetClass 'fixed'


  # type: [topic|post|message|chat|null]
  # slug: [slug|id|name]
  open: (type, slug) ->

    {socialapi, router, notificationController} = KD.singletons

    if type is 'topic' then @widgetsBar.show() else @widgetsBar.hide()

    kallback = (data) =>
      name = if slug then "#{type}-#{slug}" else type
      pane = @tabs.getPaneByName name

      unless @sidebar.selectedItem
        @sidebar.selectItemByRouteOptions type, slug

{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0026392187912377936, 'mean_word_length': 2.8052208835341363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '1350506', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1144, 'n_words': 273}