Skip to content

Change order of figures and tables qmds - #534

Open
sbreitbart-NOAA wants to merge 11 commits into
mainfrom
fix-fig-tab-order
Open

Change order of figures and tables qmds#534
sbreitbart-NOAA wants to merge 11 commits into
mainfrom
fix-fig-tab-order

Conversation

@sbreitbart-NOAA

@sbreitbart-NOAA sbreitbart-NOAA commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What is the feature?

  • Change order of figures and tables docs from tables/figures --> figures/tables, so that TOC elements are in logical order
  • Add messages alerting users about the change

How have you implemented the solution?

  • Mostly changing "08_tables.qmd" --> "09_tables.qmd", and vice versa for figures

Does the PR impact any other area of the project, maybe another repo?

  • No

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • PR base branch is accurate
  • Is the code concise?
  • Comments are clear and useful.
  • Can you remove or combine any arguments?
  • Do argument contain defaults (if appliable)?
  • Code is documented and example provided (Roxygen).
  • Did you make a test (testthat)?
  • Was this tested under multiple scenarios?
  • Did you run devtools::check()?

@sbreitbart-NOAA

Copy link
Copy Markdown
Collaborator Author

@copilot Add these functionalities:

  1. Check if a user has figures/tables docs in the original order (tables, then figures, as opposed to this new order of figures, then tables). If so, show a message (using the "cli" package) explaining that figure/table document order has been switched to maintain a logical order of items in the table of contents
  2. Update workflows to ensure figures/tables documents can be updated by adding more figures/tables even if those documents are in the original order, and then rename them to abide by the new order (e.g., switch "08_tables.qmd" to "09_tables.qmd", and switch "09_figures.qmd" to "08_figures.qmd")
  3. In the previous commit, the order of figures and tables docs was reversed. Update text in, e.g., vignettes, so that the text is in chronological order (e.g., edit "Your "09_tables.qmd" and "08_figures.qmd" files are used to..." to "Your "08_figures.qmd" and "09_tables.qmd" files are used to...")

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@copilot Add these functionalities:

  1. Check if a user has figures/tables docs in the original order (tables, then figures, as opposed to this new order of figures, then tables). If so, show a mess...

Implemented in commit a3be631.

  • Added legacy-order detection with cli messaging explaining the switch to 08_figures.qmd then 09_tables.qmd for logical TOC ordering.
  • Updated figure/table doc generation workflows so legacy files (09_figures.qmd, 08_tables.qmd) are still updated and then renamed to the new canonical names.
  • Updated vignette/snippet wording to use chronological order (08_figures.qmd then 09_tables.qmd).
  • Added tests covering legacy filename renaming behavior for both create_figures_doc() and create_tables_doc().

@sbreitbart-NOAA sbreitbart-NOAA linked an issue Aug 17, 2026 that may be closed by this pull request
@sbreitbart-NOAA

Copy link
Copy Markdown
Collaborator Author

@copilot Update the changes to apply to not just 08/09 tables/figures docs; when create_template(type) = "nemt", the file should be changed from "05_tables.qmd" to "06_tables.qmd"; when create_template(type) = "safe", the file should be changed from "11_tables.qmd" to "12_tables.qmd". For figures and nemt, the file should be changed from "06_figures.qmd" to "05_figures.qmd"; when create_template(type) = "safe", the file should be changed from "12_figures.qmd" to "11_figures.qmd".

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@copilot Update the changes to apply to not just 08/09 tables/figures docs; when create_template(type) = "nemt", the file should be changed from "05_tables.qmd" to "06_tables.qmd"; when create_templa...

Implemented in commit c511818. The legacy-order detection, update, and rename logic now also supports NEMT and SAFE mappings:

  • tables: 05_tables.qmd -> 06_tables.qmd (NEMT), 11_tables.qmd -> 12_tables.qmd (SAFE)
  • figures: 06_figures.qmd -> 05_figures.qmd (NEMT), 12_figures.qmd -> 11_figures.qmd (SAFE)

I also added tests covering these legacy rename paths for both create_figures_doc() and create_tables_doc().

@sbreitbart-NOAA

Copy link
Copy Markdown
Collaborator Author

@copilot Update workflow so that, if a legacy figures/tables order is detected, the skeleton file is updated to place the figures chunk before the tables chunk

Comment thread R/create_figures_doc.R Outdated
)
)
}
legacy_figures_docs <- c("09_figures.qmd", "06_figures.qmd", "12_figures.qmd")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you generalize this code as a function in utils then reference it in each function instead? This code is general repeated and applied to each function so it seems like you could. This is a decent amount of added code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry to clarify I meant the entire added code and not just this line

@Schiano-NOAA Schiano-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good from a functional standpoint, but please adjust based on my comments then please re-ping for review

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.

Swap order of figures and tables docs

3 participants