---
  title: "Quality check log"
  format:
    html:
       embed-resources: true
       page-layout: full
  execute:
    echo: false
    warning: false
    message: false
  ---

  library(readr)
  library(dplyr)
  library(reactable)

  log <- read_csv("quality_log.csv", col_types = cols(
    timestamp = col_character(),
    placeholder_id = col_character(),
    description = col_character(),
    content_type = col_character(),
    output_mode = col_character(),
    content_preview = col_character(),
    code_hash = col_character(),
    changed_code = col_logical(),
    change_summary = col_character()
  ))

  log %>%
    arrange(desc(timestamp)) %>%
    reactable(
      filterable = TRUE,
      searchable = TRUE,
      defaultPageSize = 25,
      columns = list(
        timestamp = colDef(name = "Time"),
        placeholder_id = colDef(name = "Placeholder"),
        description = colDef(name = "Description"),
        content_type = colDef(name = "Type"),
        output_mode = colDef(name = "Mode"),
        content_preview = colDef(name = "Preview"),
        change_summary = colDef(name = "Change")
      ),
      rowStyle = JS("function(rowInfo) {
        if (rowInfo.values.change_summary !== \'none\') {
          return { background: \'#fff7e6\' };
        }
        return null;
      }")
    )'
    
Back to top