Skip to content

feat(core): EndArgs — omit dismiss response when void - #51

Merged
SutuSebastian merged 7 commits into
mainfrom
feat/end-args-void-ergonomics
Aug 8, 2026
Merged

feat(core): EndArgs — omit dismiss response when void#51
SutuSebastian merged 7 commits into
mainfrom
feat/end-args-void-ergonomics

Conversation

@SutuSebastian

@SutuSebastian SutuSebastian commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add EndArgs / ResponseArgTuple so call.end/dismiss, stack dismiss/dismissAll/cancelQueued, and handle dismiss/cancelQueued omit the response when undefined extends R (twin of PayloadArg).
  • Type-tighten LayerHandle.dismiss/cancelQueued (no longer always-optional).
  • Docs, skills, architecture, progress recipes, and a patch changeset aligned.

Test plan

  • bun test packages/core/src (incl. void call.end() / dismissAll())
  • bun run --filter ./packages/core typecheck (EndArgs matrix + handle tighten)
  • bun run docs:validate -- --strict
  • CI green on PR

Summary by CodeRabbit

  • Improvements

    • Void-returning layers can now be ended, dismissed, bulk-dismissed, or cancelled without passing an explicit undefined.
    • Responses remain required when a layer expects a specific value, such as a boolean.
    • Dismissal options and force behavior continue to work as before.
  • Documentation

    • Updated API references, migration guidance, examples, and progress recipes to reflect the simpler response handling.
  • Tests

    • Added coverage for optional and required dismissal responses.

Omit call/stack/handle dismiss response when undefined extends R
(twin of PayloadArg). Tightens LayerHandle always-optional hole;
docs, skills, and changeset aligned.
@SutuSebastian SutuSebastian added the docs Merged PRs with this label deploy the /layers docs site label Aug 8, 2026
@changeset-bot

changeset-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73c9248

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@stainless-code/layers Patch
@stainless-code/alpine-layers Patch
@stainless-code/angular-layers Patch
@stainless-code/layers-devtools Patch
@stainless-code/lit-layers Patch
@stainless-code/preact-layers Patch
@stainless-code/react-layers-devtools Patch
@stainless-code/react-layers Patch
@stainless-code/solid-layers Patch
@stainless-code/svelte-layers Patch
@stainless-code/vue-layers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SutuSebastian, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 93bdcf35-43f3-4ee9-a608-ad4b2e85b4c9

📥 Commits

Reviewing files that changed from the base of the PR and between cffb7af and 73c9248.

📒 Files selected for processing (15)
  • .agents/skills/harden-pr/LEDGER.md
  • .changeset/end-args-void-ergonomics.md
  • apps/docs/content/guides/dismissal-blockers.mdx
  • apps/docs/content/guides/error-handling.mdx
  • apps/docs/content/reference/core-api.mdx
  • packages/angular/skills/angular-layers/SKILL.md
  • packages/core/skills/layers/SKILL.md
  • packages/core/src/createLayer.test.ts
  • packages/core/src/createLayer.ts
  • packages/core/src/layerStack.ts
  • packages/core/src/types.ts
  • packages/preact/skills/preact-layers/SKILL.md
  • packages/solid/skills/solid-layers/SKILL.md
  • packages/svelte/skills/svelte-layers/SKILL.md
  • packages/vue/skills/vue-layers/SKILL.md
📝 Walkthrough

Walkthrough

The PR adds conditional argument tuples for layer completion and dismissal APIs. Responses can be omitted when R admits undefined. Runtime handling, type tests, documentation, migration guidance, and progress examples use the new contracts.

Changes

Conditional dismissal arguments

Layer / File(s) Summary
Argument tuple contracts
packages/core/src/types.ts
Adds EndArgs, DismissAllArgs, CancelQueuedArgs, and HandleDismissArgs. Response arguments are conditional on whether R admits undefined.
Runtime dismissal flow
packages/core/src/callContext.ts, packages/core/src/createLayer.ts, packages/core/src/layerStack.ts
Updates call contexts, handles, stack dismissal, bulk dismissal, and queued cancellation to use variadic arguments and normalized responses.
Type and runtime validation
packages/core/src/index.test-d.ts, packages/core/src/callContext.test.ts, packages/core/src/layerStack.test.ts
Tests omitted responses for void layers and required responses for boolean layers.
Documentation and examples
apps/docs/**, docs/architecture.md, packages/core/skills/layers/SKILL.md, packages/react/skills/react-layers/SKILL.md, .changeset/end-args-void-ergonomics.md
Documents conditional response arguments and removes explicit undefined values from progress and dismissal examples.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main EndArgs change, although it does not mention all affected APIs such as dismissAll and cancelQueued.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/end-args-void-ergonomics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/reference/core-api.mdx`:
- Line 198: Update the teardown sentence in the core API reference to state that
a layer’s open() promise resolves with R when dismissed by the user, while
LayerStack.dismiss returns Promise<boolean> and dismissAll returns
Promise<void>. Keep the LayerCancelledError behavior for system teardown and the
existing error-handling reference unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f2d96c8-2984-46ba-9922-92da24fac89b

📥 Commits

Reviewing files that changed from the base of the PR and between cfb4afb and cffb7af.

📒 Files selected for processing (23)
  • .changeset/end-args-void-ergonomics.md
  • apps/docs/content/concepts/blockers.mdx
  • apps/docs/content/concepts/overview.mdx
  • apps/docs/content/guides/dismissal-blockers.mdx
  • apps/docs/content/reference/core-api.mdx
  • apps/docs/content/reference/migration.mdx
  • apps/docs/recipes/progress/angular.ts
  • apps/docs/recipes/progress/preact.tsx
  • apps/docs/recipes/progress/react.tsx
  • apps/docs/recipes/progress/solid.tsx
  • apps/docs/recipes/progress/svelte-runes.svelte
  • apps/docs/recipes/progress/svelte-store.svelte
  • apps/docs/recipes/progress/vue-host.vue
  • docs/architecture.md
  • packages/core/skills/layers/SKILL.md
  • packages/core/src/callContext.test.ts
  • packages/core/src/callContext.ts
  • packages/core/src/createLayer.ts
  • packages/core/src/index.test-d.ts
  • packages/core/src/layerStack.test.ts
  • packages/core/src/layerStack.ts
  • packages/core/src/types.ts
  • packages/react/skills/react-layers/SKILL.md

Comment thread apps/docs/content/reference/core-api.mdx Outdated
@SutuSebastian
SutuSebastian merged commit 4d41e57 into main Aug 8, 2026
15 of 17 checks passed
@SutuSebastian
SutuSebastian deleted the feat/end-args-void-ergonomics branch August 8, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Merged PRs with this label deploy the /layers docs site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant