Skip to content

Improves badge border and look#82

Merged
averissimo merged 2 commits into
mainfrom
redesign_extraction@main
Jun 23, 2026
Merged

Improves badge border and look#82
averissimo merged 2 commits into
mainfrom
redesign_extraction@main

Conversation

@averissimo

@averissimo averissimo commented May 11, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Companion of insightsengineering/teal#1713 (can be merged before teal PR is merged)

Changes description

  • Fixes visual disappearance of red border when clicking picks
    • Previous implementation of red border looks for existing error class in children
    • Current adds an additional class to wrapper element that keeps it visible
Screencast.From.2026-05-11.14-45-37.mp4

Example app

Please use teal PR to see full range of improvements

#
pkgload::load_all("../teal.picks")
pkgload::load_all("../teal")

data <- within(teal_data(), letters <- data.frame(letter = head(LETTERS)))

picks_letters <- picks(
  datasets("letters", "letters"),
  variables("letter", "letter"),
  values(selected = NULL)
)

my_module <- module(
  label = "My Module",
  datanames = NULL,
  ui = function(id) {
    ns <- NS(id)
    teal.widgets::standard_layout(
      encoding = tagList(
        tags$h3("Letters"),
        teal.picks::picks_ui(ns("letters"), picks_letters),
        tags$h3("Letters2"),
        checkboxGroupInput(ns("letters2"), "Select letters:", choices = head(LETTERS), inline = TRUE),
      ),
      output = tagList(
        tags$h3("Sample plot"),
        plotOutput(ns("plot"))
      )
    )
  },
  server = function(id, data) {
    moduleServer(id, function(input, output, session) {
      selectors <- list(letters = picks_letters)
      anl_inputs <- picks_srv(picks = selectors, data = data)

      validated_q <- reactive({
        validate_input(
          "letters-values-selected",
          condition = length(anl_inputs$letters()$values$selected) > 0,
          message = "Select at least one letter."
        )
        validate_input(
          c("letters-values-selected", "letters2"),
          condition = all(!anl_inputs$letters()$values$selected %in% input$letters2),
          message = "Letters in the first group should not be in the second group."
        )
        data()
      })

      output$plot <- renderPlot({
        letters <- validated_q()$letters$letter
        tab <- rbind(
          Group1 = as.integer(letters %in% anl_inputs$letters()$values$selected),
          Group2 = as.integer(letters %in% input$letters2)
        )
        colnames(tab) <- letters
        barplot(
          tab,
          beside = TRUE, legend.text = TRUE, main = "Selected letters per group",
          col = c("steelblue", "tomato")
        )
      })
    })
  }
)

init(data = data, modules = my_module) |> shiny::runApp()

@averissimo averissimo changed the title feat: improvement on badge border Improves badge border and look May 11, 2026
* origin/main:
  [skip actions] Bump version to 0.1.0.9001
  Allows `allow-clear` option to be set in `variables()` without being overwriten (#90)
  [skip ci] Update WORDLIST
  [skip actions] Bump version to 0.1.0.9000
  [skip vbump] initial release v0.1.0 (#79)
@averissimo averissimo marked this pull request as ready for review June 22, 2026 13:17

@osenan osenan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nothing to add

@osenan osenan self-assigned this Jun 23, 2026
@averissimo averissimo merged commit eb49c52 into main Jun 23, 2026
1 check passed
@averissimo averissimo deleted the redesign_extraction@main branch June 23, 2026 11:39
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants