Skip to content

Commit 2ecd0a2

Browse files
aditya520claude
andcommitted
fix(dev-hub): unbreak playground price feeds, format toggle, and api key copy
- Swap Pyth Pro symbols URL to the CORS-enabled history endpoint so the Price Feeds panel renders instead of "Failed to fetch". - Add isolation: isolate to SingleToggleGroup's toggle button so the selected-state bubble paints inside its own stacking context, fixing the invisible JSON/Binary pill in both dark and light mode. - Rewrite the API-key hint to invite users to paste their own key for unlimited streams, acknowledge the rate-limited shared demo token, and confirm "never stored" only when relevant. Bumps hint to 14px. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 41ed9e2 commit 2ecd0a2

6 files changed

Lines changed: 23 additions & 16 deletions

File tree

apps/developer-hub/src/components/Pages/PlaygroundPage/PlaygroundContent.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { Play, Stop } from "@phosphor-icons/react/dist/ssr";
44
import { Button } from "@pythnetwork/component-library/Button";
5-
import { Callout } from "fumadocs-ui/components/callout";
65
import { useCallback, useMemo, useRef } from "react";
76
import { AccessTokenInput } from "../../Playground/AccessTokenInput";
87
import { ChainSelector } from "../../Playground/ChainSelector";
@@ -68,14 +67,11 @@ export function PlaygroundContent() {
6867
<div className={styles.playground}>
6968
<section className={styles.header}>
7069
<div className={styles.headerContent}>
71-
<h1 className={styles.title}>Pyth Pro Playground</h1>
70+
<h1 className={styles.title}>Pyth Playground</h1>
7271
<p className={styles.subtitle}>
7372
Configure subscription parameters, generate code, and test real-time
7473
price streams.
7574
</p>
76-
<Callout className={styles.disclaimer} type="warning">
77-
This playground is for internal preview only and may contain bugs.
78-
</Callout>
7975
</div>
8076
</section>
8177

apps/developer-hub/src/components/Pages/PlaygroundPage/index.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

3232
.title {
33-
@include theme.text("2xl", "semibold");
33+
@include theme.text("4xl", "semibold");
3434

3535
line-height: 120%;
3636
letter-spacing: theme.letter-spacing("tight");
@@ -39,7 +39,7 @@
3939
}
4040

4141
.subtitle {
42-
@include theme.text("sm", "normal");
42+
@include theme.text("lg", "normal");
4343

4444
line-height: 140%;
4545
color: theme.color("paragraph");

apps/developer-hub/src/components/Playground/AccessTokenInput/index.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
}
5151

5252
.hint {
53-
@include theme.text("xs", "normal");
53+
@include theme.text("sm", "normal");
5454

55+
line-height: 1.4;
5556
color: theme.color("muted");
5657
}

apps/developer-hub/src/components/Playground/AccessTokenInput/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ export function AccessTokenInput({ className }: AccessTokenInputProps) {
4848
onChange={(event) => {
4949
updateConfig({ accessToken: event.target.value });
5050
}}
51-
placeholder="Leave empty to use demo token (rate limited)"
51+
placeholder="Paste your API key for unlimited streams (optional)"
5252
type="password"
5353
value={config.accessToken}
5454
/>
5555
</div>
5656

57-
{isUsingDemoToken && (
58-
<span className={styles.hint}>
59-
Using demo token (rate limited for testing)
60-
</span>
61-
)}
57+
<span className={styles.hint}>
58+
{isUsingDemoToken
59+
? "Using a shared demo token — rate-limited for fair use. Paste your own API key for unlimited streams."
60+
: "Using your API key — no rate limits. Sent only to authorize your stream; never stored."}
61+
</span>
6262
</div>
6363
</div>
6464
);

apps/developer-hub/src/components/Playground/types.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export type PriceFeedProperty =
2626
| "feedUpdateTimestamp";
2727

2828
// Update channel options
29-
export type Channel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms";
29+
export type Channel =
30+
| "real_time"
31+
| "fixed_rate@50ms"
32+
| "fixed_rate@200ms"
33+
| "fixed_rate@1000ms";
3034

3135
// Price feed data from the symbols API
3236
export type PriceFeed = {
@@ -144,6 +148,11 @@ export const CHANNEL_OPTIONS: {
144148
id: "fixed_rate@200ms",
145149
label: "Fixed 200ms",
146150
},
151+
{
152+
description: "Updates every 1 second",
153+
id: "fixed_rate@1000ms",
154+
label: "Fixed 1000ms",
155+
},
147156
];
148157

149158
// Code language options for the code preview
@@ -186,4 +195,4 @@ export const PYTH_PRO_ENDPOINTS = [
186195

187196
// API endpoint for symbols
188197
export const SYMBOLS_API_URL =
189-
"https://pyth.dourolabs.app/v1/symbols";
198+
"https://history.pyth-lazer.dourolabs.app/history/v1/symbols";

packages/component-library/src/SingleToggleGroup/index.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
.toggleButton {
99
position: relative;
10+
isolation: isolate;
1011

1112
.bubble {
1213
position: absolute;

0 commit comments

Comments
 (0)