posit-dev / posit-dev/shinychat

[python]: Revisit `content_type` determination

Open
#124 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

Once https://github.com/posit-dev/shinychat/pull/62 is done, we should revisit the determination of ClientMessage's content_type.

https://github.com/posit-dev/shinychat/blob/82f43c6f78d841e0acc637fdc287d7208f34c666/pkg-py/src/shinychat/_chat.py#L988

And, in fact, that determination should probably be made by ChatMessage.

Note also that after #119, ChatMessage now essentially checks whether content_type is "html" and, if so, wraps it in a "literal HTML" wrapper. I think we could, instead, set content_type="html" (to avoid going through the markdown parser) and remove the need for the "literal HTML" wrapper?

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 in pkg-py/src/shinychat/_chat.py around line 988, then review PR #62 and the changes from issue #119. Trace how ClientMessage and ChatMessage determine content_type and how the literal HTML wrapper interacts with markdown parsing; done means the ownership and resulting behavior are clearly resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.