Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 1 addition & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Copy to `.env` (or set via your shell) to enable optional integrations.
# `.env`, `.env.local`, and `.env.production` are all gitignored.
#
# Both of these values are PUBLIC (they're shipped to the browser by Astro's
# Values below are PUBLIC (they're shipped to the browser by Astro's
# `envField`, and live behind rate limiting / allow-lists on the vendor side).

# Kapa Custom Frontend integration ID for the "Ask AI" button in the header.
# If unset, the Ask AI button is hidden and the site still runs normally.
# Get yours at: https://app.kapa.ai/admin
PUBLIC_KAPA_INTEGRATION_ID=

# PushFeedback project ID for the per-page "Was this helpful?" widget and the
# feedback widget on the Scalar API page. If unset, both widgets are hidden.
# Dashboard: https://app.pushfeedback.com
PUBLIC_PUSHFEEDBACK_PROJECT_ID=
11 changes: 0 additions & 11 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export default defineConfig({
access: 'public',
optional: true,
}),
PUBLIC_PUSHFEEDBACK_PROJECT_ID: envField.string({
context: 'client',
access: 'public',
optional: true,
}),
PUBLIC_RUDDERSTACK_WRITE_KEY: envField.string({
context: 'client',
access: 'public',
Expand Down Expand Up @@ -82,12 +77,6 @@ export default defineConfig({
// on every page on docs.warp.dev today; Starlight does not produce
// them by default. Per-page OG/Twitter tags (image, branded title,
// twitter:title/description) live in src/components/CustomHead.astro.
//
// PushFeedback CSS + JS used to live here, but they were render-
// blocking on every page even though the widget itself only sits
// at the bottom of the page in `FeedbackFooter.astro`. The lazy
// loader now lives inside `FeedbackButtons.astro` and pulls the
// assets in `requestIdleCallback` time — off the critical path.
{
tag: 'meta',
attrs: { name: 'robots', content: 'index, follow' },
Expand Down
162 changes: 0 additions & 162 deletions src/components/FeedbackButtons.astro

This file was deleted.

12 changes: 2 additions & 10 deletions src/components/FeedbackFooter.astro
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
// Custom footer with PushFeedback "Was this helpful?" widget.
// PushFeedback CDN is loaded via Starlight's `head` config in astro.config.mjs.
// Dashboard: https://app.pushfeedback.com
// Custom footer: drops EditLink + LastUpdated from Starlight's default
// footer and keeps Pagination + the Starlight credits link.
import Pagination from 'virtual:starlight/components/Pagination';
import config from 'virtual:starlight/user-config';
import FeedbackButtons from './FeedbackButtons.astro';
---

<footer class="sl-flex">
<FeedbackButtons />

<Pagination />

{
Expand All @@ -22,15 +18,11 @@ import FeedbackButtons from './FeedbackButtons.astro';
</footer>

<style>
/* `.feedback-*` rules live alongside the markup in FeedbackButtons.astro
so they ship together. Only footer-level layout stays here. */
@layer starlight.core {
footer {
flex-direction: column;
gap: 1.25rem;
margin-top: 2rem;
padding-top: 1.25rem;
border-top: 1px solid var(--sl-color-hairline-light);
}
.kudos {
align-items: center;
Expand Down
104 changes: 5 additions & 99 deletions src/pages/api.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@
import fs from 'node:fs';
import { parse } from 'yaml';
import WarpTopbar from '../components/WarpTopbar.astro';
import FeedbackButtons from '../components/FeedbackButtons.astro';
const yamlContent = fs.readFileSync('developers/agent-api-openapi.yaml', 'utf-8');
const specObject = parse(yamlContent);
const specJson = JSON.stringify(specObject);
// `PUBLIC_PUSHFEEDBACK_PROJECT_ID` is read directly inside `<FeedbackButtons />`
// (see `src/components/FeedbackButtons.astro`) — no need to plumb it through
// here.
---

<!doctype html>
Expand Down Expand Up @@ -47,9 +43,6 @@ const specJson = JSON.stringify(specObject);
<meta name="twitter:description" content="Interactive API reference for the Agent API. Create and manage cloud agent runs, schedules, and more." />
<meta name="twitter:image" content="https://docs.warp.dev/assets/og/api.png" />
<link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml" />
{/* PushFeedback CSS + JS are NOT loaded here — the lazy loader inside
`<FeedbackButtons />` (rendered below) injects them on idle so the
Scalar reference's first paint isn't blocked on a CDN fetch. */}
<script is:inline>
// Theme persistence: shared between Starlight pages and this Scalar
// /api page. `localStorage['starlight-theme']` is the single source
Expand All @@ -58,7 +51,8 @@ const specJson = JSON.stringify(specObject);
// `prefers-color-scheme` and apply both `body.dark-mode` /
// `body.light-mode` (Scalar's color contract — our customCss block
// below keys all the brand tokens off these classes) and
// `<html data-theme>` (PushFeedback's contract).
// `<html data-theme>` (which drives the first-paint canvas color
// rules in the inline `<style>` block below).
//
// Runs synchronously in <head> so the body class is set before
// Scalar's bundle parses, avoiding a flash from Scalar's default.
Expand Down Expand Up @@ -118,9 +112,9 @@ const specJson = JSON.stringify(specObject);
apply(resolve(e.newValue));
});
// Belt-and-braces: any other actor that flips body.dark-mode /
// body.light-mode (Scalar internals, PushFeedback, future
// integrations) should still update html[data-theme] so
// PushFeedback's modal stays in sync with the visible page.
// body.light-mode (Scalar internals, future integrations) should
// still update html[data-theme] so the first-paint canvas rules
// stay in sync with the visible page.
var mirror = new MutationObserver(function () {
var b = document.body;
if (!b) return;
Expand Down Expand Up @@ -352,93 +346,5 @@ const specJson = JSON.stringify(specObject);
})();
</script>
<script is:inline src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.57.1" crossorigin="anonymous"></script>
<FeedbackButtons
question="Was this helpful?"
class="api-feedback-widget"
questionClass="api-feedback-label"
buttonClass="api-feedback-btn"
page="/api"
/>
<style is:inline>
/* `.warp-topbar*` rules ship with `<WarpTopbar />` itself; only the
/api-specific feedback widget styling lives here.

Anchored to the bottom-RIGHT so the widget sits where users naturally
look for inline page actions. Scalar's Shell client picker / dark-mode
toggle live inside the operations column rather than fixed to the
viewport, so the two don't actually collide at this z-index.

Soft elevation (hairline + shadow) replaces the hard border so the
card reads as a layer above the page rather than a flat patch.
Light-mode swaps the shadow to a quieter alpha. */
.api-feedback-widget {
position: fixed;
bottom: 1.25rem;
right: 1.25rem;
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.4375rem 0.625rem 0.4375rem 0.875rem;
border-radius: 0.625rem;
background: var(--scalar-background-2);
border: 1px solid var(--scalar-border-color);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.12);
z-index: 1000;
font-family: var(--scalar-font, 'Inter', sans-serif);
}
.light-mode .api-feedback-widget {
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.api-feedback-label {
color: var(--scalar-color-2);
font-size: 0.8125rem;
font-weight: 500;
line-height: 1;
}
.api-feedback-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.3125rem;
padding: 0.25rem 0.5rem;
border: none;
border-radius: 0.4375rem;
background: transparent;
color: var(--scalar-color-2);
font-size: 0.75rem;
font-weight: 500;
font-family: var(--scalar-font, 'Inter', sans-serif);
line-height: 1;
cursor: pointer;
transition: color 0.15s ease, background-color 0.15s ease;
}
.api-feedback-btn svg {
width: 13px;
height: 13px;
opacity: 0.85;
}
.api-feedback-btn:hover {
color: var(--scalar-color-1);
background: var(--scalar-background-3);
}
.api-feedback-btn:hover svg {
opacity: 1;
}
.api-feedback-btn:focus-visible {
outline: 2px solid var(--scalar-color-accent);
outline-offset: 1px;
}
@media (max-width: 640px) {
.api-feedback-widget {
bottom: 1rem;
right: 1rem;
padding: 0.375rem 0.5rem 0.375rem 0.75rem;
gap: 0.375rem;
}
.api-feedback-label {
font-size: 0.75rem;
}
}
</style>
</body>
</html>
Loading
Loading