Skip to content

Add pop-out button to chat widget for full-screen view - #38

Merged
neuromechanist merged 2 commits into
developfrom
feature/widget-popout
Jan 15, 2026
Merged

neuromechanist merged 2 commits into
developfrom
feature/widget-popout

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

  • Adds a pop-out button (arrow icon) in the chat widget header
  • Opens the chat in a new fullscreen window for side-by-side viewing with documentation
  • Chat history persists via shared localStorage between embedded widget and pop-out window

Changes

  • Added popout icon to ICONS object
  • Added pop-out button in header actions (next to reset button)
  • Implemented openPopout() function that fetches widget script and creates fullscreen popup
  • Added fullscreen config option and corresponding CSS styles
  • Widget checks for __OSA_CHAT_CONFIG__ at startup for popup pre-configuration

Test Plan

  • Test pop-out button appears in widget header
  • Test clicking pop-out opens new window with fullscreen chat
  • Test chat history is shared between embedded widget and pop-out
  • Test fullscreen mode hides toggle button and resize handle

- Add pop-out icon and button in chat header
- Implement openPopout() that fetches script and opens popup with fullscreen mode
- Add fullscreen config option and CSS styles
- Widget checks for __OSA_CHAT_CONFIG__ at startup for popup configuration
- Chat history persists via shared localStorage
- Use document.currentScript for reliable script URL detection
- Add HTTP response status check for fetch errors
- Escape JSON config to prevent script injection
- Wrap document.write in try-catch for error handling
- Track popup reference to prevent duplicate windows
- Add loading state with disabled button and aria-busy
- Calculate responsive popup size based on screen dimensions
- Validate empty script content before use
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