Skip to content

Build Accessibility Auditing for Smart Contract Playground#845

Open
midenotch wants to merge 2 commits into
StellarDevHub:mainfrom
midenotch:build-accessibility
Open

Build Accessibility Auditing for Smart Contract Playground#845
midenotch wants to merge 2 commits into
StellarDevHub:mainfrom
midenotch:build-accessibility

Conversation

@midenotch

Copy link
Copy Markdown
Contributor

Close: #817

What was built
Core engine — SorobanAccessibilityAuditor.ts
A pure TypeScript auditor that statically analyzes Soroban smart contract source code for 8 accessibility rules covering the contract's interface accessibility (how usable/readable the contract is for developers and tooling):

Rule Severity Detects
missing-contract-attribute error Soroban struct missing #[contract]
missing-fn-doc warning Public #[contractimpl] functions with no /// doc comment
opaque-error-code warning Single-char or E1/Err1-style error variant names
undocumented-error-enum info #[contracterror] enum with no doc comment
event-missing-topics info env.events().publish() with fewer than 2 topics
raw-bytes-storage-key info Bytes::/BytesN:: used as storage keys instead of Symbol
panic-only-error-handling error/warning panic!() (error) or .unwrap() (warning) in contract code
unnamed-fn-params info Public functions with _ as a parameter name
Exports: auditSorobanSource(), filterIssuesBySeverity(), formatAuditSummary() + all TypeScript types.

Hook — useAccessibilityAudit.ts
A debounced React hook that watches editor content and re-runs the audit 500ms after the last change. Exposes result, isPending, runAudit(), and getIssuesBySeverity().

UI Panel — AccessibilityAuditPanel.tsx
A fully accessible panel component rendered in the playground's right column (below the terminal) with:

Live issue count with severity badges
Filter tabs (All / Errors / Warnings / Info) with role="tablist"
Collapsible issue rows with aria-expanded, aria-controls, suggestions
Error issues auto-expanded; others collapsed by default
Refresh button, spinner state, "All checks passed" view
Full ARIA:

, role="log", role="status", aria-live
Wired into playground — page.tsx + CodeEditor.tsx
CodeEditor now accepts an onCodeChange callback to surface live editor content
Playground page tracks the code, passes it to useAccessibilityAudit, and renders between the terminal and the lab notes
Tests — 92 passing
SorobanAccessibilityAuditor.test.ts — 47 unit tests covering every rule (positive + negative cases), counts, sort order, helpers
useAccessibilityAudit.test.ts — 13 hook tests covering debounce, enable/disable, manual trigger, timer precision
AccessibilityAuditPanel.test.tsx — 32 component tests covering rendering states, ARIA attributes, filter tabs, expand/collapse, refresh button

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@midenotch is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@midenotch

Copy link
Copy Markdown
Contributor Author

Done, Close: #845

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@midenotch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Smart Contract] Build Accessibility Auditing for Smart Contract Playground

1 participant