Skip to content

Add Try it, Samples and Connections to the local viewer - #14

Merged
Manasa-uigraph merged 1 commit into
mainfrom
feat/local-try-it-samples-connections
Oct 22, 2026
Merged

Manasa-uigraph merged 1 commit into
mainfrom
feat/local-try-it-samples-connections

Conversation

@TheoBen880

@TheoBen880 TheoBen880 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

This PR adds the Try it, Samples and Connections tabs to the endpoint panel in the local viewer. The tabs work the same as in the cloud app. Linear: UIG-249 (testing: UIG-250).

Before and after

Before: The endpoint panel showed only the spec. There was no way to send a request, keep samples, or see which maps use an endpoint.

After: REST endpoints have Spec, Try it, Samples and Connections. GraphQL and gRPC endpoints have Spec, Samples and Connections, the same as cloud.

/Users/sayad/Desktop/uigraph/starter/.playwright/uig-249/proof.mp4

Risk

The change touches the API & Behavior panel and how endpoints load. Endpoints now get request and response examples from the spec, so the Spec tab can show examples that it did not show before. Saved samples go to ~/.uigraph/api-samples/<endpoint id>. A revert removes the tabs but does not delete these files.

Product guarantees: Try it sends requests to the user's own APIs when the user clicks Send. This is an outbound call, and it can change data on that API. That touches guarantee 1 ("does not execute") and guarantee 4 ("no outbound calls without discussion") in CONTRIBUTING.md. The ticket asks for this behavior, but a maintainer must agree to it.

Evidence

  • Try it: a local echo server returned 201. https://httpbin.org/bearer returned 200 with the token from Authorize.
  • Samples: save, delete, and a reset after a spec change all work (see the video).
  • I ran the cloud parser and the new local code on the same REST, GraphQL and gRPC specs. The seeded samples were identical for all 11 endpoints.
  • I did not compare the result side by side with the cloud app in a browser.

What changed

New features

  • Try it with Authorize, copied from cloud. The request goes straight from the browser to the API, the same as cloud.
  • Samples: seeded from the spec with the cloud logic. Changes save to ~/.uigraph/api-samples/<endpoint id>. When the spec changes, the samples reset from the spec, as a new upload does in cloud.
  • Connections: shows the maps, screens and focal points that link to an endpoint, diagram or doc.

Not included: the Meta tab, Try it for GraphQL and gRPC (cloud does not have it), and test pack links in Connections (local test packs never link).

How to test

  1. Add an OpenAPI spec with a servers URL to .uigraph.yaml and open the viewer.
  2. Open an endpoint, click Try it, then Send, then Save Response.
  3. Open Samples, then Connections.

Checklist

  • pnpm typecheck && pnpm lint && pnpm build pass
  • Tests added or updated where behavior changed
  • Docs updated if user-facing behavior changed
  • Does not weaken a product guarantee in CONTRIBUTING.md (or the PR explains why)
proof.mp4

@Manasa-uigraph
Manasa-uigraph merged commit 5d073a1 into main Oct 22, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants