Skip to content

[WEB-6783] fix: crash when deleting work item from peek view in workspace spreadsheet#8821

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
fix/workspace-view-spreadsheet-delete-crash
Mar 30, 2026
Merged

[WEB-6783] fix: crash when deleting work item from peek view in workspace spreadsheet#8821
sriramveeraghanta merged 2 commits intopreviewfrom
fix/workspace-view-spreadsheet-delete-crash

Conversation

@anmolsinghbhatia
Copy link
Copy Markdown
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Mar 29, 2026

Summary

  • Fixes crash (Cannot read properties of undefined (reading 'created_at')) when deleting a work item via peek view in workspace views spreadsheet layout
  • Root cause: SpreadsheetIssueRow called isIssueNew(issueMap[issueId]) without checking if the issue still exists in the MobX store after deletion
  • Added early return null guard in SpreadsheetIssueRow (matching existing pattern in list view's block-root.tsx:130)
  • Added defensive guard on isIssueNew call in list block-root for consistency

Type of Change

  • Bug fix

Test cases

# Scenario Steps Expected
1 Delete from peek view (spreadsheet) Open workspace view → spreadsheet layout → click issue to open peek → delete issue Peek closes, row removed, no crash
2 Delete from peek view (list) Same flow but in list layout List updates cleanly, no crash
3 Delete last issue in group (spreadsheet) Have a group with 1 issue → delete via peek Group shows empty state, no crash
4 Delete sub-issue from peek (spreadsheet) Expand parent → click sub-issue → delete via peek Sub-issue row removed, parent remains
5 Delete then navigate Delete issue via peek → switch to another view/layout No stale renders or errors
6 Bulk operations still work Select multiple issues → bulk delete All rows removed, no crash
7 New issue highlight still works Create a new issue in spreadsheet view Row renders with highlight (isIssueNew returns true within 30s)

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of missing issue data in list and spreadsheet layouts to prevent rendering errors when issue information is unavailable.

@anmolsinghbhatia anmolsinghbhatia self-assigned this Mar 29, 2026
Copilot AI review requested due to automatic review settings March 29, 2026 20:46
@anmolsinghbhatia anmolsinghbhatia changed the title fix: crash when deleting work item from peek view in workspace spreadsheet [WEB-6783] fix: crash when deleting work item from peek view in workspace spreadsheet Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 760432af-6bb3-47ed-9bf2-26c95027a44a

📥 Commits

Reviewing files that changed from the base of the PR and between f0468a9 and 4eee531.

📒 Files selected for processing (2)
  • apps/web/core/components/issues/issue-layouts/list/block-root.tsx
  • apps/web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx

📝 Walkthrough

Walkthrough

Two issue rendering components now guard against missing issue entries in issueMap. Both add conditional checks to prevent undefined values from being passed to isIssueNew, providing safe fallbacks when issue data is absent during rendering.

Changes

Cohort / File(s) Summary
Issue Rendering Safety Checks
apps/web/core/components/issues/issue-layouts/list/block-root.tsx, apps/web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx
Added defensive null/undefined checks for issue data. block-root.tsx guards isIssueNew call with fallback to false. issue-row.tsx derives local issue variable and returns null early if missing, then uses the guarded value for RenderIfVisible defaultValue computation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Through issueMap we hop and bound,
But sometimes entries can't be found,
So guard with checks, both safe and sound,
Let null returns keep bugs uncrowned! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing a crash when deleting work items from the peek view in workspace spreadsheet, with a specific ticket reference.
Description check ✅ Passed The description includes a comprehensive summary, clearly marks it as a bug fix, provides detailed test scenarios in a table format, but the references section is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/workspace-view-spreadsheet-delete-crash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@makeplane
Copy link
Copy Markdown

makeplane bot commented Mar 29, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a UI crash when deleting a work item from the peek view in the workspace spreadsheet layout by ensuring “new issue” highlighting logic doesn’t run on deleted/missing issues in the client store.

Changes:

  • Add a null guard in SpreadsheetIssueRow when the issue no longer exists in issueMap.
  • Pass a concrete issue object to isIssueNew in spreadsheet row rendering (avoids undefined access).
  • Add an extra defensive guard around isIssueNew in list layout rendering.

Reviewed changes

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

File Description
apps/web/core/components/issues/issue-layouts/spreadsheet/issue-row.tsx Guards against missing issue entries post-deletion and prevents isIssueNew from being called with undefined.
apps/web/core/components/issues/issue-layouts/list/block-root.tsx Adds a defensive conditional around isIssueNew in list layout’s RenderIfVisible default rendering decision.

Comment on lines 140 to 142
verticalOffset={100}
defaultValue={shouldRenderByDefault || isIssueNew(issuesMap[issueId])}
defaultValue={shouldRenderByDefault || (issuesMap[issueId] ? isIssueNew(issuesMap[issueId]) : false)}
placeholderChildren={<ListLoaderItemRow shouldAnimate={false} renderForPlaceHolder defaultPropertyCount={4} />}
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

IssueBlockRoot already returns early when issuesMap[issueId]?.created_at is falsy, so issuesMap[issueId] is guaranteed to exist at this point. The added ternary is redundant and also repeats the map lookup. Consider keeping the previous isIssueNew(issuesMap[issueId]) call, or assign const issue = issuesMap[issueId] after the guard and use that variable for clarity.

Copilot uses AI. Check for mistakes.
@sriramveeraghanta sriramveeraghanta merged commit 5e23793 into preview Mar 30, 2026
15 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/workspace-view-spreadsheet-delete-crash branch March 30, 2026 06:50
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.

3 participants