Skip to content

checks: trash icon on the open check bails back to project view#206

Merged
jorgefilipecosta merged 1 commit into
trunkfrom
fix-trash-icon-delete-open-check
May 21, 2026
Merged

checks: trash icon on the open check bails back to project view#206
jorgefilipecosta merged 1 commit into
trunkfrom
fix-trash-icon-delete-open-check

Conversation

@tyxla
Copy link
Copy Markdown
Member

@tyxla tyxla commented May 20, 2026

Summary

Addresses @oandregal's follow-up on #196.

  • The trash icon next to a check in the right sidebar previously deleted the file on disk but left the editor showing a stale, now-deleted document — unlike the three-dot menu's Delete, which bails back to the project view.
  • When the deleted check is the one open in the middle, DraftEditorScreen now calls onBack() after a successful delete (matching the three-dot menu).
  • Before navigating back, the editor pins the sidebar to the Checks tab via onSidebarOpenChange(true) / onSidebarTabChange('checks') so the panel stays open across the transition. (Sidebar open/tab state already lives in App.tsx since Persist right-panel state across project ↔ editor navigation #212, so the transition is smooth without touching uiPrefs directly.)
  • useProjectChecks.handleDeleteCheck now returns the IPC result so the editor can react to success / failure.
  • Deleting an unrelated check (one that isn't open in the middle) is unchanged — the editor stays put and only the targeted row is removed.

Test plan

  • Open a check in the middle, click the trash icon on its row, confirm — editor closes, project view appears with the Checks panel still open, file is gone from disk.
  • Open a check, click the trash icon on a different check in the sidebar, confirm — editor stays open on its current file, only the targeted check is removed.
  • From project view (no editor open), click the trash icon on a check, confirm — file is deleted and the sidebar stays open on Checks.
  • Regression: the three-dot menu's Delete in the editor titlebar still works as before.
  • `npm run test:e2e -- tests/e2e/project-checks.spec.ts` (note: the local e2e harness on my machine is currently unable to open the packaged-app window — fails on `trunk` too — so this needs to be validated in CI).

🤖 Generated with Claude Code

@tyxla tyxla mentioned this pull request May 20, 2026
4 tasks
@tyxla tyxla self-assigned this May 21, 2026
The trash icon next to a check in the sidebar previously deleted the
file but left the editor showing a stale, now-deleted document. Match
the three-dot menu's Delete: when the deleted check is the one open
in the middle, call onBack() so the user lands back in the project
view. Pin the sidebar to the Checks tab first so the panel stays
open across the transition — the project view's sidebar now persists
its open/tab state to ui-prefs the same way the editor does.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tyxla tyxla force-pushed the fix-trash-icon-delete-open-check branch from a0ebd63 to aa1c29a Compare May 21, 2026 09:30
@jorgefilipecosta jorgefilipecosta merged commit a193c08 into trunk May 21, 2026
@jorgefilipecosta jorgefilipecosta deleted the fix-trash-icon-delete-open-check branch May 21, 2026 10:24
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.

2 participants