Skip to content

Add shinymeta-backed QMD report module and capture import metadata#3

Open
JZauner wants to merge 1 commit intomainfrom
codex/integrate-shinymeta-for-qmd-report
Open

Add shinymeta-backed QMD report module and capture import metadata#3
JZauner wants to merge 1 commit intomainfrom
codex/integrate-shinymeta-for-qmd-report

Conversation

@JZauner
Copy link
Contributor

@JZauner JZauner commented Jan 29, 2026

Motivation

  • Provide a consolidated, reproducible report (preferably Quarto QMD) describing imported dataset(s) and the exact import calls used to create them.
  • Ensure the app records import specifications and whether multiple datasets were imported so the report can reflect that.
  • Use shinymeta to capture/expand import call expressions for reproducible workflows without adding new runtime dependencies beyond shinymeta.

Description

  • Add a new report module with reportUI and reportServer that produces a downloadable QMD with an overview and per-dataset details; implementation added in R/report.R.
  • Record import metadata when datasets are added by extending the import flow to collect import_specs and a shinymeta import_call via a new helper build_import_call in R/import.R.
  • Wire the new Report tab into the app UI and server by updating R/LightLogWeb-app.R and ensure test data also include import_specs/import_call in R/dataset_manager.R.
  • Add helpers to build report data (build_report_data), render QMD content (build_report_qmd), and format values and expanded import calls via shinymeta::expandChain and rlang::expr_deparse.
  • Add shinymeta to DESCRIPTION Imports and include a basic test file tests/test-report.R that asserts multi-dataset report content is produced by the helpers.

Testing

  • Added an automated test file at tests/test-report.R that constructs two synthetic datasets and asserts build_report_data() and build_report_qmd() contain the expected dataset counts and names.
  • Tests were not executed in this environment because R was not available, so no runtime test results are available.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd4785f988

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +69 to +70
device = rlang::`%||%`(metadata$device, NA_character_),
tz = rlang::`%||%`(metadata$tz, NA_character_),

Choose a reason for hiding this comment

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

P2 Badge Preserve device/timezone when updating metadata

The report pulls device and tz from dataset$metadata, but datasetDetailServer() overwrites metadata with only variable fields when the user saves variable details (see R/datasetDetail.R lines 98–101). After any edit in Prepare, the report will show “Not recorded” for device/time zone even though those values were captured at import, so the report loses key provenance. Consider preserving existing metadata fields when saving or sourcing device/tz from a stable location.

Useful? React with 👍 / 👎.

Comment on lines +548 to +551
import_call <- build_import_call(
device = input$device,
file_names = input$file$name,
tz = input$tz,

Choose a reason for hiding this comment

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

P2 Badge Use actual imported file paths in recorded call

The report’s reproducible call is built from input$file$name, but the actual import uses filename = new_names() (temp directory paths; see R/import.R around lines 432–435). This means the reported call will not match the real call and won’t run unless the working directory happens to contain those filenames. If the goal is “exact import calls,” capture the same filenames that were used for the import.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant