Repository navigation
fix: count every instrument edition on the dashboard - #1893
Merged
Merged
Conversation
The records dialog matched records only against each instrument's latest edition, dropping the records of older editions; it now counts each record under its instrument's name. The Total Instruments card counted every edition in the database; it now counts the latest edition of each instrument the group may administer, the same set its dialog lists. Fixes #1886 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Number of Records dialog is now a DataTable: a search bar, sortable Title and Number columns, and the instruments with the most records first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Users and Available Instruments dialogs become searchable, sortable tables like the records dialog, with each instrument kind shown as its colour tag. All three dialogs show their tables as plain text, without borders, under larger bold column headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The legend spans the whole card rather than the plot area, sits a line below the chart, and spaces its two items evenly apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each trend card has a time window in its top right corner: Default (the original five points thirty days apart), the last month, 3 or 6 months, the last year, 2 or 5 years, or all time. Points are spaced to suit the window, all time takes the shortest window holding every item, and an axis reaching back more than a year is labelled by month and year. GET /v1/summary takes recordTrendWindow and subjectTrendWindow, so the two charts are independent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
@thomasbeaudry pnpm test:e2e: 385 passed, 4 failed |
The hub list is paginated over the shared catalog, so an instrument another spec adds can push the new series off the first page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joshunrau
approved these changes
Nov 10, 2026
joshunrau
approved these changes
Nov 10, 2026
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1886, and reworks the dashboard's dialogs and trend charts.
Fix (#1886)
Records dialog counts every edition. A record keeps the id of the edition it was collected with, but the dialog matched records only against each instrument's latest edition. It now loads
allEditionsinstrument info and counts each record under its instrument'sinternal.name. The rows add up to the "Total Records" card. (Records whose instrument the group can no longer access still count in the card but have no row.)"Total Instruments" counts what its dialog lists.
InstrumentsService.countused to callfind({}, {})with no ability and no group, so it counted every edition and series in the database. It now takes the current user and the group and applies the dialog's rule: the latest edition of each instrument fromfindInfo, narrowed to the group'saccessibleInstrumentIds. The group lookup is scoped withaccessibleQuery(ability, 'read', 'Group'), and a group it cannot find throwsNotFoundException.GET /v1/summarypasses@CurrentUser().Dashboard changes
DataTables, each with a search bar and sortable columns (SortableHeader). The records dialog lists the most records first. Instrument kinds show asInstrumentKindCellcolour tags. The tables are shown as plain text, with no frame, row or cell borders, under larger bold headers.GET /v1/summarytakesrecordTrendWindowandsubjectTrendWindow($SummaryQueryParams, parsed withParseSchemaPipe), so the two charts are independent. Omitting both gives the previous response.Verification
dashboard.test.tsx:should count the records of every edition, so older editions are not dropped from the dialog, plus dialog search and sort, kind tags, window selection and axis labels.instruments.service.test.ts(count): edition rule, group narrowing, group lookup scoped by ability, missing group rejected.summary.service.test.ts:should count instruments with the same edition rule and group scope as the instruments dialog, plus point spacing for each window, independent windows, and the All Time window choice.TrendWindowSelect.test.tsxanduseSummaryQuery.test.ts: the window options, and the query key treating an omitted window as the default.testing/src/specs/dashboard.spec.ts.should count the records of every edition of an instrument, matching both cards to their dialogscreates edition 1, a group, then edition 2, with 3 + 2 records. Against the old code it fails with the row showing 2 instead of 5.pnpm lintpasses in all 34 workspaces (run twice).pnpm test:coverage: 100% statements, branches, functions and lines, 5561 passed; the run exits 1 on one unhandled rejection thatmain'sremote-assignment.test.tsxraises during teardown (window is not definedin a libui Form submit), untouched by this branch.pnpm test:e2e: 385 passed, 4 failed:record-file-deletionneeds S3 locally, andinstrument-hubandsubject-detail(chromium and firefox) passed when re-run serially (16/16).Notes
instrument-hub.spec.tsnow searches for the series it creates. The hub list is paginated over the shared catalog, and the instrument this branch's dashboard spec adds pushed that series off the first page in CI.Groupwould now get a 500 fromGET /v1/summary?groupId=…, becauseaccessibleQuerythrows. Every base permission level holdsread Group.Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com