<commit_before>(in-package :wf/web)

(defun grouped-page ()
  (ps

    (def-component grouped
        (psx
         (:div :style (create "margin-bottom" "1em")
               (when (prop warstats)
                 (if (getprop (prop warstats) (prop root-article-id))
                     (psx
                      (:target-title
                       :key (unique-id)
                       :display-depth 0
                       :intro-text "Article: "
                       :warstats (getprop (prop warstats) (prop root-article-id))
                       :... (getprop (prop roots) (prop root-article-id))))
                     (psx (:div "Loading...")))
                 (collecting
                     (dotree (itm (ensure-array (prop group))
                                  :proc-branch nil :proc-leaf t)
                       (let ((depth (@ *tree-stack* length)))
                         (collect
                             ;;FIXME: support non-integer itm
                             (if (getprop (prop warstats) itm)
                                 (psx
                                  (:target-title
                                   :key (unique-id)
                                   :display-depth depth
                                   :intro-text "Article: "
                                   :warstats (getprop (prop warstats) itm)
                                   :... (getprop (prop roots) itm)))
                                 (psx (:div "Loading...")))))))))))

    (defun %grouped-warstats-urls (tree)
      (let ((res (create)))
          (dolist (id (flatten tree) res)<commit_msg>Implemented non-extracted display<commit_after>(in-package :wf/web)

(defun grouped-page ()
  (ps

    (def-component grouped
        (psx
         (:div :style (create "margin-bottom" "1em")
               (when (prop warstats)
                 (if (getprop (prop warstats) (prop root-article-id))
                     (psx
                      (:target-title
                       :key (unique-id)
                       :display-depth 0
                       :intro-text "Article: "
                       :warstats (getprop (prop warstats) (prop root-article-id))
                       :... (getprop (prop roots) (prop root-article-id))))
                     (psx (:div "Loading...")))
                 (collecting
                     (dotree (itm (ensure-array (prop group))
                                  :proc-branch nil :proc-leaf t)
                       (let ((depth (@ *tree-stack* length)))
                         (cond ((numberp itm)
                                (collect
                                    (if (getprop (prop warstats) itm)
                                        (psx
                                         (:target-title
                                          :key (unique-id)
                                          :display-depth depth
                                          :intro-text "Article: "
                                          :warstats (getprop (prop warstats) itm)
                                          :... (getprop (prop roots) itm)))
                                        (psx (:div "Loading...")))))
                               ((stringp itm)
                                (collect
                                    (psx
                                     (:reference
                                      :key (unique-id)
;;;FIXME: URL generation should only be in one place!
                                      :url (strcat "/target/?newurl="
                                                   (encode-u-r-i-component itm))
                                      :domain (url-domain itm)
                                      :external-link itm))))))))))))

    (defun %grouped-warstats-urls (tree)
      (let ((res (create)))
          (dolist (id (flatten tree) res)
{'fraction_non_alphanumeric': 0.10783055198973042, 'fraction_numerical': 0.0010269576379974327, 'mean_word_length': 0.8154706430568499, 'pattern_counts': {'":': 0, '<': 3, '<?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': 37, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1508953', 'n_tokens_mistral': 932, 'n_tokens_neox': 860, 'n_words': 224}