@@ -511,6 +511,7 @@ listings_server <- function(module_id,
511511 }
512512
513513 # NOTE: Pass the reconstructed `filter_mask` as an attribute of `data` itself to ensure they're synchronized
514+ # TODO: Take the filter_mask from dv.manager 3.x.x instead
514515 if (enable_review ) {
515516 attr(data , " filter_mask" ) <- local({
516517 selected_dataset_list_name <- review [[" selected_dataset" ]]()
@@ -575,21 +576,30 @@ listings_server <- function(module_id,
575576
576577 # NOTE: Partially repeats #weilae
577578 annotation_info <- REV_state [[" annotation_info" ]][[selected_dataset_list_name ]][[selected_dataset_name ]]
579+
580+ filter_mask <- attr(table_data [[" data" ]], " filter_mask" )
581+ if (! all(filter_mask )) { # subset `annotation_info` to match data filter
582+ annotation_info <- REV_filter_annotation_info(annotation_info , filter_mask )
583+ }
584+
578585 changes <- REV_include_review_info(
579586 annotation_info = annotation_info ,
580587 data = table_data [[" data" ]],
581588 col_names = table_data [[" col_names" ]]
582589 )
583590 shiny :: validate(shiny :: need(! inherits(changes , " simpleCondition" ), changes [[" message" ]]))
584591
585- latest_reviews <- attr(changes [[" data" ]], " latest_reviews" )
586- data_timestamps <- attr(changes [[" data" ]], " data_timestamps" )
587-
588592 changes [[" data" ]][[REV $ ID $ STATUS_COL ]] <- REV_compute_status(
589- changes [[" data" ]], role , latest_reviews , data_timestamps
593+ dataset_review = changes [[" data" ]],
594+ role = role ,
595+ latest_reviews_by_role = attr(annotation_info , " latest_reviews" ),
596+ data_timestamps = annotation_info [[" data_timestamps" ]]
590597 )
591598
592- changes [[" data" ]][[REV $ ID $ LATEST_REVIEW_COL ]] <- REV_review_var_to_json(latest_reviews , data_timestamps )
599+ changes [[" data" ]][[REV $ ID $ LATEST_REVIEW_COL ]] <- REV_review_var_to_json(
600+ latest_reviews = attr(annotation_info , " latest_reviews" ),
601+ data_timestamps = annotation_info [[" data_timestamps" ]]
602+ )
593603 changes [[" data" ]] <- relocate_column(changes [[" data" ]], REV $ ID $ LATEST_REVIEW_COL , 4L )
594604
595605 review_col_count <- ncol(changes [[" data" ]]) - ncol(table_data [[" data" ]])
0 commit comments