Skip to content

[codex] Refresh API demo panel with clearer request sections and stronger live testing controls#105

Merged
basit3407 merged 5 commits intomainfrom
feat/api-demo-panel-refresh
Apr 9, 2026
Merged

[codex] Refresh API demo panel with clearer request sections and stronger live testing controls#105
basit3407 merged 5 commits intomainfrom
feat/api-demo-panel-refresh

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

Summary

  • refresh the shared OpenAPI demo panel so the live request workflow feels first-party instead of stock
  • make environment selection, auth inputs, and required fields easier to scan without changing request semantics
  • add lightweight regression coverage for the new shared demo-panel overrides

What Changed

  • shadowed the shared ApiDemoPanel components for Request, Server, Authorization, ParamOptions, Execute, SecuritySchemes, FormItem, FormTextInput, and FormSelect
  • replaced the server Edit/Hide interaction with an always-visible Environment section and readable URL preview
  • relabeled auth inputs to human-readable names like Access Token and Client ID while keeping the raw header names visible as helper text
  • grouped request inputs into Environment, Authorization, Required Parameters, and Optional Parameters, with optional parameters collapsed by default
  • promoted the Send API Request action so it reads as the primary CTA while preserving the existing validation gate and request execution behavior
  • centralized shared helper logic and styling for labels, helper text, badges, selectors, and request-panel presentation
  • added node:test coverage for the refreshed headings, auth label mapping, and primary execute CTA

Why

The interactive docs were already functional, but the try-it experience still reflected the stock theme behavior:

  • environment selection was hidden behind an extra edit toggle
  • raw technical header names were shown directly in primary auth inputs
  • required and optional request fields were not grouped clearly
  • the primary request action did not stand out enough for the main developer flow

This change keeps the underlying request-building and execution logic intact while making the docs easier for developers to use.

Impact

  • developers get a clearer live-testing experience across all API groups, not just one spec family
  • there are no API contract changes, no schema changes, and no changes to request-building, auth semantics, or code-sample generation
  • the override code also removes some duplicated handler logic without changing behavior

Validation

  • node --test tests\\api-demo-panel-ui.test.cjs tests\\prelive-docs-config.test.cjs tests\\user-related-env-paths.test.cjs tests\\user-related-env-ui.test.cjs
  • NO_UPDATE_NOTIFIER=1 npx docusaurus build

Authored by Basit Minhas.

@basit3407 basit3407 marked this pull request as ready for review April 1, 2026 09:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9efad07980

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/theme/ApiDemoPanel/ParamOptions/index.tsx Outdated
Comment thread src/theme/ApiDemoPanel/FormSelect/index.tsx Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 1, 2026

Deploying qf-api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fa5796
Status: ✅  Deploy successful!
Preview URL: https://3df8854a.qf-api-docs.pages.dev
Branch Preview URL: https://feat-api-demo-panel-refresh.qf-api-docs.pages.dev

View logs

@quran quran deleted a comment from osamasayed Apr 1, 2026
@quran quran deleted a comment from osamasayed Apr 1, 2026
@basit3407
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4276ba8a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/theme/ApiDemoPanel/Server/index.tsx Outdated
Comment thread src/theme/ApiDemoPanel/Execute/index.tsx
@basit3407
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdf395aa40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/theme/ApiDemoPanel/Server/index.tsx
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refreshes the shared Docusaurus OpenAPI ApiDemoPanel (request “try it” UI) by swizzling multiple theme components to present clearer request sections (Environment/Auth/Params) and a more prominent execute control, while adding lightweight regression checks for the overrides.

Changes:

  • Added swizzled ApiDemoPanel UI components (Request/Server/Auth/Params/Execute/etc.) plus shared styling/utilities to improve scanability and UX.
  • Reworked server selection into an always-visible “Environment” section with a URL preview and server-variable inputs.
  • Added node:test coverage asserting key headings/labels/CTA text and a few behavioral guardrails.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/api-demo-panel-ui.test.cjs Adds regression tests that assert the presence of the new headings/labels/CTA and a few key UI behaviors via source inspection.
src/theme/ApiDemoPanel/utils.ts Centralizes label/formatting helpers for auth/server display, plus select option normalization.
src/theme/ApiDemoPanel/shared.module.css Introduces shared styles for the refreshed request panel layout, fields, and primary action presentation.
src/theme/ApiDemoPanel/Request/index.tsx Updates the request panel summary and embeds the primary execute CTA in the summary row.
src/theme/ApiDemoPanel/Server/index.tsx Implements the new “Environment” section with server selection, URL preview, and server variable editors.
src/theme/ApiDemoPanel/Authorization/index.tsx Implements the “Authorization” section with human-readable field labeling and helper text.
src/theme/ApiDemoPanel/ParamOptions/index.tsx Groups params into required vs optional sections, collapses optional by default, and adds array/enum handling UI.
src/theme/ApiDemoPanel/ParamOptions/styles.module.css Adds styles for the optional toggle and array item controls.
src/theme/ApiDemoPanel/Execute/index.tsx Promotes a primary “Send API Request” button and preserves a validation gate to disable execution.
src/theme/ApiDemoPanel/SecuritySchemes/index.tsx Adds an “Authentication Details” disclosure panel for the selected scheme(s).
src/theme/ApiDemoPanel/FormItem/index.tsx Adds a shared field wrapper with label/type/required badge and helper/description text.
src/theme/ApiDemoPanel/FormTextInput/index.tsx Adds a shared text input with consistent styling and placeholder sanitization.
src/theme/ApiDemoPanel/FormSelect/index.tsx Adds a shared select component with normalized options and consistent styling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/theme/ApiDemoPanel/ParamOptions/index.tsx
Comment thread src/theme/ApiDemoPanel/ParamOptions/index.tsx
@basit3407
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7499cf367c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/theme/ApiDemoPanel/utils.ts
@basit3407
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@basit3407 basit3407 requested a review from osamasayed April 1, 2026 15:13
@basit3407 basit3407 merged commit 89e2463 into main Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants