Skip to content

fix: prevent TUI crash when opening gallery item in browser#29

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/critical-bug-inspection-defe
Draft

fix: prevent TUI crash when opening gallery item in browser#29
cursor[bot] wants to merge 1 commit intomainfrom
cursor/critical-bug-inspection-defe

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Apr 3, 2026

Summary

  • Fixes a critical crash in Gallery Detail when pressing [o] to open a generation in the browser.
  • Adds a small openInBrowser helper in src/core/browser.ts and exports it via src/core/index.ts.
  • Updates GalleryDetail to handle browser-open failures with an awaited promise + .catch(...) and display an in-app error instead of crashing.
  • Adds src/core/browser.test.ts to validate successful opener invocation and failure propagation.

Bug / impact

On systems where launching a browser fails (common in headless terminals, CI shells, or misconfigured desktop environments), pressing [o] in gallery detail caused an unhandled promise rejection. In current Node runtimes this terminates the process, abruptly killing the TUI session and interrupting user workflow.

Root cause

open() was called inside an Ink input handler without awaiting or catching the returned promise. Rejections escaped the handler and became process-level unhandled rejections.

Validation

  • pnpm typecheck
  • pnpm build
  • pnpm test ✅ (31 tests, including new browser helper tests)

Scope

Minimal, high-confidence fix focused only on the crash path; no broad refactors.

Open in Web View Automation 

Co-authored-by: Dylan Boudro <starmorph@users.noreply.github.com>
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.

1 participant