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( 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' +

View File

@ -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,21 +251,27 @@ export const overrides: TLUiOverrides = {
readonlyOk: true, readonlyOk: true,
onSelect: () => editor.setCurrentTool("map"), onSelect: () => editor.setCurrentTool("map"),
}, },
calendar: { // Calendar - only available in dev (must match ENABLE_CALENDAR flag in Board.tsx)
id: "calendar", ...(ENABLE_CALENDAR ? {
icon: "calendar", calendar: {
label: "Calendar", id: "calendar",
kbd: "ctrl+alt+k", icon: "calendar",
readonlyOk: true, label: "Calendar",
onSelect: () => editor.setCurrentTool("calendar"), kbd: "ctrl+alt+k",
}, readonlyOk: true,
WorkflowBlock: { onSelect: () => editor.setCurrentTool("calendar"),
id: "WorkflowBlock", },
icon: "sticker", } : {}),
label: "Workflow Block", // WorkflowBlock - only available in dev (must match ENABLE_WORKFLOW flag in Board.tsx)
readonlyOk: true, ...(ENABLE_WORKFLOW ? {
onSelect: () => editor.setCurrentTool("WorkflowBlock"), WorkflowBlock: {
}, id: "WorkflowBlock",
icon: "sticker",
label: "Workflow Block",
readonlyOk: true,
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,