<commit_before>class CollaborativeClientFinderPane extends Pane

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

    options.cssClass = "finder-pane nfinder file-container client-finder-pane"

    super options, data

    @container    = new KDView
      cssClass    : "client-finder-pane"

    panel         = @getDelegate()
    workspace     = panel.getDelegate()
    {@sessionKey} = @getOptions()
    @workspaceRef = workspace.firepadRef.child @sessionKey

    @createLoader()

    @workspaceRef.on "value", (snapshot) =>
      files = snapshot.val()?.files
      return  unless files

      fileInstances = []

      for file in files
        fileInstance = FSHelper.createFileFromPath file.path, file.type
        fileInstance.vmName = file.vmName
        fileInstances.push fileInstance

      @fileTree = new CollaborativeClientTreeViewController { @workspaceRef, workspace }, fileInstances

      view = @fileTree.getView()
      @container.updatePartial ""
      @container.addSubView view

  createLoader: ->
    @container.addSubView loaderContainer = new KDView
      cssClass    : "loader-container"

    loaderContainer.addSubView new KDLoaderView
      showLoader  : yes
      size        :
        width     : 32

    loaderContainer.addSubView new KDCustomHTMLView
      tagName     : "p"
      partial     : "Fetching remote file tree"

  pistachio: ->
    """
      {{> @header}}
      {{> @container}}
    """


class CollaborativeClientTreeViewController extends JTreeViewController

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

    options.nodeIdPath        = "path"
    options.nodeParentIdPath  = "parentPath"
    options.contextMenu       = no
    options.loadFilesOnInit   = yes
    options.treeItemClass     = NFinderItem

    super options, data

  dblClick: (nodeView, event) ->
    nodeData = nodeView.getData()
    @getOptions().workspaceRef.set "ClientWantsToInteractWithRemoteFileTree":
      path   : nodeData.path
      type   : nodeData.type
      vmName : nodeData.vmName<commit_msg>Workspace: Added requestedBy as nickname to client finder to track who requested to interact a file/folder on remote filetree.<commit_after>class CollaborativeClientFinderPane extends Pane

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

    options.cssClass = "finder-pane nfinder file-container client-finder-pane"

    super options, data

    @container    = new KDView
      cssClass    : "client-finder-pane"

    panel         = @getDelegate()
    workspace     = panel.getDelegate()
    {@sessionKey} = @getOptions()
    @workspaceRef = workspace.firepadRef.child @sessionKey

    @createLoader()

    @workspaceRef.on "value", (snapshot) =>
      files = snapshot.val()?.files
      return  unless files

      fileInstances = []

      for file in files
        fileInstance = FSHelper.createFileFromPath file.path, file.type
        fileInstance.vmName = file.vmName
        fileInstances.push fileInstance

      @fileTree = new CollaborativeClientTreeViewController { @workspaceRef, workspace }, fileInstances

      view = @fileTree.getView()
      @container.updatePartial ""
      @container.addSubView view

  createLoader: ->
    @container.addSubView loaderContainer = new KDView
      cssClass    : "loader-container"

    loaderContainer.addSubView new KDLoaderView
      showLoader  : yes
      size        :
        width     : 32

    loaderContainer.addSubView new KDCustomHTMLView
      tagName     : "p"
      partial     : "Fetching remote file tree"

  pistachio: ->
    """
      {{> @header}}
      {{> @container}}
    """


class CollaborativeClientTreeViewController extends JTreeViewController

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

    options.nodeIdPath        = "path"
    options.nodeParentIdPath  = "parentPath"
    options.contextMenu       = no
    options.loadFilesOnInit   = yes
    options.treeItemClass     = NFinderItem

    super options, data

  dblClick: (nodeView, event) ->
    nodeData = nodeView.getData()
    @getOptions().workspaceRef.set "ClientWantsToInteractWithRemoteFileTree":
      path        : nodeData.path
      type        : nodeData.type
      vmName      : nodeData.vmName
      requestedBy : KD.nick()
{'fraction_non_alphanumeric': 0.09084372003835091, 'fraction_numerical': 0.0009587727708533077, 'mean_word_length': 2.692920353982301, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 19, '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': '1892167', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1163, 'n_words': 265}