Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/portal/src/components/ui/sonner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@ export const Default: Story = {
});
},
};

export const NoMatchingReportTemplates: Story = {
render: () => (
<div>
<Button onClick={() => toast.info("No report templates matched this run", {
description: "No report was queued. Check the active report templates and their triggers.",
})}>
Show no-match feedback
</Button>
<Toaster />
</div>
),
play: async ({ canvas }) => {
await userEvent.click(canvas.getByRole("button", { name: "Show no-match feedback" }));
await waitFor(async () => {
await expect(screen.getByText("No report templates matched this run")).toBeVisible();
});
},
};
12 changes: 9 additions & 3 deletions apps/portal/src/pages/RunDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,14 @@ export function RunDetail() {
const generateReport = useMutation({
mutationFn: () => api.triggerReports(id!),
onSuccess: (data) => {
toast.success(`${data.triggered} report(s) queued`);
refetchReports();
if (data.triggered === 0) {
toast.info("No report templates matched this run", {
description: "No report was queued. Check the active report templates and their triggers.",
});
} else {
toast.success(`${data.triggered} ${data.triggered === 1 ? "report" : "reports"} queued`);
refetchReports();
}
},
onError: (err) => {
toast.error(err instanceof Error ? err.message : "Failed to generate report");
Expand Down Expand Up @@ -1124,7 +1130,7 @@ export function RunDetail() {
className="gap-1.5"
>
<Plus className="h-4 w-4" />
Generate Report
Generate matching reports
</Button>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions docs/architecture/app-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ A sibling affordance, `components/ShortId.tsx`, applies the same hoverable-toolt
trigger stays an inline `<span>` (not a link) so the row click still navigates to the run; the
copy button calls `e.stopPropagation()` so copying never triggers row navigation.

Run detail's **Generate matching reports** action evaluates active report
template triggers for that run. A zero-match response is shown as an informational
message explaining that nothing was queued; positive counts use singular or
plural success text.

## Criteria System

Criteria are reusable evaluation rules stored in the database and optionally defined in `config/criteria/*.yaml`. They support:
Expand Down