fix: Remove unused imports and dead code - #413
Open
SamuelStave wants to merge 1 commit into
Open
Conversation
- 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
There was a problem hiding this comment.
Pull request overview
Description: Removes unused imports and dead error-mapping code.
Changes:
- Removes unused error-mapper helpers.
- Removes the unused
AlertCircleimport. - 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 dropserror.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 andcolorSchemeinterpolations 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 andcolorSchemeinterpolations 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
classNamehas the same missing template-literal delimiters as the header above, leaving invalid JavaScript tokens in JSX. Restore the string and thecolorScheme.textinterpolation.
<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.textinterpolation.
<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.textinterpolation.
<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: } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #361