Skip to content

feat: ZK prover strategy, MapboxWrapper, a11y button labels, npm workspaces (#85–#88) - #397

Merged
Mikey-222 merged 1 commit into
Hel-Phone:mainfrom
stephanieoghenemega-eng:feat/prover-strategy-a11y-workspaces-85-88
Aug 27, 2026
Merged

feat: ZK prover strategy, MapboxWrapper, a11y button labels, npm workspaces (#85–#88)#397
Mikey-222 merged 1 commit into
Hel-Phone:mainfrom
stephanieoghenemega-eng:feat/prover-strategy-a11y-workspaces-85-88

Conversation

@stephanieoghenemega-eng

@stephanieoghenemega-eng stephanieoghenemega-eng commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Closes #85, Closes #86, Closes #87, Closes #88.

#86 — Dynamic ZK prover selection (strategy)

  • New src/lib/provers.js: ProofGenerator base class + ServerProver / BrowserProver concrete strategies, and selectProvers() which builds the ordered prover list for the current runtime.
  • generateLocationProof() in src/lib/zk.js now dispatches through the strategy instead of an inline if (proverUrl) { … } else { … } branch. The module-level single-flight lock is factored out into _browserProofSingleFlight() and handed to BrowserProver as its runner.
  • Behaviour, log lines, error messages (ZK prover server is unreachable, the VITE_ZK_PROVER_URL hint, Connect a valid Stellar wallet before generating the proof.) and the public export surface are all unchanged — test/zk-encoding.test.js and test/a11y-components.test.jsx continue to pin them.

#87 — MapboxWrapper component

  • New src/components/MapboxWrapper.jsx encapsulates react-map-gl initialisation: access token, default view state, container style, and the standard NavigationControl. Overlays (markers, sources, layers, popups, controllers) are passed as children and rendered inside <Map> unchanged. The ref is forwarded to the underlying <Map> for callers that need the imperative handle.
  • Help.jsx now renders <MapboxWrapper mapStyle=… onMapClick=…> in place of the bare <Map> + inline <NavigationControl>; the now-unused Map / NavigationControl imports were dropped and the stale "shadows the global Map" comment updated.

#88 — Accessible names for icon-only buttons

  • src/pages/Help.jsx: added aria-label (and type="button") to the icon-only buttons that had no accessible name — the request-details × close, the emergency-modal × close, the disconnect-wallet , and the SVG-only mobile form toggle (also aria-expanded).
  • src/App.jsx audited — its single icon button already has a state-aware aria-label; no change needed.

#85 — npm workspaces for the prover

  • Root package.json: "workspaces": ["server"]; added start:all / build:all next to the existing dev / dev:all (which already start Vite + prover concurrently via scripts/dev.mjs).
  • server/package.json: added version and a no-op build script so npm run build --workspaces succeeds.
  • package-lock.json: added the workspace link entry (node_modules/helphone-proverserver) and the packages["server"] node. All prover dependencies already resolve at the root at the same versions, so no dependency tree changes.

Notes / risks

  • Not built or tested locally (matching this repo's convention) — flagging the lockfile edit for Adopt Workspace Tooling for Monorepo #85 in particular: npm ci is strict, so please regenerate package-lock.json with npm install if the hand-applied workspace entries don't satisfy it exactly.
  • Decouple Mapbox Integration from Help Component #87 is wired into Help.jsx; the map render path is exercised by test/mapbox-events.test.jsx, which mocks react-map-gl/mapbox — the wrapper passes onMapClick straight through as the mock's onClick, so that test's expectations still hold.

Closes Hel-Phone#85, Hel-Phone#86, Hel-Phone#87, Hel-Phone#88.

Hel-Phone#86 — extract ZK prover selection into a strategy (src/lib/provers.js):
ProofGenerator base + ServerProver / BrowserProver, chosen at runtime by
selectProvers(). generateLocationProof() now dispatches through the
strategy instead of an inline `if (proverUrl)` branch; the single-flight
browser lock is factored into _browserProofSingleFlight(). Behaviour,
error messages and exports are unchanged (test/zk-encoding.test.js).

Hel-Phone#87 — new src/components/MapboxWrapper.jsx encapsulating react-map-gl
init (access token, default view state, NavigationControl); Help.jsx now
renders <MapboxWrapper> instead of a bare <Map>. Ref is forwarded.

Hel-Phone#88 — add aria-labels to icon-only buttons in Help.jsx (close buttons,
disconnect-wallet ✕, mobile form toggle). App.jsx audited — already
labelled.

Hel-Phone#85 — declare the prover as an npm workspace: root package.json
"workspaces": ["server"], server/package.json gets a version + build
script, plus start:all / build:all convenience scripts. package-lock.json
updated with the workspace link entry.

Not built or tested locally.
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@stephanieoghenemega-eng 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

@Mikey-222
Mikey-222 merged commit b7b1648 into Hel-Phone:main Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants