Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: better display code for stack/workspace #387

Open
DivadNojnarg opened this issue Jun 25, 2024 · 0 comments
Open

Feature: better display code for stack/workspace #387

DivadNojnarg opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@DivadNojnarg
Copy link
Collaborator

In addition to copy to clipboard, would be convenient to have a modal window showing the code (ex generate_server.stack):

Screenshot 2024-06-25 at 08 52 28

Note:

  • We don't necessarily need a specific widget editor like shinyAce...
  • Code output of a filter block is quite ugly and would need to be cleaned: eval(call("==", colname, "aaa")).
observeEvent(input$copy, {

        code <- generate_code(vals$stack) |>
          deparse() |>
          as.character() |>
          as.list()
       
       # Modal
        showModal(
          modalDialog(
            title = "Stack code",
            size = "l",
            shinyAce::aceEditor(
              outputId = session$ns("ace"),
              selectionId = "selection",
              value = styler::style_text(code, strict = TRUE),
              mode = "r",
              wordWrap = TRUE,
              readOnly = TRUE,
              placeholder = "Show a placeholder when the editor is empty ..."
            )
          )
        )
       
       # Copy to clipboard
        session$sendCustomMessage(
          "blockr-copy-code",
          list(
            code = generate_code(vals$stack) |>
              deparse() |>
              as.character() |>
              as.list()
          )
        )
      })

We may not need shinyAce.

@DivadNojnarg DivadNojnarg added the enhancement New feature or request label Jun 25, 2024
@DivadNojnarg DivadNojnarg changed the title Display stack/workspace code in modal Feature: better display code for stack/workspace Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant