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

Add placeholder while loading to ChatFeed #7042

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

ahuang11
Copy link
Contributor

To indicate activity while some callbacks are blocking, I've been wanting to have some control over the loading spinner, and have it persist.

Screen.Recording.2024-07-29.at.2.07.19.PM.mov
import asyncio
import panel as pn

pn.extension()

async def callback(message):
    await asyncio.sleep(2)
    return message


chat = pn.chat.ChatInterface(callback=callback, callback_exception="verbose", loading=True)
chat.servable()

@ahuang11 ahuang11 requested a review from philippjfr July 29, 2024 21:07
@ahuang11 ahuang11 changed the title Add placeholder while loading Add placeholder while loading to ChatFeed Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.24%. Comparing base (310309e) to head (174cb2b).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7042      +/-   ##
==========================================
+ Coverage   81.79%   82.24%   +0.44%     
==========================================
  Files         326      326              
  Lines       48307    48327      +20     
==========================================
+ Hits        39514    39745     +231     
+ Misses       8793     8582     -211     

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

@@ -337,6 +337,13 @@ def _update_placeholder(self):
**self.placeholder_params
)

@param.depends("loading", watch=True, on_init=True)
Copy link
Member

Choose a reason for hiding this comment

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

How does this interact with the usual loading spinner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean something like pn.Column("Hello", loading=True)?

image

I don't think anything gets overlaid on ChatInterface besides the individual buttons
pn.chat.ChatInterface("Hello", loading=True).show()

image

@philippjfr philippjfr merged commit aac4114 into main Aug 9, 2024
15 checks passed
@philippjfr philippjfr deleted the add_placeholder_while_loading branch August 9, 2024 09:31
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.

2 participants