Feature 115 header cards & exposed vb_codes#127
Conversation
… to obs detail view
…he py code and label in party table
There was a problem hiding this comment.
Pull request overview
This PR enhances the VegBank web interface by exposing VB codes (unique identifiers) throughout the application. The changes add header cards to detail views containing bold green VB codes and other relevant information, and display small green VB codes below primary columns in tables.
Key changes:
- Added new header cards to party, project, plot, and reference detail views with VB codes prominently displayed
- Updated table columns across all entity types (projects, plots, parties, concepts) to display VB codes in green text below primary identifiers
- Renamed primary table columns to better reflect entity types (e.g., "Name" → "Project", "Author Plot Code" → "Observation Code")
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test_project_table.R | Updates tests for renamed "Project" column with HTML-formatted VB codes |
| tests/testthat/test_plot_table.R | Updates tests for renamed "Observation Code" column with HTML-formatted VB codes |
| tests/testthat/test_plant_table.R | Updates tests for renamed "Plant Concept" column with HTML-formatted VB codes |
| tests/testthat/test_party_table.R | Updates tests for restructured party data using party_label and HTML-formatted VB codes |
| tests/testthat/test_detail_reference.R | Updates tests to use new "reference_header" output name |
| tests/testthat/test_detail_project.R | Updates tests to use new "project_header" output name |
| tests/testthat/test_detail_plot.R | Updates tests to use new "plot_header" output name |
| tests/testthat/test_detail_party.R | Updates tests to use new "party_header" output name |
| tests/testthat/test_detail_helpers.R | Updates test expectations for coalesce function to treat empty strings as falsy |
| tests/testthat/test_detail_concept.R | Updates tests to use new concept header output names |
| tests/testthat/test_concept_table.R | Updates tests for renamed concept columns with HTML-formatted VB codes |
| tests/testthat/test_community_table.R | Updates tests for renamed "Community Concept" column with HTML-formatted VB codes |
| tests/testthat/helper-detail-mocks.R | Changes elevation from string to numeric in mock data |
| R/ui.R | Updates UI output IDs to use generic "header" naming for all detail views |
| R/table_project.R | Adds format_project_name_column function to display project names with VB codes |
| R/table_plot.R | Removes author_plot_code field and adds format_code_column function for displaying observation codes |
| R/table_party.R | Switches from given_name/surname to party_label and adds format_party_name_column function |
| R/table_concept.R | Adds format_concept_name_column function for displaying concept names with VB codes |
| R/detail_view.R | Updates all output assignments to use new header naming convention |
| R/detail_reference.R | Implements reference header card with VB code, type, and publication date |
| R/detail_project.R | Implements project header card with VB code and date range |
| R/detail_plot.R | Implements plot header card with VB code, project link, and date range |
| R/detail_party.R | Implements party header card with VB code and full name construction |
| R/detail_helpers.R | Modifies coalesce operator to treat empty strings as falsy and updates format_date_range to handle equal dates |
| R/detail_concept.R | Updates concept header to display VB codes prominently and removes redundant code row from details table |
| R/detail_comm_class.R | Updates VB code styling to use green color consistently |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
regetz
left a comment
There was a problem hiding this comment.
Thanks @DarianGill for making these changes. I really like it for consistency of headers and making the vb codes available.
I installed from your branch onto the dev VM if you want to see it live.
What:
Closes #115 by adding header cards to the top of every detail view that contain bold green vb codes and relevant information for that entity. And closes #119 by adding small green vb codes below the primary columns for each table.
Why:
So that the vb codes are exposed as UIDs throughout the app in a reliable/consistent fashion and people can more easily find them for use with vegbankr.
How:
Testing & Documentation:
Updated all the tests to enforce the new behavior and added two tests to server.R to check state initialization. Devtools::check() passes with only warnings and notes.