Site Update#59
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the app/image-tools upload application to improve UX and reliability (auth state sharing, draft persistence, modular UI components) and updates server-side upload handling to accept a structured items manifest with clearer validation/errors. It also removes Solana references from documentation/config and updates TypeScript configuration/dependencies.
Changes:
- Refactors the upload page into reusable components, adds URL-prefill params, status banner messaging, and IndexedDB-backed draft persistence.
- Updates GitHub OAuth handling (explicit callback redirect URI) and centralizes auth token state via a hook.
- Reworks
/api/uploadto parse anitemsmanifest and validate EVM token uploads server-side with clearer 400s.
Reviewed changes
Copilot reviewed 21 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tokens/1151111081099710/So11111111111111111111111111111111111111112/logo.svg | Removes Solana token SVG content (as part of Solana support removal). |
| tokens/1151111081099710/J3umBWqhSjd13sag1E1aUojViWvPYA5dFNyqpKuX3WXj/logo.svg | Removes Solana token SVG content. |
| tokens/1151111081099710/DV3845GEAVXfwpyVGGgWbqBVCtzHdCXNCGfcdboSEuZz/logo.svg | Removes Solana token SVG content. |
| tokens/1151111081099710/bioJ9JTqW62MLz7UKHU69gtKhPpGi1BQhccj2kmSvUJ/logo.svg | Removes Solana token SVG content. |
| tokens/1151111081099710/93bvs9o8nq88zxnlwwuavfn5pxbhccnv5sfs6aflno8q/logo.svg | Removes Solana token SVG content. |
| tokens/1151111081099710/3DK98MXPz8TRuim7rfQnebSLpA7VSoc79Bgiee1m4Zw5/logo.svg | Removes Solana token SVG content. |
| tokens/1151111081099710/11111111111111111111111111111111/logo.svg | Removes Solana token SVG content. |
| README.md | Removes Solana chain ID mention; simplifies address casing guidance. |
| package.json | Adds @types/node dependency. |
| docs/upload-ingestion-feature-plan.md | Removes Solana-specific casing notes; updates future work bullets accordingly. |
| bun.lock | Updates lockfile for @types/node and adds undici-types. |
| app/image-tools/tsconfig.json | Adds Node types to TS config. |
| app/image-tools/src/routes/upload.tsx | Major refactor: stable item IDs, modular UI, status messaging, URL params, preview cleanup, draft persistence, structured upload manifest building. |
| app/image-tools/src/lib/uploadDraft.ts | Adds IndexedDB-backed draft persistence for upload form state. |
| app/image-tools/src/lib/imagePreview.ts | Adds shared preview/file helpers, PNG preview generation, and object URL cleanup utilities. |
| app/image-tools/src/lib/githubAuth.ts | Adds explicit callback URL builder and sets OAuth redirect_uri/prompt. |
| app/image-tools/src/hooks/useGithubAuth.ts | Adds shared auth-token hook for consistent token state across components. |
| app/image-tools/src/components/StatusBanner.tsx | Adds status banner component for inline info/success/error messages. |
| app/image-tools/src/components/SegmentedToggle.tsx | Improves accessibility semantics via radio roles/aria attributes. |
| app/image-tools/src/components/PrReviewDialog.tsx | Extracts PR review modal into a reusable component. |
| app/image-tools/src/components/PreviewGrid.tsx | Adds a dedicated preview grid component for SVG/PNG previews. |
| app/image-tools/src/components/Header.tsx | Switches to shared auth hook; passes token to GithubSignIn. |
| app/image-tools/src/components/GithubSignIn.tsx | Refactors sign-in UI/state and introduces explicit OAuth redirect behavior. |
| app/image-tools/src/components/AssetDropzone.tsx | Adds reusable dropzone component with keyboard support. |
| app/image-tools/README.md | Updates env var guidance and restructures docs formatting. |
| app/image-tools/api/upload.ts | Adds items-manifest parsing, server-side EVM validation, duplicate chain checks, and clearer 400 errors. |
| app/image-tools/api/auth/github/callback.ts | Adds redirect_uri to OAuth token exchange based on request origin. |
| app/image-tools/AGENTS.md | Removes Solana casing guidance. |
| AGENTS.md | Removes Solana casing guidance. |
Comments suppressed due to low confidence (2)
app/image-tools/src/components/GithubSignIn.tsx:12
- GitHub OAuth now sets an explicit redirect_uri, but this component doesn’t import or use the API base URL to build it. Without using the API origin (VITE_API_BASE_URL / vercel dev), OAuth can redirect back to the SPA origin (e.g., Vite :5173) where /api/auth/github/callback doesn’t exist, breaking sign-in.
import React, {Fragment, useEffect, useState} from 'react';
import {Dialog, Transition} from '@headlessui/react';
import {
broadcastAuthChange,
storeAuthState,
clearStoredAuth,
buildAuthorizeUrl,
markAuthPending,
clearAuthPending,
readAuthPending
} from '../lib/githubAuth';
package.json:12
@types/nodeis a TypeScript-only package and shouldn’t be in runtime dependencies. Keeping it in dependencies can bloat installs for consumers that only need runtime packages.
"dependencies": {
"@fleekxyz/sdk": "^0.7.3",
"@types/node": "^25.9.3",
"ethers": "^6.0.8",
"fs-extra": "^9.1.0",
"keccak": "^3.0.4"
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const signIn = () => { | ||
| const state = randomState(); | ||
| storeAuthState(state); | ||
| markAuthPending(); | ||
| setConnecting(true); | ||
| const clientId = import.meta.env.VITE_GITHUB_CLIENT_ID; | ||
| if (!clientId) { | ||
| alert('Missing VITE_GITHUB_CLIENT_ID'); | ||
| setConfigError('Missing GitHub client ID.'); | ||
| return; | ||
| } | ||
| setConfigError(''); | ||
| storeAuthState(state); | ||
| markAuthPending(); | ||
| setConnecting(true); | ||
| window.location.href = buildAuthorizeUrl(clientId, state); | ||
| }; |
| return new Promise((resolve, reject) => { | ||
| const request = indexedDB.open(DB_NAME, 1); | ||
|
|
||
| request.onupgradeneeded = () => { | ||
| const db = request.result; | ||
| if (!db.objectStoreNames.contains(STORE_NAME)) db.createObjectStore(STORE_NAME); | ||
| }; | ||
| request.onsuccess = () => resolve(request.result); | ||
| request.onerror = () => reject(request.error); | ||
| }); |
murderteeth
left a comment
There was a problem hiding this comment.
Dependency not pinned — @types/node is added as ^25.9.3 in the root package.json. The caret allows silent minor/patch upgrades, which violates our pinning requirement. Please change it to exact 25.9.3 and update bun.lock to match.
|
Updated to pin dep. |
Quality of Life update