From 66d9416dc36f51cfbba973f45e36e2a1bde19fd3 Mon Sep 17 00:00:00 2001
From: Adenike <1adenike.akande@gmail.com>
Date: Tue, 20 Oct 2026 13:22:36 +0100
Subject: [PATCH] feat: prerequisites checklist for the audit workflow guide
(#91)
Adds a keyboard-accessible checklist of four items to check before running
an audit scan (Rust toolchain, wasm target, Testkit CLI, clean build),
rendered as a labelled fieldset of checkboxes inside the existing "Audit
workflow tutorial" guide panel. Local component state only; nothing
persisted.
---
docs/accessibility.md | 1 +
src/App.test.tsx | 14 ++++++++++++++
src/App.tsx | 27 +++++++++++++++++++++++++++
3 files changed, 42 insertions(+)
diff --git a/docs/accessibility.md b/docs/accessibility.md
index 4973a38..3f9891e 100644
--- a/docs/accessibility.md
+++ b/docs/accessibility.md
@@ -14,6 +14,7 @@ automatically, what was fixed, and what still needs a manual pass.
| Screen reader | Landmarks, a single `h1`, and named navigation links | `tests/visual/accessibility.spec.ts` |
| Screen reader | Command selector is a labelled group of toggle buttons | `src/App.test.tsx`, `tests/visual/accessibility.spec.ts` |
| Screen reader | Copy results are announced through a polite live region | `src/App.test.tsx`, `tests/visual/accessibility.spec.ts` |
+| Screen reader | Audit prerequisites are a labelled fieldset of checkboxes, each with its own accessible name | `src/App.test.tsx` |
| Zoom | No horizontal page scroll and no clipped controls at 640px and 320px CSS widths | `tests/visual/accessibility.spec.ts` |
These checks read the accessibility tree and computed styles. They do not
diff --git a/src/App.test.tsx b/src/App.test.tsx
index dd594b7..167efde 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -230,6 +230,20 @@ describe("Soroban workflow documentation and prerequisites", () => {
});
});
+describe("Audit workflow prerequisites checklist (#91)", () => {
+ it("lets a user check off audit prerequisites, each with its own accessible name", () => {
+ render();
+
+ fireEvent.click(screen.getByRole("button", { name: "Show tutorial" }));
+
+ const item = screen.getByRole("checkbox", { name: /testkit cli installed/i });
+ expect(item).not.toBeChecked();
+
+ fireEvent.click(item);
+ expect(item).toBeChecked();
+ });
+});
+
describe("Command builder enhancements", () => {
it("allows optional coverage arguments to be reordered", () => {
render();
diff --git a/src/App.tsx b/src/App.tsx
index 48b76e4..d8f3b2f 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -115,6 +115,15 @@ const installationSteps = [
},
];
+// Things worth confirming before running an audit scan (#91). Local-only
+// checklist state; nothing here is persisted or sent anywhere.
+const auditPrerequisites = [
+ { id: "rust", label: "Rust toolchain installed via rustup" },
+ { id: "wasm-target", label: "wasm32v1-none compilation target added" },
+ { id: "testkit-cli", label: "Testkit CLI installed and on your PATH" },
+ { id: "builds-clean", label: "Contract builds without warnings before scanning" },
+];
+
function summarizeConfiguration(options: CommandOptions): SummaryRow[] {
const rows: SummaryRow[] = [{ label: "Workflow", value: options.command }];
if (options.path) rows.push({ label: "Path", value: options.path });
@@ -241,6 +250,7 @@ export default function App() {
const [configB, setConfigB] = useState(null);
const [coverageGuideOpen, setCoverageGuideOpen] = useState(false);
const [auditGuideOpen, setAuditGuideOpen] = useState(false);
+ const [checkedPrerequisites, setCheckedPrerequisites] = useState>({});
const comparePanelRef = useRef(null);
const [activeSection, setActiveSection] = useActiveSection(navSectionIds);
@@ -1245,6 +1255,23 @@ export default function App() {
{auditGuideOpen && (