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(
|
||||
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' +
|
||||
|
|
|
|||
|
|
@ -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,21 +251,27 @@ export const overrides: TLUiOverrides = {
|
|||
readonlyOk: true,
|
||||
onSelect: () => editor.setCurrentTool("map"),
|
||||
},
|
||||
calendar: {
|
||||
id: "calendar",
|
||||
icon: "calendar",
|
||||
label: "Calendar",
|
||||
kbd: "ctrl+alt+k",
|
||||
readonlyOk: true,
|
||||
onSelect: () => editor.setCurrentTool("calendar"),
|
||||
},
|
||||
WorkflowBlock: {
|
||||
id: "WorkflowBlock",
|
||||
icon: "sticker",
|
||||
label: "Workflow Block",
|
||||
readonlyOk: true,
|
||||
onSelect: () => editor.setCurrentTool("WorkflowBlock"),
|
||||
},
|
||||
// Calendar - only available in dev (must match ENABLE_CALENDAR flag in Board.tsx)
|
||||
...(ENABLE_CALENDAR ? {
|
||||
calendar: {
|
||||
id: "calendar",
|
||||
icon: "calendar",
|
||||
label: "Calendar",
|
||||
kbd: "ctrl+alt+k",
|
||||
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",
|
||||
label: "Workflow Block",
|
||||
readonlyOk: true,
|
||||
onSelect: () => editor.setCurrentTool("WorkflowBlock"),
|
||||
},
|
||||
} : {}),
|
||||
// MycelialIntelligence removed - now a permanent UI bar (MycelialIntelligenceBar.tsx)
|
||||
hand: {
|
||||
...tools.hand,
|
||||
|
|
|
|||
Loading…
Reference in New Issue