tweak: update OAuth callback branding (#34081)
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
// offline and drop into any transport (`res.end(...)`, Effect `response.end`,
|
// offline and drop into any transport (`res.end(...)`, Effect `response.end`,
|
||||||
// etc.).
|
// etc.).
|
||||||
//
|
//
|
||||||
// The visual language mirrors the opencode app: the design tokens are a curated
|
// The visual language mirrors the OpenCode app: the design tokens are a curated
|
||||||
// subset of the OC-2 semantic tokens in `packages/ui/src/styles/theme.css`, and
|
// subset of the OC-2 semantic tokens in `packages/ui/src/styles/theme.css`, and
|
||||||
// the wordmark is the same geometry as `packages/ui/src/components/logo.tsx`.
|
// the wordmark is the same geometry as `packages/ui/src/components/logo.tsx`.
|
||||||
// Keep this file in sync with those sources when the brand changes.
|
// Keep this file in sync with those sources when the brand changes.
|
||||||
@@ -25,8 +25,8 @@ export function success(options?: CallbackPageOptions) {
|
|||||||
body: renderCard({
|
body: renderCard({
|
||||||
status: "success",
|
status: "success",
|
||||||
headline: "Authorization successful",
|
headline: "Authorization successful",
|
||||||
message: provider ? `opencode is now connected to ${escapeHtml(provider)}.` : "opencode is now authorized.",
|
message: provider ? `OpenCode is now connected to ${escapeHtml(provider)}.` : "OpenCode is now authorized.",
|
||||||
footnote: "You can close this window and return to opencode.",
|
footnote: "You can close this window.",
|
||||||
}),
|
}),
|
||||||
script: options?.autoClose === false ? undefined : AUTO_CLOSE_SCRIPT,
|
script: options?.autoClose === false ? undefined : AUTO_CLOSE_SCRIPT,
|
||||||
})
|
})
|
||||||
@@ -40,10 +40,10 @@ export function error(detail: string, options?: CallbackPageOptions) {
|
|||||||
status: "error",
|
status: "error",
|
||||||
headline: "Authorization failed",
|
headline: "Authorization failed",
|
||||||
message: provider
|
message: provider
|
||||||
? `opencode couldn't finish connecting to ${escapeHtml(provider)}.`
|
? `OpenCode couldn't finish connecting to ${escapeHtml(provider)}.`
|
||||||
: "opencode couldn't complete authorization.",
|
: "OpenCode couldn't complete authorization.",
|
||||||
detail,
|
detail,
|
||||||
footnote: "Close this window and try again from opencode.",
|
footnote: "Close this window and try again from OpenCode.",
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ function renderDocument(input: { title: string; body: string; script?: string })
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="robots" content="noindex" />
|
<meta name="robots" content="noindex" />
|
||||||
<title>${escapeHtml(input.title)} · opencode</title>
|
<title>${escapeHtml(input.title)} · OpenCode</title>
|
||||||
<style>${STYLES}</style>
|
<style>${STYLES}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -116,8 +116,8 @@ function bootstrapScript(options: BootstrapOptions) {
|
|||||||
var TOKEN_URL=new URL(${scriptString(options.tokenPath)},window.location.origin).href;
|
var TOKEN_URL=new URL(${scriptString(options.tokenPath)},window.location.origin).href;
|
||||||
(function(){
|
(function(){
|
||||||
var card=document.getElementById("oc-card"),headline=document.getElementById("oc-headline"),message=document.getElementById("oc-message"),detail=document.getElementById("oc-detail"),footnote=document.getElementById("oc-footnote");
|
var card=document.getElementById("oc-card"),headline=document.getElementById("oc-headline"),message=document.getElementById("oc-message"),detail=document.getElementById("oc-detail"),footnote=document.getElementById("oc-footnote");
|
||||||
function fail(text){card.dataset.status="error";headline.textContent="Authorization failed";message.textContent=PROVIDER?("opencode couldn't finish connecting to "+PROVIDER+"."):"opencode couldn't complete authorization.";if(text){detail.textContent=text;detail.hidden=false}footnote.textContent="Close this window and try again from opencode."}
|
function fail(text){card.dataset.status="error";headline.textContent="Authorization failed";message.textContent=PROVIDER?("OpenCode couldn't finish connecting to "+PROVIDER+"."):"OpenCode couldn't complete authorization.";if(text){detail.textContent=text;detail.hidden=false}footnote.textContent="Close this window and try again from OpenCode."}
|
||||||
function ok(){card.dataset.status="success";headline.textContent="Authorization successful";message.textContent=PROVIDER?("opencode is now connected to "+PROVIDER+"."):"opencode is now authorized.";detail.hidden=true;footnote.textContent="You can close this window and return to opencode.";setTimeout(function(){try{window.close()}catch(e){}},2500)}
|
function ok(){card.dataset.status="success";headline.textContent="Authorization successful";message.textContent=PROVIDER?("OpenCode is now connected to "+PROVIDER+"."):"OpenCode is now authorized.";detail.hidden=true;footnote.textContent="You can close this window.";setTimeout(function(){try{window.close()}catch(e){}},2500)}
|
||||||
try{
|
try{
|
||||||
var hash=new URLSearchParams((window.location.hash||"").slice(1));
|
var hash=new URLSearchParams((window.location.hash||"").slice(1));
|
||||||
var search=new URLSearchParams(window.location.search||"");
|
var search=new URLSearchParams(window.location.search||"");
|
||||||
@@ -249,8 +249,8 @@ const STYLES = `
|
|||||||
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
|
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
|
||||||
`
|
`
|
||||||
|
|
||||||
// opencode wordmark — same path geometry as packages/ui/src/components/logo.tsx (Logo).
|
// OpenCode wordmark — same path geometry as packages/ui/src/components/logo.tsx (Logo).
|
||||||
const WORDMARK = `<svg class="wordmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 234 42" fill="none" aria-label="opencode" role="img">
|
const WORDMARK = `<svg class="wordmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 234 42" fill="none" aria-label="OpenCode" role="img">
|
||||||
<path d="M18 30H6V18H18V30Z" fill="var(--oc-icon-weak)" />
|
<path d="M18 30H6V18H18V30Z" fill="var(--oc-icon-weak)" />
|
||||||
<path d="M18 12H6V30H18V12ZM24 36H0V6H24V36Z" fill="var(--oc-icon-base)" />
|
<path d="M18 12H6V30H18V12ZM24 36H0V6H24V36Z" fill="var(--oc-icon-base)" />
|
||||||
<path d="M48 30H36V18H48V30Z" fill="var(--oc-icon-weak)" />
|
<path d="M48 30H36V18H48V30Z" fill="var(--oc-icon-weak)" />
|
||||||
|
|||||||
Reference in New Issue
Block a user