@@ -644,7 +644,12 @@ async def _patches_handler(self, patches: tuple[CellPatch, ...]) -> Jsonifiable:
644644 # Add (or overwrite) new cell patches by setting each patch into the cell patch map
645645 self ._set_cell_patch_map_patches (patches )
646646
647+ # With the patches applied, any data retrieved while processing cell style
648+ # will use the new patch values.
649+ await self ._attempt_update_cell_style ()
650+
647651 # Upgrade any HTML-like content to `CellHtml` json objects
652+ # for sending to the client
648653 processed_patches : list [CellPatchProcessed ] = [
649654 {
650655 "row_index" : patch ["row_index" ],
@@ -658,14 +663,12 @@ async def _patches_handler(self, patches: tuple[CellPatch, ...]) -> Jsonifiable:
658663 for patch in patches
659664 ]
660665
661- # Prep the processed patches for sending to the client
666+ # Prep the processed patches as dictionaries for sending to the client
662667 jsonifiable_patches : list [Jsonifiable ] = [
663668 cell_patch_processed_to_jsonifiable (ret_processed_patch )
664669 for ret_processed_patch in processed_patches
665670 ]
666671
667- await self ._attempt_update_cell_style ()
668-
669672 # Return the processed patches to the client
670673 return jsonifiable_patches
671674
@@ -715,7 +718,7 @@ async def _attempt_update_cell_style(self) -> None:
715718 if not callable (styles_fn ):
716719 return
717720
718- # TODO-barret; Use the returned data type from the rener function!
721+ # TODO-barret; Use the returned data type from the render function!
719722 to_original_type_fn = self ._nw_data_to_original_type_fn ()
720723 patched_into_data = to_original_type_fn (self ._data_patched ())
721724 new_styles = as_browser_style_infos (styles_fn , into_data = patched_into_data )
0 commit comments