feat: ZK prover strategy, MapboxWrapper, a11y button labels, npm workspaces (#85–#88) - #397
Merged
Mikey-222 merged 1 commit intoAug 27, 2026
Conversation
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.
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #85, Closes #86, Closes #87, Closes #88.
#86 — Dynamic ZK prover selection (strategy)
src/lib/provers.js:ProofGeneratorbase class +ServerProver/BrowserProverconcrete strategies, andselectProvers()which builds the ordered prover list for the current runtime.generateLocationProof()insrc/lib/zk.jsnow dispatches through the strategy instead of an inlineif (proverUrl) { … } else { … }branch. The module-level single-flight lock is factored out into_browserProofSingleFlight()and handed toBrowserProveras its runner.ZK prover server is unreachable, theVITE_ZK_PROVER_URLhint,Connect a valid Stellar wallet before generating the proof.) and the public export surface are all unchanged —test/zk-encoding.test.jsandtest/a11y-components.test.jsxcontinue to pin them.#87 — MapboxWrapper component
src/components/MapboxWrapper.jsxencapsulates react-map-gl initialisation: access token, default view state, container style, and the standardNavigationControl. Overlays (markers, sources, layers, popups, controllers) are passed aschildrenand rendered inside<Map>unchanged. The ref is forwarded to the underlying<Map>for callers that need the imperative handle.Help.jsxnow renders<MapboxWrapper mapStyle=… onMapClick=…>in place of the bare<Map>+ inline<NavigationControl>; the now-unusedMap/NavigationControlimports were dropped and the stale "shadows the globalMap" comment updated.#88 — Accessible names for icon-only buttons
src/pages/Help.jsx: addedaria-label(andtype="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 (alsoaria-expanded).src/App.jsxaudited — its single icon button already has a state-awarearia-label; no change needed.#85 — npm workspaces for the prover
package.json:"workspaces": ["server"]; addedstart:all/build:allnext to the existingdev/dev:all(which already start Vite + prover concurrently viascripts/dev.mjs).server/package.json: addedversionand a no-opbuildscript sonpm run build --workspacessucceeds.package-lock.json: added the workspace link entry (node_modules/helphone-prover→server) and thepackages["server"]node. All prover dependencies already resolve at the root at the same versions, so no dependency tree changes.Notes / risks
npm ciis strict, so please regeneratepackage-lock.jsonwithnpm installif the hand-applied workspace entries don't satisfy it exactly.Help.jsx; the map render path is exercised bytest/mapbox-events.test.jsx, which mocksreact-map-gl/mapbox— the wrapper passesonMapClickstraight through as the mock'sonClick, so that test's expectations still hold.