posit-dev / posit-dev/shinychat

Append UI element in message as user

Open
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
139
Forks
28
Avg merge
23h 44m
Merged PRs (30d)
50

Description

Is that possible to attach UI element as a user response? For example, I want to make a chat UI where user can upload files. I want to append some UI element together with the message to indicate files have been added.

I find this works as expected if the role is "assistant", but as "user" it just render it as plan text. Is that a bug or expected behaviour?

shinychat::chat_append(
        "chat", 
        role = "user",
        response = list(
          list(
            div(
              span(bsicons::bs_icon("filetype-pdf", size = "1.5em"),
                   shiny::strong("client_contract.pdf"),
                   bsicons::bs_icon("cloud", size = "1.5em"),
                   shiny::strong("examples")
              )
            )
          )
        )

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shinychat::chat_append call shown in the issue and compare how the response is rendered for role "user" versus "assistant". Verify whether UI elements are intentionally treated as plain text for user messages; done means the expected behavior is documented or UI elements render consistently for the requested role.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.