fix: guard WorkflowBlock/Calendar tools with feature flags, disable WalletConnect QR modal

- Add ENABLE_WORKFLOW and ENABLE_CALENDAR flags to overrides.tsx
- Conditionally include tool menu entries only in dev mode
- Disable WalletConnect QR modal to fix web3modal initialization errors
- Users can still connect via injected wallets (MetaMask, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-01-02 21:53:08 +01:00
parent 5db25f3ac1
commit 28ab62f645
2 changed files with 33 additions and 16 deletions

View File

@ -38,7 +38,9 @@ if (hasValidWalletConnectId) {
connectors.push(
walletConnect({
projectId: WALLETCONNECT_PROJECT_ID,
showQrModal: true,
// Disable QR modal - web3modal has issues with project ID propagation
// Users can still connect via injected wallets (MetaMask, etc.)
showQrModal: false,
metadata: {
name: 'Canvas',
description: 'Collaborative Canvas with Web3 Integration',
@ -47,6 +49,10 @@ if (hasValidWalletConnectId) {
},
})
);
if (import.meta.env.DEV) {
console.log('[Web3Provider] WalletConnect enabled with project ID:', WALLETCONNECT_PROJECT_ID.slice(0, 8) + '...');
}
} else if (import.meta.env.DEV) {
console.warn(
'[Web3Provider] WalletConnect disabled - no valid VITE_WALLETCONNECT_PROJECT_ID set.\n' +

View File

@ -30,6 +30,11 @@ import { ISlideShape } from "@/shapes/SlideShapeUtil"
import { getEdge } from "@/propagators/tlgraph"
import { llm, getApiKey } from "@/utils/llmUtils"
// Feature flags - must match Board.tsx to prevent tool registration mismatch
const IS_PRODUCTION = import.meta.env.PROD
const ENABLE_WORKFLOW = !IS_PRODUCTION // Workflow blocks - dev only
const ENABLE_CALENDAR = !IS_PRODUCTION // Calendar - dev only
export const overrides: TLUiOverrides = {
tools(editor, tools) {
return {
@ -246,6 +251,8 @@ export const overrides: TLUiOverrides = {
readonlyOk: true,
onSelect: () => editor.setCurrentTool("map"),
},
// Calendar - only available in dev (must match ENABLE_CALENDAR flag in Board.tsx)
...(ENABLE_CALENDAR ? {
calendar: {
id: "calendar",
icon: "calendar",
@ -254,6 +261,9 @@ export const overrides: TLUiOverrides = {
readonlyOk: true,
onSelect: () => editor.setCurrentTool("calendar"),
},
} : {}),
// WorkflowBlock - only available in dev (must match ENABLE_WORKFLOW flag in Board.tsx)
...(ENABLE_WORKFLOW ? {
WorkflowBlock: {
id: "WorkflowBlock",
icon: "sticker",
@ -261,6 +271,7 @@ export const overrides: TLUiOverrides = {
readonlyOk: true,
onSelect: () => editor.setCurrentTool("WorkflowBlock"),
},
} : {}),
// MycelialIntelligence removed - now a permanent UI bar (MycelialIntelligenceBar.tsx)
hand: {
...tools.hand,