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

Implement Placeholder pane #6790

Merged
merged 3 commits into from May 14, 2024
Merged

Implement Placeholder pane #6790

merged 3 commits into from May 14, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Apr 24, 2024

Philipp and I were discussing #6617 and thought it'd be useful to have a placeholder pane to easily replace the contents with any object.

Previously:

column = pn.Column("Hello")
column

column.objects = [pn.widgets.TextInput(value="Hello again!")]

Now:

placeholder = pn.pane.Placeholder("⏳ Idle")
placeholder

placeholder.object = pn.widgets.TextInput(value="Hello again!")

Additionally, it can be used as a context manager to replace objects and revert back to the original.

Screen.Recording.2024-04-24.at.12.49.53.PM.mov

This could potentially be used to refactor ChatMessage too.

@ahuang11 ahuang11 assigned ahuang11 and unassigned ahuang11 Apr 24, 2024
@ahuang11 ahuang11 added the type: feature A major new feature label Apr 24, 2024
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 97.91667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 70.98%. Comparing base (cdcd074) to head (73b1260).
Report is 48 commits behind head on main.

Files Patch % Lines
panel/pane/placeholder.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6790       +/-   ##
===========================================
+ Coverage   22.10%   70.98%   +48.87%     
===========================================
  Files         314      317        +3     
  Lines       46326    46692      +366     
===========================================
+ Hits        10240    33142    +22902     
+ Misses      36086    13550    -22536     
Flag Coverage Δ
unitexamples-tests ?

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.

@ahuang11
Copy link
Contributor Author

Unrelated test failures

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from ipyleaflet import Map, VideoOverlay
      3 m = Map(center=(25, -115), zoom=4)
      5 video = VideoOverlay(
      6     url="https://www.mapbox.com/bites/00188/patricia_nasa.webm",
      7     bounds=((13, -130), (32, -100))
      8 )

ModuleNotFoundError: No module named 'ipyleaflet'

@philippjfr philippjfr added this to the v1.5.0 milestone May 14, 2024
@philippjfr
Copy link
Member

Added an .update method since it looks a little cleaner imo and can more easily be used in a callback or pipeline.

@philippjfr philippjfr merged commit dff4b5d into main May 14, 2024
14 of 15 checks passed
@philippjfr philippjfr deleted the placeholder_Pane branch May 14, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A major new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants