Skip to content

fix: Remove unused imports and dead code - #413

Open
SamuelStave wants to merge 1 commit into
HubDApp:mainfrom
SamuelStave:fix/unused-imports-361
Open

fix: Remove unused imports and dead code#413
SamuelStave wants to merge 1 commit into
HubDApp:mainfrom
SamuelStave:fix/unused-imports-361

Conversation

@SamuelStave

Copy link
Copy Markdown

Closes #361

- Remove unused AlertCircle import from ErrorDisplay.tsx
- Remove dead code: shouldDisplayError (always returned true) and formatErrorForLogging (unused) from error-mapper.ts
- Cleanup cleanup noted with comment
Copilot AI lite review requested due to automatic review settings August 25, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Description: Removes unused imports and dead error-mapping code.

Changes:

  • Removes unused error-mapper helpers.
  • Removes the unused AlertCircle import.
  • Updates ErrorDisplay, but introduces invalid JSX/TSX expressions that prevent compilation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Summary
dongle/lib/error-mapper.ts Removes unused helper functions.
dongle/components/ui/ErrorDisplay.tsx Contains malformed class-name and code-interpolation expressions requiring correction.
Suppressed comments (8)

dongle/components/ui/ErrorDisplay.tsx:146

  • The modal technical-details block has the same broken code expression as the inline block: {error.code && \nCode: } cannot be parsed and drops error.code. Restore the template literal here as well.
                  {error.code && \nCode: }

dongle/components/ui/ErrorDisplay.tsx:98

  • This banner branch repeats the malformed className={...} replacements, so these JSX attributes are parsed as JavaScript instead of strings and the component cannot compile. Restore the backtick-delimited class strings and colorScheme interpolations for this branch and the remaining changed attributes.
        className={lex items-center gap-3 px-6 py-4 border-b  }
      >
        <Icon className={w-5 h-5 shrink-0 } />
        <div className="flex-1 min-w-0">
          <p className={	ext-sm font-medium }>

dongle/components/ui/ErrorDisplay.tsx:126

  • The modal header also contains raw utility tokens inside a JSX expression (className={...}), which is invalid TSX and removes the severity-specific colors. Restore the template-literal class names and colorScheme interpolations in this header.
          <div className={lex items-center gap-3 px-6 py-4 border-b  }>
            <Icon className={w-6 h-6 shrink-0 } />
            <h3 className={ont-bold text-lg }>

dongle/components/ui/ErrorDisplay.tsx:62

  • This actionable-message className has the same missing template-literal delimiters as the header above, leaving invalid JavaScript tokens in JSX. Restore the string and the colorScheme.text interpolation.
            <p className={	ext-xs mt-1  opacity-80}>

dongle/components/ui/ErrorDisplay.tsx:71

  • Both class names in this technical-details section were converted into invalid JSX expressions and no longer use the selected severity color. Restore the template-literal strings and colorScheme.text interpolation.
              <summary className={	ext-xs cursor-pointer  opacity-60 hover:opacity-100}>
                Technical details
              </summary>
              <pre className={	ext-xs mt-1 p-2 rounded bg-black/5 dark:bg-white/5 overflow-x-auto  font-mono}>

dongle/components/ui/ErrorDisplay.tsx:81

  • The close button's className={...} is also invalid TSX because the string delimiters were removed. Restore the template literal so the button can compile and retain its severity text color.
            className={shrink-0  opacity-50 hover:opacity-100 transition-opacity}

dongle/components/ui/ErrorDisplay.tsx:102

  • This banner actionable-message class is raw utility text inside a JSX expression, so the component remains uncompilable even after fixing the banner header. Restore the template literal and colorScheme.text interpolation.
            <p className={	ext-xs mt-0.5  opacity-80}>

dongle/components/ui/ErrorDisplay.tsx:110

  • The banner close button has the same malformed className={...} expression and must be restored to a template-literal string before this component can compile.
            className={shrink-0  opacity-50 hover:opacity-100 transition-opacity}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +54 to +58
className={ lex items-start gap-3 p-4 rounded-xl border }
>
<Icon className={`w-5 h-5 mt-0.5 shrink-0 ${colorScheme.icon}`} />
<Icon className={w-5 h-5 mt-0.5 shrink-0 } />
<div className="flex-1 min-w-0">
<p className={`text-sm font-medium ${colorScheme.text}`}>
<p className={ ext-sm font-medium }>
<pre className={ ext-xs mt-1 p-2 rounded bg-black/5 dark:bg-white/5 overflow-x-auto font-mono}>
{error.technicalDetails}
{error.code && `\nCode: ${error.code}`}
{error.code && \nCode: }
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.

Fix Unused Imports and Dead Code

2 participants