Skip to content

Remove dead/commented-out code in web/src#2135

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/remove-dead-commented-out-code
Closed

Remove dead/commented-out code in web/src#2135
Copilot wants to merge 4 commits intomainfrom
copilot/remove-dead-commented-out-code

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Multiple files in web/src contained commented-out code blocks, a duplicate import causing a TypeScript error, and a require()-style import flagged by ESLint.

Fixes

TypeScript / ESLint errors

  • SpeedDisplay.tsx: Remove duplicate import log from "loglevel" (TS2300)
  • JobItem.test.tsx: Replace require("react-router-dom") with a proper ES import (no-require-imports)

Multi-line commented-out code blocks removed

  • AssetGridContent.tsx — dead useEffect block
  • modelDownloadCheck.ts — dead cached-files check block + orphaned hfModels?.find(...) expression; also removed the now-unused hfModels parameter from the function signature
  • GlobalChatStore.test.ts — dead mockServer.stop() block
  • numberInputStyles.ts, Welcome.styles.ts, NodeSwitch.tsx, ThemeNodetool.tsx, PlaceholderNode.tsx — dead CSS/style blocks

Single-line commented-out code removed

  • useDynamicProperty.ts, workflowUpdates.ts, useFitView.ts, FavoriteStar.tsx, settingsMenuStyles.ts, EditableInput.tsx, NumberInput.tsx

Unused variables

  • ChatMarkdown.tsx, CodeBlock.tsx, PreRenderer.tsx: Prefix unused node destructure params with _node (required by ReactMarkdown's renderer interface to prevent inadvertent DOM spreading)
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove all dead/commented-out code blocks in web/src</issue_title>
<issue_description>## Problem
Multiple files contain commented-out code blocks, unused imports, unused variables, and dead code paths that add noise and make the codebase harder to maintain.

What to do

  1. Remove all multi-line commented-out code blocks (not explanatory comments, just dead code)
  2. Remove unused imports flagged by TypeScript/ESLint
  3. Remove unused variables (prefix with _ if they're required by an interface/callback signature)
  4. Remove empty useEffect hooks that do nothing
  5. Remove duplicate property definitions

Scope

All files in web/src/. Do NOT remove:

  • JSDoc comments
  • TODO/FIXME comments
  • Single-line explanatory comments
  • Code that is commented out with a clear "TODO: re-enable when X" note</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 14, 2026

Deploying nodetool-staging with  Cloudflare Pages  Cloudflare Pages

Latest commit: a59a12d
Status:⚡️  Build in progress...

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 14, 2026

Deploying nodetool with  Cloudflare Pages  Cloudflare Pages

Latest commit: a59a12d
Status: ✅  Deploy successful!
Preview URL: https://d01ba389.nodetool.pages.dev
Branch Preview URL: https://copilot-remove-dead-commente.nodetool.pages.dev

View logs

Copilot AI and others added 2 commits March 14, 2026 21:41
…ponents

In PreRenderer, CodeBlock, and ChatMarkdown, the `node` prop is
destructured solely to keep it out of the `...props` spread (preventing
unknown DOM attribute warnings). Since it is never referenced in the
function body, rename it to `_node` to signal intentional non-use, in
line with the project's argsIgnorePattern convention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove all dead and commented-out code blocks in web/src Remove dead/commented-out code in web/src Mar 14, 2026
Copilot AI requested a review from georgi March 14, 2026 21:47
Copy link
Collaborator

georgi commented Mar 21, 2026

Review: Clean and well-scoped PR. Changes look correct:

  • Removes duplicate import log in SpeedDisplay.tsx
  • Fixes require() → ES import in JobItem.test.tsx
  • Removes ~15 multi-line commented-out code blocks across styles, hooks, stores
  • Removes orphaned hfModels?.find() expression and unused hfModels parameter from modelDownloadCheck.ts
  • Properly prefixes unused node params with _node in markdown renderers

One note: the JobItem.test.tsx import fix also appears in other PRs (#2219 merged). Please rebase on latest main to resolve any conflicts.

Copy link
Collaborator

georgi commented Mar 21, 2026

Unable to rebase this branch automatically — it has merge conflicts with main (likely in SpeedDisplay.tsx and JobItem.test.tsx which were already fixed by other merged PRs). I don't have push access to Copilot-owned branches. @copilot or @georgi please rebase this branch on latest main.

Copy link
Collaborator

georgi commented Mar 21, 2026

Superseded by #2238 which is rebased onto current main.

Copilot stopped work on behalf of georgi due to an error March 21, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove all dead/commented-out code blocks in web/src

2 participants