Patterns
Report toolbar
One row above a report's table: the search, a Parameters button for what the report is run on, the Filter, and the Columns chooser. The table gets the screen, not the controls.
Live example
Open Parameters: a project and a date range, the things this report is run on. What you set stays visible beside the button as a chip and as a count on it, so the popover can be closed. Filter narrows the rows by a status. The search matches the species.
Report toolbar
Why
A report's parameters were a labelled grid of fields between the tabs and the toolbar. On the Flora Taxonomy Report at 1440 by 1024 the grid was 156px, and with the card, the tabs and the toolbar the table started 601px down and showed 6 rows; at 800px tall, 2. Content is what a report is for. The pattern puts every control on one row and gives the table at least 7 rows before the page scrolls.
| Flora Taxonomy Report | Table starts | Table height, 1440 x 1024 | Table height, 1440 x 800 |
|---|---|---|---|
| A grid of fields above the toolbar | 601px | 334px, 6 rows | 127px, 2 rows |
| The report toolbar | 445px | 490px, 10 rows | the page scrolls, the table keeps 7 rows |
Anatomy
- The row is, left to right:
ToolbarSearch, the Parameters button, the Filter button, then the Columns chooser at the far right. It wraps on a narrow window; it never grows a second row of its own. - The button is
ParametersPopover(app/pages/_shared/reports/report-parameters.tsx): the design system's secondaryButtonwith the sliders icon, and a count of the parameters that are set. - The popover holds the report's own fields, drawn by the report with the design system's
Select,Inputand date field with a calendar, in one column, with a Reset at the foot. A calendar opened inside it closes on Escape without closing the popover. - The chips beside the button are one per parameter that is set, in the same style as the filter chips. A parameter at its starting value (All projects) is not a chip.
- The report gives
DataReportaparametersprop:fields,summaryand an optionalreset. A report with no parameters passes nothing and has no button. - The table keeps at least 24rem (about 7 rows). Where the controls and the card take more than that, the page scrolls and the table does not shrink.
- An empty report shows one mock record in its table, marked Example record beside the Columns button (
DataReport'sexample), so the columns can be read; it goes as soon as there is a real row. Searching it away leaves the usual "nothing matches" state. - The export still carries the report's title and its parameters above the columns, where the sheet has them (
exportPreamble), so a file says what it was run on.
The rules
- A parameter is what the report is run on; a filter is what you narrow its rows by; the search finds a word. A project, a dataset: parameters, because neither the search nor the Filter can say them. A code, a name or a common name is the search, which matches them already. A family, a region, a person, a status or a date range is a filter attribute (contract section 4.2d, one filter). A control is never in two of these: a report must not ask for the same thing twice.
- One row, in one order: search, Parameters, Filter, Columns. A report with no parameters has no Parameters button: no empty control (section 2.12).
- What is set is always visible. A chip for each parameter that is set and a count on the button, so closing the popover loses nothing. A report that is always on one thing (one dataset) shows it as chips and has no Reset.
- It applies as you choose. No Apply button; the table follows each field (section 1.9, item 2).
- The fields are the design system's and are drawn as in a form: a label above, the same size. A date is the date field with a calendar (section 2.11), empty to start.
- Content first. The card stays (section 4.6); nothing else is added between the tabs and the table.
Used by
Every report on the Reports page. Data Validation Error (project and dataset), Species Detail and Events, Occurrences and Observations (project) have Parameters. The others have none and show no button, and so do the sheets of the Flora and Fauna Taxonomy Reports: a sheet's metadata (a code, a name, a family, a date) is the table's own search and Filter, and the export still writes it above the columns. So are the seven administration reports (User, Role, User - Role, Permission, Role - Permission, Notification Config and Control Vocab Detail): a name or an ID is the search, a list or a date is the Filter.