8000 Fix generator placeholder and optimize updates by ahuang11 · Pull Request #6105 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@ahuang11
Copy link
Contributor
@ahuang11 ahuang11 commented Dec 20, 2023

In generator tasks, the condition while not task.done() and num_entries == len(self._chat_log): leads to tasks completing almost instantly, as generators are lazily evaluated. Consequently, relying on task.done() becomes unreliable.

When using submit_task(generator), the state.FiNISHED is quickly reached because, technically, the generator is lazily evaluated and returned. To illustrate, the generator is considered "finished" in a mere 1.33 microseconds, as depicted in the image below:

image

So it's not reliable to depend on task.done() Instead, we should use callback_state.IDLE to track business (when re-reading this, I was confused and realized, business -> busy-ness)

Also, this updates how the placeholder text gets updated.

Addresses
https://discourse.holoviz.org/t/spinning-icon-effect-that-appears-when-the-user-sends-a-message-in-chatinterface/6582/10?u=ahuang11

@codecov
Copy link
codecov bot commented Dec 20, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (7f25eb1) 84.67% compared to head (7c97bfa) 84.65%.

Files Patch % Lines
panel/chat/feed.py 50.00% 2 Missing ⚠️
panel/tests/chat/test_feed.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6105      +/-   ##
==========================================
- Coverage   84.67%   84.65%   -0.02%     
==========================================
  Files         296      296              
  Lines       44100    44105       +5     
==========================================
- Hits        37341    37338       -3     
- Misses       6759     6767       +8     
Flag Coverage Δ
ui-tests 40.69% <6.66%> (-0.01%) ⬇️
unitexamples-tests 72.66% <80.00%> (-0.02%) ⬇️

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 philippjfr merged commit 6d1750d into main Jan 9, 2024
@philippjfr philippjfr deleted the fix_placeholder_generator branch January 9, 2024 17:48
This was referenced Jan 17, 2024
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0