Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5ac6751
Add OpenGraph preview canvas extension
IEvangelist Jun 29, 2026
88c4088
Fix og-preview canvas dark-mode theming and live panel title
IEvangelist Jun 29, 2026
6da32d5
Redesign og-preview canvas UX to match the app
IEvangelist Jun 30, 2026
285380c
Polish og-preview: code hovercards, rich value formatting, handle/com…
IEvangelist Jun 30, 2026
3e8856c
Refine og-preview: srcdoc browse tab, masonry previews, unified chevr…
IEvangelist Jun 30, 2026
2cac418
Browse iframe JS execution, previews layout toggle, language-tab pers…
IEvangelist Jun 30, 2026
68acb11
Add Reddit and Mastodon preview cards, fix grid icon, add previews he…
IEvangelist Jun 30, 2026
65193ae
Address PR review + fix code-hovercard HTML bug + Browse/preview UX
IEvangelist Jun 30, 2026
e52d957
Replace browse loading card with a slim top progress bar
IEvangelist Jun 30, 2026
a165c0b
Make the browse tab interactive via a script-rewriting proxy
IEvangelist Jun 30, 2026
4755854
Add GitHub raw code highlighting and diagnostics AI fix prompts
IEvangelist Jul 1, 2026
5c8b854
Add repo-detected Copilot actions to diagnostics AI fix prompts
IEvangelist Jul 1, 2026
3170c14
Polish diagnostics AI fix prompt footer + unconfigured-repo note
IEvangelist Jul 1, 2026
4cc657c
Use official Copilot/issue icons, link the repo slug, and fix scrollb…
IEvangelist Jul 1, 2026
94d68cd
Add agent-readiness diagnostics section
IEvangelist Jul 1, 2026
6e4b1f8
Add OpenGraph structured-property diagnostics
IEvangelist Jul 1, 2026
6593c28
Replace Try chip with an 'I'm feeling lucky' rotating site button
IEvangelist Jul 1, 2026
af90bd3
Tone down the I'm feeling lucky button styling
IEvangelist Jul 1, 2026
894a480
Make diagnostics sections collapsible
IEvangelist Jul 1, 2026
5a6544e
Align collapsible diagnostics section headers with content
IEvangelist Jul 1, 2026
e7e841b
Slim scrollbars and drop reddit/bsky from lucky sites
IEvangelist Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/extensions/og-preview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# OpenGraph Preview canvas

A GitHub Copilot App **canvas extension** that loads any URL — including local dev
servers like `http://localhost:3000` — and shows how it unfurls across social
platforms, alongside a raw OpenGraph metadata view and a diagnostics checklist.

## Features

- **Platform previews** — OpenGraph/Facebook, X (Twitter, both `summary` and
`summary_large_image` layouts), LinkedIn, Slack, and Discord.
- **Raw metadata** — every `og:*`, `twitter:*`, and other `<meta>` tag, grouped,
with per-value quick **copy buttons** and a one-click **Copy JSON**.
- **Diagnostics** — checks for the required/recommended OpenGraph tags.
- **Collapsible page-info footer** — final URL, HTTP status, tag count, and
diagnostics summary; expanded/collapsed state is remembered.
- **Quick examples** — one-tap chip to preview `aspire.dev`.
- **Auto scheme** — bare domains are completed automatically (`https://`, or
`http://` for localhost).
- **Native look & feel** — chrome is built on the documented app theme tokens
(shadcn-flavored controls, on-theme accent) and adapts to light/dark.
- **Loading UX** — shaped skeletons that mirror the real layout, shimmer, and
View-Transition cross-fades (respecting `prefers-reduced-motion`).
- **localhost support** — fetches are made by the extension process over plain
`http`/`https`, so loopback URLs work.
- **Image proxy fallback** — preview images that block hotlinking are retried
through a local proxy.

## How it works

Each open canvas instance runs a small loopback HTTP server (`127.0.0.1`, random
port) that serves the static UI from `ui/` and a JSON API:

| Route | Purpose |
| --- | --- |
| `GET /` | Renderer page (auto-loads `?u=<url>`) |
| `GET /api/fetch?u=` | Fetch + parse the target, return metadata JSON |
| `GET /api/img?u=` | Image proxy fallback |
| `GET /events` | Server-Sent Events; agent-driven loads are pushed here |

The target page is fetched and parsed server-side (no external dependencies),
which sidesteps browser CORS and lets it reach `localhost`.

## Agent actions & tools

- **`open_og_preview`** `{ url?, instanceId? }` *(tool)* — open or focus the
canvas in the side panel, optionally loading a URL immediately. Lets the agent
bring up the preview on command (e.g. "open the OG preview for aspire.dev").
- **`preview_url`** `{ url }` *(canvas action)* — load a URL into the open canvas
and return its resolved preview fields.
- **`get_metadata`** `{ url }` *(canvas action)* — fetch + parse a URL and return
all raw metadata as JSON, without opening the canvas.

## Files

```
og-preview/
extension.mjs wiring: server, routes, canvas declaration + actions
lib/http-fetch.mjs dependency-free http/https fetch (redirects, timeout)
lib/parse-og.mjs meta-tag parser -> resolved fields, groups, diagnostics
ui/index.html renderer markup
ui/styles.css platform-styled cards + app-theme chrome
ui/app.js client logic (fetch, render, tabs, SSE)
```
4 changes: 4 additions & 0 deletions .github/extensions/og-preview/copilot-extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "og-preview",
"version": 1
}
Loading