Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions components/error-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ export class ErrorBoundary extends Component<Props, State> {

render() {
const { hasError, error, errorInfo, showStackTrace } = this.state
const { children, fallback, level = 'component' } = this.props
const { hasError, error } = this.state
const { children, fallback, showDetails = process.env.NODE_ENV === 'development', level = 'component' } = this.props
const {
children,
fallback,
level = 'component',
} = this.props
Comment on lines +130 to +134
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The PR description says the consolidated props destructuring should include showDetails with a default value, but the updated render() destructuring no longer includes showDetails at all. Either update the PR description to match the actual change, or include showDetails here (if the intent is to apply a default in render()).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Applied in commit 0f163c1. Added showDetails = process.env.NODE_ENV === 'development' as the default in each render*LevelError() method where showDetails is actually read, so the intended default is preserved without introducing an unused variable in render().


if (hasError && error) {
if (fallback) {
Expand All @@ -154,7 +156,7 @@ export class ErrorBoundary extends Component<Props, State> {

renderAppLevelError() {
const { error, errorInfo, showStackTrace } = this.state
const { showDetails } = this.props
const { showDetails = process.env.NODE_ENV === 'development' } = this.props

return (
<div className="min-h-screen bg-background flex items-center justify-center p-4">
Expand Down Expand Up @@ -225,7 +227,7 @@ export class ErrorBoundary extends Component<Props, State> {

renderPageLevelError() {
const { error, errorInfo, showStackTrace } = this.state
const { showDetails } = this.props
const { showDetails = process.env.NODE_ENV === 'development' } = this.props

return (
<div className="container mx-auto py-8 px-4">
Expand Down Expand Up @@ -288,7 +290,7 @@ export class ErrorBoundary extends Component<Props, State> {

renderSectionLevelError() {
const { error } = this.state
const { showDetails } = this.props
const { showDetails = process.env.NODE_ENV === 'development' } = this.props

return (
<Card className="border-destructive/50">
Expand All @@ -315,7 +317,7 @@ export class ErrorBoundary extends Component<Props, State> {

renderComponentLevelError() {
const { error } = this.state
const { showDetails } = this.props
const { showDetails = process.env.NODE_ENV === 'development' } = this.props

return (
<div className="rounded-lg border border-destructive/50 bg-destructive/5 p-4">
Expand Down