Skip to content

Report section dispatch system - #94

Open
maxkarlsson wants to merge 8 commits into
mainfrom
workflow-report-registry-v2
Open

Report section dispatch system#94
maxkarlsson wants to merge 8 commits into
mainfrom
workflow-report-registry-v2

Conversation

@maxkarlsson

@maxkarlsson maxkarlsson commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Description

This adds the report argument to the workflow registration so that it is possible to associate tabs with a workflow. The Quarto main file has been downgraded to a preamble + section dispatcher to follow the recipe in the registered workflow.

Added

  • Workflows register a Quarto report recipe (preamble + sections) via register_es_data_workflow(), retrieved with get_es_workflow_report().

Changed

  • The Quarto shell dispatches report sections from the registered workflow recipe. Shared children live under inst/quarto/shared/; workflow-owned children live under inst/quarto/workflows/<id>/.

Type of change

  • New feature

How Has This Been Tested?

Tests have been added and manual tests.

PR checklist:

  • I have run R CMD check on the package and it passes.
  • I have made changes to the documentation.
  • I have added tests.
  • I have documented any significant changes in CHANGELOG.md

Note

Medium Risk
Breaking change to register_es_data_workflow() and report assembly path; misconfigured extension workflows fail at registration or render time, though built-in paths are covered by tests.

Overview
Workflows now own the HTML report layout, not only data extractors. register_es_data_workflow() takes a required report factory that returns a recipe (preamble child paths + tab sections with id, title, child). Recipes are validated at registration (structure, unique section ids, on-disk child paths). get_es_workflow_report() retrieves the recipe; amplicon_demux registers .amplicon_demux_report() on load.

pixelatorES.qmd is a thin shell: it loads the recipe for params$workflow, knits preamble children, then builds the panel tabset from sections. Section .qmd files move under inst/quarto/shared/ (cross-workflow) and inst/quarto/workflows/<id>/ (workflow-specific).

Also adds exported test_es_data() for aligned test fixtures and switches tests away from hand-built structure(..., class = "es_data"). Breaking for anyone who registered workflows in 0.12.0 without a report argument.

Reviewed by Cursor Bugbot for commit 117a38a. Bugbot is set up for automated code reviews on this repo. Configure here.

@maxkarlsson
maxkarlsson marked this pull request as ready for review August 10, 2026 09:40
@maxkarlsson
maxkarlsson requested review from Aratz and johandahlberg and a balanced review from Copilot August 10, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds workflow-specific Quarto report recipes and dynamically assembles reports from registered workflow definitions.

Changes:

  • Extends workflow registration with validated report factories.
  • Reorganizes Quarto content into shared and workflow-specific sections.
  • Adds tests and documentation for report recipes.

Reviewed changes

Copilot reviewed 8 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
R/workflow_registry.R Adds report registration, validation, and retrieval.
R/es_data.R Defines the amplicon-demux report recipe.
R/zzz.R Registers the built-in report factory.
NAMESPACE Exports the report getter.
tests/testthat/test_es_data.R Tests report recipes and validation.
inst/quarto/pixelatorES.qmd Dynamically dispatches report children.
inst/quarto/shared/preprocessing.qmd Provides shared report setup.
inst/quarto/shared/samples.qmd Provides the shared samples section.
inst/quarto/shared/run_settings.qmd Provides shared run metadata.
inst/quarto/workflows/amplicon_demux/quality_metrics.qmd Adds workflow quality metrics.
inst/quarto/workflows/amplicon_demux/cell_annotation.qmd Adds cell annotation content.
inst/quarto/workflows/amplicon_demux/abundance.qmd Adds abundance content.
inst/quarto/workflows/amplicon_demux/spatial.qmd Adds spatial metrics content.
man/register_es_data_workflow.Rd Documents the report parameter.
man/get_es_workflow_report.Rd Documents report retrieval.
DEVELOPERS.md Explains workflow report development.
CHANGELOG.md Records the report-recipe feature.
Files not reviewed (2)
  • man/get_es_workflow_report.Rd: Generated file
  • man/register_es_data_workflow.Rd: Generated file
Suppressed comments (1)

R/workflow_registry.R:218

  • The factory output is validated only during registration, but this public getter invokes the factory again and returns that later result unchecked. A stateful or environment-dependent factory can therefore register successfully and then supply a malformed recipe that fails unpredictably inside the Quarto dispatcher. Validate each produced recipe before returning it.
get_es_workflow_report <- function(name) {
  return(.get_es_workflow_definition(name)$report())
}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread inst/quarto/pixelatorES.qmd Outdated
Comment thread R/workflow_registry.R

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7659fac. Configure here.

Comment thread R/workflow_registry.R
@maxkarlsson maxkarlsson changed the title Revert "Revert accidental direct pushes to main (moved to workflow-re… Report section dispatch system Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants