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:
parent
5db25f3ac1
commit
28ab62f645
|
|
@ -38,7 +38,9 @@ if (hasValidWalletConnectId) {
|
||||||
connectors.push(
|
connectors.push(
|
||||||
walletConnect({
|
walletConnect({
|
||||||
projectId: WALLETCONNECT_PROJECT_ID,
|
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: {
|
metadata: {
|
||||||
name: 'Canvas',
|
name: 'Canvas',
|
||||||
description: 'Collaborative Canvas with Web3 Integration',
|
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) {
|
} else if (import.meta.env.DEV) {
|
||||||
console.warn(
|
console.warn(
|
||||||
'[Web3Provider] WalletConnect disabled - no valid VITE_WALLETCONNECT_PROJECT_ID set.\n' +
|
'[Web3Provider] WalletConnect disabled - no valid VITE_WALLETCONNECT_PROJECT_ID set.\n' +
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,11 @@ import { ISlideShape } from "@/shapes/SlideShapeUtil"
|
||||||
import { getEdge } from "@/propagators/tlgraph"
|
import { getEdge } from "@/propagators/tlgraph"
|
||||||
import { llm, getApiKey } from "@/utils/llmUtils"
|
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 = {
|
export const overrides: TLUiOverrides = {
|
||||||
tools(editor, tools) {
|
tools(editor, tools) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -246,6 +251,8 @@ export const overrides: TLUiOverrides = {
|
||||||
readonlyOk: true,
|
readonlyOk: true,
|
||||||
onSelect: () => editor.setCurrentTool("map"),
|
onSelect: () => editor.setCurrentTool("map"),
|
||||||
},
|
},
|
||||||
|
// Calendar - only available in dev (must match ENABLE_CALENDAR flag in Board.tsx)
|
||||||
|
...(ENABLE_CALENDAR ? {
|
||||||
calendar: {
|
calendar: {
|
||||||
id: "calendar",
|
id: "calendar",
|
||||||
icon: "calendar",
|
icon: "calendar",
|
||||||
|
|
@ -254,6 +261,9 @@ export const overrides: TLUiOverrides = {
|
||||||
readonlyOk: true,
|
readonlyOk: true,
|
||||||
onSelect: () => editor.setCurrentTool("calendar"),
|
onSelect: () => editor.setCurrentTool("calendar"),
|
||||||
},
|
},
|
||||||
|
} : {}),
|
||||||
|
// WorkflowBlock - only available in dev (must match ENABLE_WORKFLOW flag in Board.tsx)
|
||||||
|
...(ENABLE_WORKFLOW ? {
|
||||||
WorkflowBlock: {
|
WorkflowBlock: {
|
||||||
id: "WorkflowBlock",
|
id: "WorkflowBlock",
|
||||||
icon: "sticker",
|
icon: "sticker",
|
||||||
|
|
@ -261,6 +271,7 @@ export const overrides: TLUiOverrides = {
|
||||||
readonlyOk: true,
|
readonlyOk: true,
|
||||||
onSelect: () => editor.setCurrentTool("WorkflowBlock"),
|
onSelect: () => editor.setCurrentTool("WorkflowBlock"),
|
||||||
},
|
},
|
||||||
|
} : {}),
|
||||||
// MycelialIntelligence removed - now a permanent UI bar (MycelialIntelligenceBar.tsx)
|
// MycelialIntelligence removed - now a permanent UI bar (MycelialIntelligenceBar.tsx)
|
||||||
hand: {
|
hand: {
|
||||||
...tools.hand,
|
...tools.hand,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue