-
Notifications
You must be signed in to change notification settings - Fork 176
v0.20 PR 8: Landing page redesign (hero avatar, starter tiles, live pages list) #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8841913
api: starter-prompts loader + endpoint (yaml + defaults)
mcheemaa 0261a56
api: GET /ui/api/pages lists agent-created pages
mcheemaa f0455f5
api: wire starter-prompts + pages endpoints into the UI dispatcher
mcheemaa c4cd0ef
chat-ui: ?prefill= composer pre-fill on /chat mount
mcheemaa dd76238
landing: restructure /ui/ with avatar hero, starter tiles, pages list…
mcheemaa 6948369
docs: landing starter-prompts.yaml schema and customization
mcheemaa 115b0a7
chat-ui: drop double URL decode on ?prefill= handler
mcheemaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Landing page (`/ui/`) | ||
|
|
||
| The landing page is the first surface an operator sees when they open their | ||
| agent's URL. It has five sections: | ||
|
|
||
| 1. **Hero** - 120x120 avatar next to display title and two CTAs: "Talk to | ||
| `<name>`" (`/chat`) and "Open dashboard" (`/ui/dashboard/`). The avatar | ||
| falls back to an Instrument Serif letter if no avatar has been uploaded. | ||
| 2. **Agent status card** - live badge and stats (agent, version, uptime, | ||
| evolution generation) fed by `/health`. A small "Details" link opens the | ||
| HTML health page. | ||
| 3. **What can `<name>` do?** - 4 to 6 starter-prompt tiles. Each tile has | ||
| an icon, title, one-line description, and an "Ask now" button that | ||
| deep-links to `/chat?prefill=<urlencoded prompt>`. | ||
| 4. **Pages `<name>` has created for you** - live list of agent-published | ||
| HTML files in `public/`, sorted by mtime descending, top 10. Boilerplate | ||
| (`index.html`, `dashboard/*`, `_examples/*`, `chat/*`, internal files) is | ||
| filtered out. Empty state deep-links to `/chat` with a prefilled | ||
| "build me a dashboard" prompt. | ||
| 5. **Quick links** - two tiles: Dashboard and MCP endpoint. | ||
|
|
||
| ## Customizing the starter prompts | ||
|
|
||
| Starter-prompt tiles are editable by the operator (or by the agent itself, which | ||
| has Write access to `phantom-config/`). | ||
|
|
||
| Create `phantom-config/starter-prompts.yaml`: | ||
|
|
||
| ```yaml | ||
| tiles: | ||
| - icon: chart | ||
| title: Summarize Hacker News | ||
| description: Pull today's top stories and group them by theme. | ||
| prompt: Summarize the top Hacker News stories from the last 24 hours, grouped by theme. | ||
| - icon: git | ||
| title: Monitor my GitHub repos | ||
| description: Check for new issues, PRs, and commits across my starred repos. | ||
| prompt: Check for new issues and PRs on my GitHub repos since yesterday. | ||
| ``` | ||
|
|
||
| Rules: | ||
|
|
||
| - Up to 6 tiles. More than 6 -> falls back to defaults. | ||
| - Each tile requires `icon`, `title`, `description`, `prompt`. Missing any | ||
| field -> falls back to defaults. | ||
| - Field caps: `title` 80 chars, `description` 200 chars, `prompt` 2000 chars. | ||
| - Unknown top-level keys or unknown tile fields reject the whole file | ||
| (strict schema). Falls back to defaults. | ||
| - If the YAML is malformed or the schema rejects, the server logs a warning | ||
| and serves defaults so the landing page never renders blank. | ||
|
|
||
| ### Icon keys | ||
|
|
||
| The frontend maps `icon` to an inline SVG. Supported keys: | ||
|
|
||
| - `chart` | ||
| - `git` | ||
| - `inbox` | ||
| - `metrics` | ||
| - `alert` | ||
| - `calendar` | ||
| - `search` | ||
| - `globe` | ||
|
|
||
| Any other value renders a generic circle. | ||
|
|
||
| ### Cardinal Rule | ||
|
|
||
| Tile titles, descriptions, and prompts are static strings. The "Ask now" | ||
| button opens `/chat?prefill=<urlencoded prompt>` and the agent decides what | ||
| to do once the user hits Send. There is no server-side classification, no | ||
| client-side intent branching. Tiles are invitations; the agent does the | ||
| thinking. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Endpoint | Method | Auth | Shape | | ||
| |----------|--------|------|-------| | ||
| | `/ui/api/starter-prompts` | GET | public | `{ tiles: StarterTile[] }` | | ||
| | `/ui/api/pages` | GET | public | `{ pages: PageEntry[] }` | | ||
|
|
||
| Both endpoints are public because the landing page renders before the operator | ||
| authenticates. The content is operator-public copy (starter prompts) or | ||
| filenames the agent chose to publish (pages list). No sensitive state flows | ||
| through either endpoint. | ||
|
|
||
| Response caching: | ||
|
|
||
| - Starter prompts: `Cache-Control: private, max-age=60` | ||
| - Pages list: `Cache-Control: private, max-age=30` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLSearchParams.get("prefill")already returns a decoded value, so applyingdecodeURIComponentagain corrupts valid literal%xxtext in prompts. For example, a starter prompt containing"%2F"is transformed to"/"before it reaches the composer, which silently changes user-authored content. This occurs whenever the prefill text contains percent-encoded-looking substrings without an invalid%sequence to trigger the catch path.Useful? React with 👍 / 👎.