Skip to content

fix(api): dispatch optional data-first calls - #113

Merged
lloydrichards merged 1 commit into
mainfrom
codex/fix-optional-data-first
Sep 6, 2026
Merged

lloydrichards merged 1 commit into
mainfrom
codex/fix-optional-data-first

Conversation

@lloydrichards

@lloydrichards lloydrichards commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Goal and scope

Restore the advertised data-first behavior for dual APIs with optional trailing arguments. Data-last calls must remain unchanged.

Description

Uses runtime input predicates for Box padding, borders, and Renderer helpers instead of treating optional arguments as required arity.

How to test

  • Run bun run --cwd packages/effect-boxes test tests/optional-data-first.test.ts.
  • Check omitted and supplied options in both data-first and piped forms.

Review

  • Gatekeeping: Check correctness, tests, quality, and design before merge.
  • Knowledge sharing: Quick intent and implementation review; light feedback is enough.
  • Pair session: Review the remaining decisions together.

Closes #94

@vercel

vercel Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
effect-boxes-docs Ready Ready Preview Sep 6, 2026 8:10am UTC

@changeset-bot

changeset-bot Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 38dfcbb

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

This PR includes changesets to release 1 package
Name Type
effect-boxes 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

Copilot AI 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.

🟢 Approval recommended

The predicate-based dual dispatch fixes the reported runtime misbehavior and is backed by focused regression tests covering both data-first and data-last usage.

Pull request overview

Restores correct runtime behavior for Effect dual APIs when called data-first with omitted optional trailing arguments, aligning runtime return values with the published overloads for Box and Renderer.

Changes:

  • Switch dual implementations for Box.border, Box.pad, Renderer.render, and Renderer.renderLinesToString from fixed arity to runtime input predicates to properly detect data-first calls.
  • Add regression tests covering omitted/supplied options for both data-first and piped (data-last) forms.
  • Add a patch changeset documenting the fix.
File summaries
File Description
packages/effect-boxes/tests/optional-data-first.test.ts Adds regression coverage for optional data-first calls and ensures data-last piping remains intact.
packages/effect-boxes/src/internal/renderer.ts Updates dual dispatch for render and renderLinesToString to use runtime predicates.
packages/effect-boxes/src/internal/box.ts Updates dual dispatch for border and pad to use runtime predicates.
.changeset/floppy-birds-battle.md Documents the patch-level behavior fix for optional data-first calls.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/effect-boxes/src/internal/renderer.ts Outdated
@lloydrichards
lloydrichards force-pushed the codex/fix-optional-data-first branch from d379506 to 38dfcbb Compare September 6, 2026 08:08
@lloydrichards
lloydrichards merged commit fb07cfe into main Sep 6, 2026
3 of 4 checks passed
@lloydrichards
lloydrichards deleted the codex/fix-optional-data-first branch September 6, 2026 08:13
@github-actions github-actions Bot mentioned this pull request Sep 6, 2026

This branch was successfully deployed

1 active deployment
Preview — 38dfcbbe Deployed Sep 6, 2026 by vercel[bot]
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.

fix(box,renderer): optional data-first calls return functions

2 participants