Skip to content

fix: prevent GalleryDetail crash on browser-open failure#23

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

fix: prevent GalleryDetail crash on browser-open failure#23
cursor[bot] wants to merge 1 commit intomainfrom
cursor/critical-bug-inspection-b544

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Mar 29, 2026

Summary

  • fixed a critical crash path introduced by the gallery "open in browser" keybind
  • added a safe browser-open helper that catches open() failures and returns a user-facing error
  • updated GalleryDetail to use the safe helper so keypress handling cannot trigger an unhandled rejection
  • added unit tests for URL encoding and failure handling

Critical bug

Pressing o in gallery detail called open(...) without awaiting or handling rejections. If the OS/browser launch failed (e.g. missing/blocked browser command, headless env), the promise rejection was unhandled and could terminate the Node process, crashing the TUI.

Validation

  • pnpm build
  • pnpm test
  • pnpm typecheck
  • pnpm lint
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