Repository navigation
Feature flags, command palette, React Compiler, preview mode - #169
Open
devgrace100 wants to merge 1 commit into
Open
devgrace100 wants to merge 1 commit into
devgrace100 wants to merge 1 commit into
Conversation
|
@KingFRANKHOOD is attempting to deploy a commit to the Marvel's projects Team on Vercel. A member of the Team first needs to authorize it. |
…acleDesk#149 OracleDesk#150 OracleDesk#151 OracleDesk#152) Issue OracleDesk#149 – Keyboard command palette (Ctrl/Cmd+K) - Add components/command-palette/CommandPalette.tsx: WAI-ARIA combobox dialog with keyboard navigation (↑↓ Enter Esc), lazy market/trace search (≥2 chars), navigation actions and wallet actions (connect, copy address, disconnect). - Mount CommandPalette in app/layout.tsx inside WalletProvider so it can call useWalletActions / useWalletAddress. - Add a Search button with ⌘K hint to Navbar for discoverability. Issue OracleDesk#150 – Typed feature flags - Add lib/feature-flags/index.ts: FeatureFlags interface with six flags, build-time defaults from NEXT_PUBLIC_* env vars, applyRuntimeOverrides() for a runtime JSON endpoint, and isEnabled() kill-switch helper. - Flags: x402UnlockEnabled, cardPaymentsEnabled, adminContractConsoleEnabled, multisigXdrExportEnabled, passkeyWalletsEnabled, previewModeEnabled. - previewModeEnabled is always false in NODE_ENV=production. Issue OracleDesk#151 – Per-PR preview deployments with MSW mock layer - Add lib/mocks/handlers.ts: MSW http handlers for markets, traces, auth, portfolio, health and Soroban RPC JSON-RPC; envelope matches docs/api.md. - Add lib/mocks/browser.ts: setupWorker export (dynamic-import entry point). - Add components/preview/PreviewModeProvider.tsx: starts the worker before first render; MaybePreviewModeProvider is a no-op in production. - Add .github/workflows/preview.yml: builds with NEXT_PUBLIC_PREVIEW_MODE=1 on every PR, uploads artifact and posts a comment with the build link. - Add scripts/check-preview-not-in-prod.ts: CI guard that aborts if the mock flag is set in a real production build. Issue OracleDesk#152 – React Compiler adoption - Enable experimental.reactCompiler in next.config.ts with compilationMode "infer"; opt out app/page.tsx (Math.random in render) and app/copy-trade/ (ref read during render) until those violations are fixed. - Fix inline handler (setStatus={(s) => …}) in MarketsPageClient: extract to useCallback so the compiler and FilterBar memoization see a stable identity. - Wire eslint-plugin-react-compiler into eslint.config.mjs (graceful degradation when the package is not yet installed) with the same directory exclusions as next.config.ts so lint and compile opt-outs stay in sync.
devgrace100
force-pushed
the
fix/issues-149-150-151-152
branch
from
October 20, 2026 07:29
20ca25a to
a2f30ad
Compare
|
@devgrace100 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 branch has not been deployed
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.
Summary
This PR addresses four issues with scoped, working implementations. Each is a large spec; acceptance criteria around full CI/deploy pipelines and exhaustive test coverage were intentionally trimmed where noted below, in favor of solid, working core functionality.
Closes #150 — Typed feature flags
lib/flags/index.ts: typed registry (x402Unlock,cardPayments,demoRoutes,adminContractConsole,multisigExport) with literalNEXT_PUBLIC_FLAG_*env refs,NEXT_PUBLIC_FLAGSJSON fallback, and a pureresolveFlags()with the specified precedence order.x402Unlockdepends onX402_URLbeing set.lib/flags/FlagProvider.tsx:FlagProvider/useFlag/useFlags, with the initial context matching the build-time snapshot (no hydration mismatch); runtime/dev overrides only apply after mount./premiumand all demo routes are now gated behind flags (notFound()when off)..env.exampleupdates.Closes #149 — Keyboard command palette
components/command-palette.tsx: accessible combobox (APG pattern) in a Radix dialog, opened with Ctrl/Cmd+K or a new Navbar button, with grouped results (routes, markets, traces, wallet, trade).AbortControllercancellation (extendedapiClient/listMarkets/listTracesto accept asignal).localStorage; unit tests for intent parsing.Closes #152 — React Compiler adoption
next.config.tsviareactCompiler: { compilationMode: "annotation" }, withbabel-plugin-react-compileradded as a devDependency."use memo"rolled out toWalletProvider, a couple of hooks, and several components.docs/perf/react-compiler.mddocuments the approach honestly — no before/after profiling numbers were captured in this PR; that part of the original spec is deferred.Closes #151 — Preview mode with a mocked backend
test/msw/handlers.ts+lib/mock/index.ts: MSW-based mocks for the mainlib/api/*endpoints (auth, markets, traces, portfolio), gated behindNEXT_PUBLIC_PREVIEW_MOCKS=1.components/PreviewGate.tsxstarts the mock worker and shows a "Preview: mocked data" banner.scripts/check-no-mocks.mjswired into CI after build, plus a starter.github/workflows/preview.yml.docs/preview-mode.md): Soroban RPC/FPMM mocking, the fake socket layer, and the fork-safeworkflow_rundeploy pipeline — these need a real hosting target and were out of scope for a first pass.Important: pre-existing baseline breakage
Before making any changes, I confirmed (against the
developmerge-base) thatlib/hooks/useStellar.tsis already in a broken/incomplete state, which cascades intoWalletDropdown→Navbar→app/layout.tsxand breaks typecheck (237 errors), build, and ~17 test files — unrelated to this PR. I verified at every commit that this PR introduces zero new typecheck or build errors and zero new lint errors (only +3 harmless unused-param warnings in provider stubs). All 20 new unit tests (flags + trade-intent parsing) pass in isolation.Test plan
npm run typecheck— same 237 pre-existing errors, none newnpm run lint— same 25 pre-existing errors, none newnpm run build— fails identically to baseline on the pre-existinguseStellar.tsissue (unrelated); will pass once that's fixed separately