Skip to content

Conversation

@kennyderek
Copy link
Contributor

@kennyderek kennyderek commented Nov 6, 2025

  • remembers your selection across endpoints, so no need to keep selecting the dropdown
  • saves the info you entered across endpoints
  • supports href in dropdown descriptions
image

before:

devin-ai-integration bot and others added 7 commits November 6, 2025 16:35
- Add PLAYGROUND_SELECTED_AUTH_INDEX_ATOM to track active auth scheme
- Revert PlaygroundAuthorizationFormCard to accept single auth instead of array
- Update ExplorerContent to render separate card per auth with OR separators
- Add UI controls (Use this method button) to select active auth scheme
- Update all request building code to use selected auth instead of first auth:
  - useSendRequest.ts
  - PlaygroundCodeSnippetResolver
  - PlaygroundEndpoint
  - PlaygroundWebSocket
- Handle OAuth referenced endpoint per-auth instead of just first auth
- Each auth card now has independent open/closed state

Co-Authored-By: [email protected] <[email protected]>
- Remove useAtom from PlaygroundAuthorizationFormCard (server-only)
- Create PlaygroundAuthorizationFormCardSelectButton client component
- Move auth selection logic to client component in PlaygroundAuthorizationFormCardRoot
- Fixes Next.js lint error: client hooks in server-only file

Co-Authored-By: [email protected] <[email protected]>
…ormCardSelectButton

- Remove unused lang parameter to fix ESLint error
- Update call site in PlaygroundAuthorizationFormCard to not pass lang

Co-Authored-By: [email protected] <[email protected]>
- Format PlaygroundAuthorizationFormCardRoot with proper line breaks
- Format ExplorerContent, resolver, PlaygroundEndpoint, PlaygroundWebSocket
- Fixes biome format check errors in CI

Co-Authored-By: [email protected] <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dev.ferndocs.com Ready Ready Preview Nov 9, 2025 7:44pm
fern-dashboard Ready Ready Preview Nov 9, 2025 7:44pm
fern-dashboard-dev Ready Ready Preview Nov 9, 2025 7:44pm
ferndocs.com Ready Ready Preview Nov 9, 2025 7:44pm
preview.ferndocs.com Ready Ready Preview Nov 9, 2025 7:44pm
prod-assets.ferndocs.com Ready Ready Preview Nov 9, 2025 7:44pm
prod.ferndocs.com Ready Ready Preview Nov 9, 2025 7:44pm
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
fern-platform Ignored Ignored Nov 9, 2025 7:44pm

…fy-text.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

The React key is using the character position from the regex match (key={index}), which is an unstable identifier that violates React best practices for list rendering and can cause subtle bugs during re-renders.

View Details
📝 Patch Details
diff --git a/packages/fern-docs/bundle/src/components/playground/auth/linkify-text.tsx b/packages/fern-docs/bundle/src/components/playground/auth/linkify-text.tsx
index ecfef8766..992b053ba 100644
--- a/packages/fern-docs/bundle/src/components/playground/auth/linkify-text.tsx
+++ b/packages/fern-docs/bundle/src/components/playground/auth/linkify-text.tsx
@@ -15,6 +15,7 @@ export function linkifyText(text: string): ReactNode {
     const parts: ReactNode[] = [];
     let lastIndex = 0;
     let match: RegExpExecArray | null;
+    let linkCounter = 0; // Counter for stable keys
 
     // Reset the regex
     URL_REGEX.lastIndex = 0;
@@ -32,7 +33,7 @@ export function linkifyText(text: string): ReactNode {
         const href = url.startsWith("www.") ? `https://${url}` : url;
         parts.push(
             <a
-                key={index}
+                key={linkCounter++}
                 href={href}
                 target="_blank"
                 rel="noopener noreferrer"

Analysis

Unstable React keys cause reconciliation issues in linkifyText function

What fails: linkifyText() in packages/fern-docs/bundle/src/components/playground/auth/linkify-text.tsx uses character positions as React keys (key={index}), which are unstable when text content changes

How to reproduce:

// Test with URLs at different positions:
linkifyText("Check out https://example.com and https://google.com") // keys: 10, 39  
linkifyText("Here https://example.com and https://google.com")      // keys: 5, 35

// Same URLs get different keys, violating React's reconciliation requirements

Result: Same URLs receive different React keys when text content changes, causing React to unnecessarily unmount/remount link elements instead of reusing them

Expected: React keys should be stable across re-renders per React documentation on keys - "Keys should be given to the elements inside the array to give the elements a stable identity"

@fern-support fern-support merged commit b6a8fbb into app Nov 9, 2025
21 checks passed
@fern-support fern-support deleted the kenny/auth-selector-playground branch November 9, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants