Skip to content

Demo: triggerAngie with programmatic and hash deep links - #52

Merged
matipojo merged 1 commit into
masterfrom
demo-trigger-angie-prompt
Jun 8, 2026
Merged

Demo: triggerAngie with programmatic and hash deep links#52
matipojo merged 1 commit into
masterfrom
demo-trigger-angie-prompt

Conversation

@matipojo

@matipojo matipojo commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add demo/trigger-angie-prompt/ — interactive demo for opening Angie with a pre-filled prompt via sdk.triggerAngie()
  • Cover programmatic triggers (fill input, new chat, quick chips) and hash deep links (#angie-prompt=…, optional angie-new-chat=true)
  • Split hash examples into in-page links (same tab, no scroll) and new-tab links (simulates arrival from email/docs) with an external-link icon
  • Link the new demo from demo/index.html

Test plan

  • Run npm run demo and open /demo/trigger-angie-prompt/
  • Click Fill input & open Angie — sidebar opens with prompt in input
  • Click New chat + prompt — fresh chat with prompt filled
  • Click in-page hash links — Angie opens without page jump
  • Click new-tab hash links — new tab loads, hash consumed, Angie opens with prompt
  • Confirm demo index links to the new demo

✨ PR Description

1. Problem & Context

New demo showcasing triggerAngie() API with two interaction patterns: programmatic calls from UI and hash-based deep linking for shareable URLs. Demonstrates waitForReady flow and newChat option.

2. What Changed (Where)

  • demo/trigger-angie-prompt/index.html — 170-line demo page with prompt input, quick-action chips, hash link examples, status display
  • demo/trigger-angie-prompt/host.js — SDK initialization, hash parsing (readPromptFromHash), click handlers for buttons/chips/links, triggerAngie invocation with error handling
  • demo/trigger-angie-prompt/demo-host.css — 367-line design system (variables, layout grid, form controls, status states, code blocks)
  • demo/index.html — Added card linking to new demo in carousel

3. How It Works

Hash params parsed on load via readPromptFromHash() and consumed before clearing hash. Prompt state flows: input field → getPrompt() → triggerAngie({ prompt, options: { newChat } }). Event listeners on buttons (fill/new-chat), chips (quick prompts), and in-page hash links (preventDefault, parse, trigger). New-tab hash links skip interception. Status element updated with response.requestId on success or error details on failure.

4. Risks

None—isolated demo module. Minor: hash link UX assumes users won't manually edit params (gracefully fails with "missing prompt" error). New-tab links don't handle hash consumption, but that's by design (separate session).

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@matipojo
matipojo merged commit 244b60d into master Jun 8, 2026
15 checks passed
@matipojo
matipojo deleted the demo-trigger-angie-prompt branch June 8, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant