From a8f9cc7682650a30e07a46754956392902e83035 Mon Sep 17 00:00:00 2001 From: Godsmiracle001 Date: Tue, 20 Oct 2026 14:34:05 +0100 Subject: [PATCH] all fixed --- README.md | 2 ++ docs/accessibility.md | 5 +++-- src/App.test.tsx | 23 ++++++++++++++++++++- src/App.tsx | 47 +++++++++++++++++++++++++++++++++++++++++++ src/styles.css | 32 ++++++++++++++++++++++++++++- 5 files changed, 105 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b9b99e..b81a78c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ The interface does not execute contracts in the browser. Generated commands run - **Tablet Two-Column Grid**: Compact two-column module layout for tablet widths (601px-900px) for better space utilization. - **Landscape Phone Optimization**: Condensed command form layout for landscape phone orientations (541px-900px width, max 600px height). - **Required vs. Optional Setting Distinction**: Visual badges (`Required` / `Optional`) and `aria-required` attributes in the CLI workbench distinguishing mandatory parameters from optional configuration flags. +- **Audit workflow support**: An expandable, keyboard-accessible preflight checklist, strict-mode control, and advanced multiline command editor help users prepare and reproduce source audits. +- **Limits command reference**: A standalone reference explains the ready-to-run limits command, its `--contract`, `--fn`, and `--ramp` arguments, defaults, and offline/read-only behavior. ## Development diff --git a/docs/accessibility.md b/docs/accessibility.md index 3f9891e..333dd19 100644 --- a/docs/accessibility.md +++ b/docs/accessibility.md @@ -48,5 +48,6 @@ browser and screen reader pair per platform. | 5 | Module numbers (`01`–`07`) were read as text before every module name. | Fixed: `aria-hidden`. | `src/App.tsx` | | 6 | The `footer` sits inside `main`, so it is not exposed as a `contentinfo` landmark. | Open. Moving it out of `main` changes the wide-screen layout, so it needs a visual check. | `src/App.tsx` | | 7 | Collapsed guide toggles set `aria-controls` to panels that are not rendered until opened. | Open. Minor; the attribute points at a missing id while collapsed. | `src/App.tsx` | -| 8 | Scrollable `pre` blocks are not keyboard-focusable in every browser, so long lines may be unreachable by keyboard on some browsers. | Open. | `src/styles.css` | -| 9 | The stored visual baselines in `tests/visual/__screenshots__` predate the current layout and do not match a fresh render. | Open. Baselines should be regenerated on the CI platform, not locally. | `tests/visual/` | +| 8 | The limits workflow needed a discoverable command reference. | Fixed: added a focusable reference section with semantic headings, lists, code examples, and a keyboard-accessible navigation link. | `src/App.tsx`, `src/styles.css` | +| 9 | Scrollable `pre` blocks are not keyboard-focusable in every browser, so long lines may be unreachable by keyboard on some browsers. | Open. | `src/styles.css` | +| 10 | The stored visual baselines in `tests/visual/__screenshots__` predate the current layout and do not match a fresh render. | Open. Baselines should be regenerated on the CI platform, not locally. | `tests/visual/` | diff --git a/src/App.test.tsx b/src/App.test.tsx index 167efde..090d5a8 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -230,6 +230,27 @@ describe("Soroban workflow documentation and prerequisites", () => { }); }); +describe("Limits command reference (#92)", () => { + it("documents the ready-to-run command, arguments, defaults, and offline behavior", () => { + render(); + + expect(screen.getByRole("heading", { name: /resource limits, at a glance/i })).toBeInTheDocument(); + expect(screen.getByLabelText("Resource limits command example")).toHaveTextContent("soroban-testkit limits"); + expect(screen.getByText("--contract")).toBeInTheDocument(); + expect(screen.getByText("--fn")).toBeInTheDocument(); + expect(screen.getByText("--ramp")).toBeInTheDocument(); + expect(screen.getByText(/runs offline/i)).toBeInTheDocument(); + }); + + it("exposes the reference as a focusable navigation target", () => { + render(); + + const link = screen.getByRole("link", { name: "Limits reference" }); + expect(link).toHaveAttribute("href", "#limits-reference"); + expect(document.getElementById("limits-reference")).toHaveAttribute("tabindex", "-1"); + }); +}); + describe("Audit workflow prerequisites checklist (#91)", () => { it("lets a user check off audit prerequisites, each with its own accessible name", () => { render(); @@ -479,7 +500,7 @@ describe("Screen reader semantics (#108)", () => { Object.defineProperty(navigator, "clipboard", { value: { writeText }, configurable: true }); render(); - fireEvent.click(screen.getByRole("button", { name: "Copy", exact: true })); + fireEvent.click(screen.getByRole("button", { name: /^Copy$/ })); const announcement = await screen.findByText("Command copied to clipboard"); expect(announcement).toHaveAttribute("aria-live", "polite"); diff --git a/src/App.tsx b/src/App.tsx index d8f3b2f..7078c70 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,15 +5,18 @@ import { modules, type CommandName, type OptionalArgKey, + localFileGuides, } from "./testkit"; import { copyToClipboard } from "./clipboard"; import { CORE_REPO_URL, INSTALL_GUIDE_URL, INTERFACE_REPO_URL } from "./links"; import { useActiveSection } from "./useActiveSection"; +import "./styles.css"; const navSections = [ { id: "install", label: "Install" }, { id: "modules", label: "Modules" }, { id: "commands", label: "Commands" }, + { id: "limits-reference", label: "Limits reference" }, ] as const; const navSectionIds = navSections.map((section) => section.id); @@ -255,6 +258,7 @@ export default function App() { const [activeSection, setActiveSection] = useActiveSection(navSectionIds); useEffect(() => { + document.documentElement.style.scrollPaddingTop = "78px"; const handleKeyDown = (event: globalThis.KeyboardEvent) => { if (!event.ctrlKey && !event.metaKey) return; @@ -271,6 +275,9 @@ export default function App() { case "4": document.getElementById("commands")?.scrollIntoView({ behavior: "smooth" }); break; + case "5": + document.getElementById("limits-reference")?.scrollIntoView({ behavior: "smooth" }); + break; } }; document.addEventListener("keydown", handleKeyDown); @@ -1288,6 +1295,46 @@ export default function App() { )} + +
+
+

Command reference

+

Resource limits, at a glance.

+

+ Use soroban-testkit limits to ramp one contract input until the local WASM + execution reaches its practical resource ceiling. The command is read-only and runs offline. +

+
+
+
+

Ready-to-run command

+
{"soroban-testkit limits \\\n  --contract target/wasm32v1-none/release/contract.wasm \\\n  --fn batch_payout \\\n  --ramp recipients"}
+

Replace the function and ramp names with exported contract inputs from your ABI.

+
+
+

Arguments

+
+
--contract
Compiled WASM artifact. Defaults to {localFileGuides.limits.defaultPath}.
+
--fn
Exported function to probe. Defaults to batch_payout.
+
--ramp
Input parameter to increase. Defaults to recipients.
+
+
+
+

Before you run it

+
    +
  1. Build the contract for wasm32v1-none in release mode.
  2. +
  3. Confirm the function is exported and the ramp input is accepted.
  4. +
  5. Read the instruction and memory ceilings printed to stdout.
  6. +
+

Reads: local WASM and export metadata. Writes: none.

+
+
+