DeckGL pane in a FlexBox keeps reverting to initial_view_state

Hi there,

I’ve got a pn.layout.FlexBox that contains a pn.pane.DeckGL, but every time another item is added or removed from the FlexBox the DeckGL either

(1) flashes when view_state == initial_view_state or
(2) reverts to the initial_view_state when the map has been moved.

I’ve added a small example script and a video below. Any ideas on why this happens or how to prevent it?

Regards,
Bert

import panel as pn
import pydeck
import param

class Test(param.Parameterized):

    add = param.Action(default = lambda x: x.add_card())
    remove = param.Action(default = lambda x: x.remove_card())

    fb: pn.layout.FlexBox = param.ClassSelector(
        default=pn.layout.FlexBox(),
        class_=pn.layout.FlexBox
    )
    
    pane: pn.pane.DeckGL = param.ClassSelector(
        class_=pn.pane.DeckGL
    )

    def __init__(self, **params):
        super().__init__(**params)
        self.pane = self.make_deck()
        self.fb.append(self.param["add"])
        self.fb.append(self.param["remove"])
        self.fb.append(self.pane)

    @param.depends("pane.view_state", watch = True)
    def view_state_monitor(self):
        print(self.pane.view_state)
        
    def add_card(self):
        card = self.make_card()
        self.fb.append(card)

    def remove_card(self):
        if len(self.fb) >= 4:
            self.fb.pop(3)

    def make_card(self):
        return pn.Column(
            f"# Hello! {len(self.fb)}", 
            width = 200, 
            height = 200,
            styles = {
                "background-color": "green",
                "margin": "5px"
            }
        )
    
    @staticmethod
    def make_deck():
        map_style = "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
        view_state = pydeck.ViewState(
            latitude=49.254,
            longitude=-123.13,
            zoom=11,
            max_zoom=16,
            pitch=45,
            bearing=0
        )
        r = pydeck.Deck(
            map_style=map_style,
            initial_view_state=view_state
        )
        pane = pn.pane.DeckGL(
            r, 
            width = 500,
            height=500
        )
        return pane

if __name__ == "__main__":
        
    test = Test()
    pn.serve(test.fb, threaded=True, show=False, port=8000)

Sounds like a bug. One thing I would try is using .servable() & panel serve app.py and without threaded to see if it changes anything.