Add guided in-app reporting that safely files or endorses GitHub issues and discussions. - Add report actions, modal UI, API routes, and configurable per-action filing modes. - Scrub report payloads, self-check Help requests, and deduplicate before filing or endorsing. - Extend GitHub discussion support and cover the report pipeline with tests and documentation. Files changed: .changeset/fn-8277-agentic-reports.md | 7 + docs/dashboard-guide.md | 8 + docs/settings-reference.md | 2 + .../core/src/__tests__/settings-parity.test.ts | 9 + packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/settings-schema.ts | 2 + packages/core/src/types.ts | 10 + packages/dashboard/app/api.ts | 1 + packages/dashboard/app/api/report.ts | 11 + packages/dashboard/app/components/Header.tsx | 30 +++ .../dashboard/app/components/ReportActionMenu.css | 6 + .../dashboard/app/components/ReportActionMenu.tsx | 22 ++ packages/dashboard/app/components/ReportModal.css | 6 + packages/dashboard/app/components/ReportModal.tsx | 81 ++++++++ .../app/components/__tests__/Header.test.tsx | 7 +- .../components/__tests__/ReportActionMenu.test.tsx | 18 ++ .../app/components/__tests__/ReportModal.test.tsx | 94 +++++++++ .../__tests__/SettingsModal.general.test.tsx | 15 ++ .../settings/sections/GeneralSection.tsx | 31 ++- .../src/__tests__/report-pipeline.test.ts | 127 ++++++++++++ .../dashboard/src/__tests__/report-routes.test.ts | 51 +++++ .../dashboard/src/__tests__/report-scrub.test.ts | 47 +++++ packages/dashboard/src/github.ts | 151 +++++++++++++- packages/dashboard/src/index.ts | 3 + packages/dashboard/src/report-help-selfcheck.ts | 13 ++ packages/dashboard/src/report-pipeline.ts | 225 +++++++++++++++++++++ packages/dashboard/src/report-scrub.ts | 66 ++++++ packages/dashboard/src/routes.ts | 2 + .../dashboard/src/routes/register-report-routes.ts | 118 +++++++++++ 30 files changed, 1156 insertions(+), 11 deletions(-) Fusion-Task-Id: FN-8277 Fusion-Task-Lineage: d50dc1da-7534-4324-ab05-1f8a0ad77c6a Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
23 lines
1.2 KiB
TypeScript
23 lines
1.2 KiB
TypeScript
import { useState } from "react";
|
|
import { Bug, Lightbulb, LifeBuoy, MessageSquare } from "lucide-react";
|
|
import type { ReportActionType } from "@fusion/core";
|
|
import "./ReportActionMenu.css";
|
|
|
|
const actions: Array<{ type: ReportActionType; label: string; Icon: typeof Bug }> = [
|
|
{ type: "bug", label: "Report bug", Icon: Bug },
|
|
{ type: "feedback", label: "Send feedback", Icon: MessageSquare },
|
|
{ type: "idea", label: "Share idea", Icon: Lightbulb },
|
|
{ type: "help", label: "Get help", Icon: LifeBuoy },
|
|
];
|
|
|
|
/** Four guided entry points share the same report pipeline rather than issue textboxes. */
|
|
export function ReportActionMenu({ onSelect }: { onSelect: (action: ReportActionType) => void }) {
|
|
const [open, setOpen] = useState(false);
|
|
return <div className="report-action-menu">
|
|
<button className="btn btn-secondary" type="button" aria-haspopup="menu" aria-expanded={open} onClick={() => setOpen((value) => !value)}>Report</button>
|
|
{open && <div className="report-action-menu__list" role="menu">
|
|
{actions.map(({ type, label, Icon }) => <button className="report-action-menu__item" type="button" role="menuitem" key={type} onClick={() => { setOpen(false); onSelect(type); }}><Icon aria-hidden="true" />{label}</button>)}
|
|
</div>}
|
|
</div>;
|
|
}
|