<commit_before>(ns braid.ui.views.pages.thread
  (:require [reagent.core :as r]
            [reagent.ratom :refer-macros [reaction]]
            [chat.client.reagent-adapter :refer [subscribe]]
            [braid.ui.views.thread :refer [thread-view]]
            [chat.client.dispatcher :refer [dispatch!]]))

(defn single-thread-view
  []
  (let [page (subscribe [:page])
        group-id (subscribe [:open-group-id])
        thread-id (reaction (first (@page :thread-ids)))
        all-threads (subscribe [:threads])
        thread (reaction (if-let [th (get @all-threads @thread-id)]
                           th
                           (do (dispatch! :load-threads
                                          {:thread-ids [@thread-id]})
                               nil)))]
    (fn []
      [:div.page.single-thread
       [:div.title "Thread"]
       [:div.content
        (if-let [th @thread]
          [thread-view th]
          [:div.loading])]])))<commit_msg>single-thread view uses new single-thread sub<commit_after>(ns braid.ui.views.pages.thread
  (:require [reagent.core :as r]
            [reagent.ratom :refer-macros [reaction]]
            [chat.client.reagent-adapter :refer [subscribe]]
            [braid.ui.views.thread :refer [thread-view]]
            [chat.client.dispatcher :refer [dispatch!]]))

(defn single-thread-view
  []
  (let [page (subscribe [:page])
        group-id (subscribe [:open-group-id])
        thread-id (reaction (first (@page :thread-ids)))
        thread (subscribe [:thread] [thread-id])]
    (fn []
      [:div.page.single-thread
       [:div.title "Thread"]
       [:div.content
        (if-let [th @thread]
          [thread-view th]
          (do (dispatch! :load-threads
                         {:thread-ids [@thread-id]})
            [:div.loading]))]])))
{'fraction_non_alphanumeric': 0.1581267217630854, 'fraction_numerical': 0.0, 'mean_word_length': 1.8871224165341813, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2998976', 'n_tokens_mistral': 558, 'n_tokens_neox': 545, 'n_words': 116}