Skip to content

Commit 039e522

Browse files
echobtfactorydroid
andauthored
fix(gui): resolve TypeScript errors in context modules (#304)
- NotebookContext.tsx: Fix TS2345 by correcting type cast in parseNotebookFile - ActivityIndicatorContext.tsx: Remove unused taskId variables (TS6133) - AutoUpdateContext.tsx: Remove unused checkFirstLaunchAfterUpdate function (TS6133) - ChannelsContext.tsx: Remove unused SetStoreFunction import (TS6133) - ChatEditingContext.tsx: Remove unused produce import (TS6133) - ContextServerContext.tsx: Remove unused createEffect import (TS6133) Part of AGENT8 orchestrated GUI analysis. Co-authored-by: Droid Agent <droid@factory.ai>
1 parent 287e592 commit 039e522

6 files changed

Lines changed: 7 additions & 19 deletions

File tree

cortex-gui/src/context/ActivityIndicatorContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export const ActivityIndicatorProvider: ParentComponent = (props) => {
370370
// Event handler references for cleanup
371371
const handleLspProgress = (e: CustomEvent) => {
372372
const { serverId, token, title, message, percentage, done } = e.detail;
373-
const taskId = `lsp_${serverId}_${token}`;
373+
// taskId reserved for future use or logging: `lsp_${serverId}_${token}`
374374

375375
if (done) {
376376
// Find and complete the task
@@ -403,7 +403,7 @@ export const ActivityIndicatorProvider: ParentComponent = (props) => {
403403
// Handle Git operation events
404404
const handleGitOperation = (e: CustomEvent) => {
405405
const { operation, status, message, error } = e.detail;
406-
const taskId = `git_${operation}_${Date.now()}`;
406+
// taskId reserved for future use or logging: `git_${operation}_${Date.now()}`
407407

408408
if (status === "start") {
409409
createTask({
@@ -480,7 +480,7 @@ export const ActivityIndicatorProvider: ParentComponent = (props) => {
480480
// Handle auto-update events
481481
const handleAutoUpdateEvent = (e: CustomEvent) => {
482482
const { status, progress, version, error } = e.detail;
483-
const taskId = "auto_update";
483+
// taskId reserved for future use or logging: "auto_update"
484484

485485
if (status === "checking") {
486486
createTask({

cortex-gui/src/context/AutoUpdateContext.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,6 @@ export function AutoUpdateProvider(props: ParentProps) {
403403
}
404404
};
405405

406-
// Check if we should show release notes on first launch after update
407-
const checkFirstLaunchAfterUpdate = () => {
408-
const currentVersion = state.currentVersion;
409-
const lastShown = state.lastShownVersion;
410-
411-
// If current version is different from last shown, show release notes
412-
if (currentVersion && currentVersion !== "0.0.0" && currentVersion !== lastShown) {
413-
fetchReleaseNotes(currentVersion);
414-
setState("showingReleaseNotes", true);
415-
}
416-
};
417-
418406
// Helpers
419407
const isUpdateAvailable = () => {
420408
return state.status.type === "UpdateAvailable";

cortex-gui/src/context/ChannelsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createContext, useContext, ParentProps, onCleanup, createEffect, onMount } from "solid-js";
2-
import { createStore, produce, SetStoreFunction } from "solid-js/store";
2+
import { createStore, produce } from "solid-js/store";
33
import { useCollab } from "./CollabContext";
44

55
// ============================================================================

cortex-gui/src/context/ChatEditingContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createContext, useContext, ParentProps, batch } from "solid-js";
2-
import { createStore, produce } from "solid-js/store";
2+
import { createStore } from "solid-js/store";
33
import { fsWriteFile } from "../utils/tauri-api";
44

55
export type ChangeStatus = "pending" | "accepted" | "rejected";

cortex-gui/src/context/ContextServerContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* external context providers like databases, APIs, and documentation sources.
66
*/
77

8-
import { createContext, useContext, ParentProps, onMount, onCleanup, createEffect } from "solid-js";
8+
import { createContext, useContext, ParentProps, onMount, onCleanup } from "solid-js";
99
import { createStore } from "solid-js/store";
1010
import { invoke } from "@tauri-apps/api/core";
1111
import { listen, UnlistenFn } from "@tauri-apps/api/event";

cortex-gui/src/context/NotebookContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function parseNotebookFile(content: string): JupyterNotebook {
263263
: (cell.source as string) || "";
264264

265265
const outputs: CellOutput[] = Array.isArray(cell.outputs)
266-
? (cell.outputs as CellOutput[]).map(normalizeOutput)
266+
? (cell.outputs as Record<string, unknown>[]).map(normalizeOutput)
267267
: [];
268268

269269
return {

0 commit comments

Comments
 (0)