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

Stylize chat components #6346

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Stylize chat components #6346

merged 2 commits into from
Feb 15, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Feb 14, 2024

Allows properly targeting and styling parts of the ChatMessage

import panel as pn

pn.extension()

pn.chat.ChatMessage(
    "Testing",
    show_activity_dot=True,
    stylesheets=[
        """                    
    .message {
        background-color: tan;
        font-size: 24px;
        font-family: "Courier New";
    }
    .avatar {
        background-color: red;
        border-radius: 5%;
    }
    .right {
        background-color: grey;
    }
    .center {
        background-color: pink;
    }
    .left {
        background-color: yellow;
    }
    .header {
        background-color: green;
    }
    .footer {
        background-color: blue;
    }
    .name {
        background-color: orange;
    }
    .timestamp {
        background-color: purple;
    }
    .activity-dot {
        background-color: black;
    }
    .reaction-icons {
        background-color: white;
    }
    .copy-icon {
        background-color: gold;
    }
"""
    ],
).show()
image

I did notice that parts of the chat message alignment isn't ideal (e.g. left doesn't fill all the way squarely).

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (723768e) 82.65% compared to head (b2ea056) 84.12%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6346      +/-   ##
==========================================
+ Coverage   82.65%   84.12%   +1.46%     
==========================================
  Files         305      305              
  Lines       45468    45499      +31     
==========================================
+ Hits        37580    38274     +694     
+ Misses       7888     7225     -663     
Flag Coverage Δ
ui-tests 40.81% <11.76%> (+2.20%) ⬆️
unitexamples-tests 71.63% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr
Copy link
Member

Some test failures, otherwise looks good.

@philippjfr philippjfr merged commit 47e7bfa into main Feb 15, 2024
15 checks passed
@philippjfr philippjfr deleted the stylize_chat_components branch February 15, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants