Skip to content

Commit 0f293e2

Browse files
gHashTagclaude
andcommitted
fix: resolve TrinityCanvas.tsx TypeScript errors blocking CI/CD deploy
Fix unused imports (FileEntry), SpeechRecognition type declarations, unused variables, and SpeechRecognitionEvent typing to unblock the deploy-docs workflow that builds website + docsite combined. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3b537c2 commit 0f293e2

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

website/src/pages/TrinityCanvas.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@
2525
* φ² + 1/φ² = 3 = TRINITY | KOSCHEI IS IMMORTAL
2626
*/
2727

28+
// Web Speech API type declarations
29+
declare global {
30+
interface Window {
31+
SpeechRecognition: typeof SpeechRecognition;
32+
webkitSpeechRecognition: typeof SpeechRecognition;
33+
}
34+
}
35+
2836
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
2937
import { AnimatePresence, motion } from 'framer-motion';
3038
import QuantumCanvas from '../components/QuantumCanvas';
3139
import type { VizMode } from '../components/QuantumCanvas';
3240
import ChatMessage from '../components/chat/ChatMessage';
33-
import { sendMessage, clearContext, checkHealth, fetchMirrorStatus, fetchStorageMetrics, fetchFileList, compileCode, type ChatResponse, type MirrorStatus, type MirrorLogEntry, type FileEntry, type StorageMetrics } from '../services/chatApi';
41+
import { sendMessage, clearContext, checkHealth, fetchMirrorStatus, fetchStorageMetrics, fetchFileList, compileCode, type ChatResponse, type MirrorStatus, type MirrorLogEntry, type StorageMetrics } from '../services/chatApi';
3442
import TrinityCanvasWasm from '../components/TrinityCanvasWasm';
3543

3644
// ─── Types ───────────────────────────────────────────────────────────────────
@@ -469,7 +477,7 @@ export default function TrinityCanvas() {
469477

470478
// Mirror RAZUM: inline chat with history (v2.6)
471479
const [mChatInput, setMChatInput] = useState('');
472-
const [mChatReply, setMChatReply] = useState<{ text: string; source: string; conf: number; lat: number } | null>(null);
480+
const [, setMChatReply] = useState<{ text: string; source: string; conf: number; lat: number } | null>(null);
473481
const [mChatSending, setMChatSending] = useState(false);
474482
const [mChatHistory, setMChatHistory] = useState<{ role: 'user' | 'assistant'; text: string; source?: string; conf?: number; lat?: number; reflection?: string }[]>([]);
475483

@@ -850,7 +858,7 @@ export default function TrinityCanvas() {
850858
if (SpeechRecognition) {
851859
const recognition = new SpeechRecognition();
852860
recognition.continuous = true; recognition.interimResults = true; recognition.lang = 'ru-RU';
853-
recognition.onresult = (event: SpeechRecognitionEvent) => {
861+
recognition.onresult = (event: Event & { resultIndex: number; results: SpeechRecognitionResultList }) => {
854862
let transcript = '';
855863
for (let i = event.resultIndex; i < event.results.length; i++) transcript += event.results[i][0].transcript;
856864
setVoiceTranscript(transcript);
@@ -1010,7 +1018,7 @@ export default function TrinityCanvas() {
10101018
if (!SR) { setMVoiceText('Speech API not supported'); return; }
10111019
const rec = new SR();
10121020
rec.continuous = false; rec.interimResults = false; rec.lang = 'en-US';
1013-
rec.onresult = (ev: SpeechRecognitionEvent) => {
1021+
rec.onresult = (ev: Event & { results: SpeechRecognitionResultList }) => {
10141022
const text = ev.results[0][0].transcript;
10151023
setMVoiceText(text);
10161024
// Auto-send voice transcript as chat
@@ -1217,8 +1225,8 @@ export default function TrinityCanvas() {
12171225
>
12181226
{PETALS.map((petal, i) => {
12191227
const pts = blockToPoints(i, logoScale, cx, cy);
1220-
const [lx, ly] = blockCenter(i, logoScale, cx, cy);
1221-
const realmColor = REALM_COLORS[petal.realm].primary;
1228+
blockCenter(i, logoScale, cx, cy);
1229+
REALM_COLORS[petal.realm].primary;
12221230
const isHovered = hoveredBlock === i;
12231231
// Fly-in: each block flies from its own direction
12241232
const verts = BLOCK_VERTS[i];

0 commit comments

Comments
 (0)