Skip to content

fix(repository): prevent test case edit crash from null dropdown option colors#455

Merged
therealbrad merged 1 commit into
mainfrom
fix/repository-null-icon-color-crash
Jun 20, 2026
Merged

fix(repository): prevent test case edit crash from null dropdown option colors#455
therealbrad merged 1 commit into
mainfrom
fix/repository-null-icon-color-crash

Conversation

@therealbrad

@therealbrad therealbrad commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description

Opening a repository test case in edit mode crashed to the opaque "this page couldn't load" screen when any of the case's Dropdown / Multi-Select field options had no icon color.

FieldOptions.iconColorId is nullable, so an option can legitimately have iconColor == null. The view-mode renderer guards this with optional chaining, but the edit-mode option renderers read option.fieldOption.iconColor.value (and icon.name) unguarded — so a single null-colored option threw during render. With no error boundary anywhere in the app, Next.js fell back to its default error page. The case viewed and bulk-edited fine; only inline edit crashed, which is why it was hard to reproduce.

This PR fixes the crash, prevents the bad data going forward, and adds a recovery boundary:

  • Guard the render — edit-mode Dropdown/Multi-Select option renderers now use optional chaining for icon/iconColor, matching the existing view-mode pattern.
  • Prevent null colors — new option colors now default to the darkest black instead of being saved as null, mirroring the existing icon default in the field icon picker. (Editing and saving an existing option that already has a null color also heals it.)
  • Add an error boundary — a render exception now shows a recoverable message with a "Try again" action instead of an opaque failure. This class of client-side render crash was previously invisible to server logs.

Related Issue

N/A — reported via customer support.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement

How Has This Been Tested?

Describe the tests you ran to verify your changes:

  • Unit tests
  • Integration tests
  • E2E tests
  • Manual testing

Added regression tests for both the crash and the null-color default. Each was verified to fail without the fix (reproducing the exact TypeError: Cannot read properties of null) and pass with it. Full local suite green via pnpm precommit (9775 passing).

Test Configuration:

  • OS: macOS (darwin 25.4.0)
  • Browser (if applicable): N/A
  • Node version: v24.14.0

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have signed the CLA

Screenshots (if applicable)

Additional Notes

The component fix is the root-cause fix; the color default prevents new null-colored options; the error boundary is defense-in-depth for this class of otherwise-silent client render crash.

…on colors

Dropdown and Multi-Select field options can legitimately have no icon color
(iconColorId is nullable). The repository case page's edit-mode renderer read
the option's icon/iconColor unguarded, so a single null-colored option threw
during render. With no error boundary anywhere, the whole page fell back to the
opaque "couldn't load" screen.

- Guard icon/iconColor access in the edit-mode option renders of
  FieldValueRenderer, matching the existing view-mode pattern
- Default new option colors to the darkest black instead of leaving them null,
  mirroring the existing icon default in FieldIconPicker
- Add an error boundary so a render exception shows a recoverable message
  instead of an opaque failure
@therealbrad therealbrad merged commit 61a4dfe into main Jun 20, 2026
5 checks passed
@therealbrad therealbrad deleted the fix/repository-null-icon-color-crash branch June 20, 2026 12:23
@therealbrad

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.39.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant