Skip to content

feat(web): fill example-gallery gaps for uncovered library features#98

Merged
desko27 merged 1 commit into
mainfrom
feat/web-gallery-examples
May 30, 2026
Merged

feat(web): fill example-gallery gaps for uncovered library features#98
desko27 merged 1 commit into
mainfrom
feat/web-gallery-examples

Conversation

@desko27
Copy link
Copy Markdown
Owner

@desko27 desko27 commented May 30, 2026

What & why

Audited the gallery against the README and found library features with no live example. This fills those gaps and surfaces a couple that were under-demonstrated.

New examples

Example README feature Demonstrates
Account-aware dialog (root-context) Passing Root props call.root.userName flowing from <Greeter userName="…" />
Confirm with optional async (optional-mutation) Optional mutationFn + .orEnd() same Callable: no handler → instant fallback; with handler → pending → close
Resolve from the caller (caller-resolve) End from caller a timeout settles the open call via Approval.end(promise, false)
Broadcast to every call (broadcast-update) update(props) with no promise one broadcast merges into all open pills, each keeping its own label

Edits to existing examples

  • Settings drawer and Bottom sheet: real exit animations via the unmountingDelay second arg + call.ended (slide-in on mount, slide-out on close), with notes.

Infra / supporting changes

  • Optional rootProps field on ExampleMeta, threaded through the generated App.tsx (code-marks) and the CodeSandbox export (PlaygroundButton) so a Root-props example actually shows where the prop is passed. Unit tests updated.
  • New behavior tags: exit-animation, root-props, end-from-caller.
  • Dropped the redundant "Behaviors" label from the gallery filter row (the pills are self-describing).

Verification

  • code-marks unit tests pass (21); biome clean; astro build generates all 21 example routes; pre-commit tsc -b + lint green.
  • Manually exercised all six changes in the dev preview (Root-props rendering + generated App block, both .orEnd/handler paths, timeout + manual approval, broadcast merge across a stack, drawer/sheet enter+exit).

Follow-up (separate)

While building broadcast-update I hit a library behavior worth a look: calling X.end() (end-all) and then X.call() in the same synchronous tick leaves the new calls unrendered. The example's caller was written to avoid that pattern; flagged for investigation in packages/react-call separately. — Fixed in #96

Add gallery examples for README features that had no live demo:

- Root props (call.root) — "Account-aware dialog" (root-context)
- Optional mutationFn + .orEnd() — "Confirm with optional async" (optional-mutation)
- End from caller, end(promise, value) — "Resolve from the caller" (caller-resolve)
- Broadcast update, update(props) to all — "Broadcast to every call" (broadcast-update)

Add exit animations (unmountingDelay + call.ended) to the side-drawer and
bottom-sheet examples, with explanatory notes.

Infra: support Root-props examples in the generated App.tsx and CodeSandbox
export via an optional rootProps meta field; add exit-animation, root-props
and end-from-caller behavior tags; drop the redundant "Behaviors" filter label.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

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

Project Deployment Actions Updated (UTC)
react-call Ready Ready Preview, Comment May 30, 2026 11:51pm

@desko27 desko27 merged commit fbcaa76 into main May 30, 2026
8 checks passed
@desko27 desko27 deleted the feat/web-gallery-examples branch May 30, 2026 23:55
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.

1 participant