Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

WHAT

  • migrated the naga explorer SPA into apps/explorer, mapping the existing scripts onto Nx run-commands targets
  • add Docker/Nginx assets plus an Nx docker-build targe

Copilot AI review requested due to automatic review settings November 18, 2025 19:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the naga explorer Single Page Application into the monorepo under apps/explorer, consolidating build tooling and Docker deployment configuration while preserving all existing functionality.

Key Changes:

  • Integrated standalone naga-explorer repository into monorepo structure
  • Configured Vite build system with TypeScript and React
  • Added Docker/Nginx deployment infrastructure
  • Implemented comprehensive component refactoring for maintainability

Reviewed Changes

Copilot reviewed 85 out of 161 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Added apps workspace to monorepo configuration
docs/sdk/getting-started/lit-client.mdx Updated network import references and added tree-shaking documentation
apps/explorer/vite.config.ts Configured Vite with custom version page generation plugin
apps/explorer/vercel.json Added Vercel deployment configuration with SPA routing
apps/explorer/tsconfig.json TypeScript configuration for React SPA with path mappings
apps/explorer/src/styles/global.css Global styles and theme variables for the explorer
apps/explorer/src/router.tsx React Router configuration for SPA navigation
apps/explorer/src/main.tsx Application entry point with Wagmi and RainbowKit setup
apps/explorer/src/lit-login-modal/types.ts Type definitions for authentication and network management
apps/explorer/src/lit-login-modal/context/LitAuthContext.tsx React context for Lit authentication state
apps/explorer/src/lit-login-modal/components/*.tsx Authentication UI components (ledger funding, settings panel)
apps/explorer/src/lit-login-modal/PKPSelectionSection.tsx PKP wallet selection with pagination and balance display
apps/explorer/src/lit-login-modal/LitAuthProvider.tsx Main authentication provider with multi-method support
apps/explorer/src/lit-logged-page/protectedApp/utils/*.ts Utility functions for formatting, ledger refresh, and chain management
apps/explorer/src/lit-logged-page/protectedApp/types.ts Type definitions for PKP operations and permissions
apps/explorer/src/lit-logged-page/protectedApp/hooks/*.ts Custom hooks for payment manager, ledger balance, and withdrawal status
apps/explorer/src/lit-logged-page/protectedApp/contexts/*.tsx Context providers for PKP permissions management
apps/explorer/src/lit-logged-page/protectedApp/components/ui/*.tsx Reusable UI components (spinner, buttons, toasts)
apps/explorer/src/lit-logged-page/protectedApp/components/wallet/*.tsx Wallet operation components (transactions, signing, payments)
apps/explorer/src/lit-logged-page/protectedApp/components/pkp/*.tsx PKP information display components
apps/explorer/src/lit-logged-page/protectedApp/components/permissions/*.tsx Permission management UI components
apps/explorer/src/lit-logged-page/protectedApp/components/layout/*.ts Layout and navigation component exports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +16
const EVENT_NAME = "ledger-refresh";
const SNAPSHOT_EVENT_NAME = "ledger-snapshot";

// Queue to handle sequential refresh requests
class RefreshQueue {
private queue: Array<{ address?: string | null; snapshotBalance?: string | null; resolve: () => void }> = [];
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Complex inline type definition reduces readability. Consider extracting this to a named interface like QueueItem to improve code clarity and enable reuse.

Suggested change
const EVENT_NAME = "ledger-refresh";
const SNAPSHOT_EVENT_NAME = "ledger-snapshot";
// Queue to handle sequential refresh requests
class RefreshQueue {
private queue: Array<{ address?: string | null; snapshotBalance?: string | null; resolve: () => void }> = [];
// Represents an item in the refresh queue
interface QueueItem {
address?: string | null;
snapshotBalance?: string | null;
resolve: () => void;
}
const EVENT_NAME = "ledger-refresh";
const SNAPSHOT_EVENT_NAME = "ledger-snapshot";
// Queue to handle sequential refresh requests
class RefreshQueue {
private queue: QueueItem[] = [];

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
const account = privateKeyToAccount(
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded private key exposed in source code. This appears to be a well-known test key (Hardhat's default), but should be documented as such or sourced from configuration to avoid confusion and potential security risks.

Suggested change
const account = privateKeyToAccount(
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
// NOTE: This uses Hardhat's default test private key for local development only.
// Never use this key in production. To override, set REACT_APP_TEST_PRIVATE_KEY in your environment.
const account = privateKeyToAccount(
process.env.REACT_APP_TEST_PRIVATE_KEY ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

Copilot uses AI. Check for mistakes.
@Ansonhkg Ansonhkg merged commit 4a1adf2 into naga Nov 21, 2025
12 of 13 checks passed
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.

2 participants