Skip to content

fix(typecheck): declare Ink JSX intrinsics - #1571

Merged
kevincodex1 merged 1 commit into
Twigpine:mainfrom
chioarub:codex/typecheck-ink-jsx-intrinsics
Jun 10, 2026
Merged

kevincodex1 merged 1 commit into
Twigpine:mainfrom
chioarub:codex/typecheck-ink-jsx-intrinsics

Conversation

@chioarub

@chioarub chioarub commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Addresses part of #1486 by declaring the custom Ink host elements used by the internal renderer.

  • moves the Ink host element declarations into React's JSX namespace for the react-jsx runtime
  • adds declarations for ink-link and ink-raw-ansi in addition to the existing Ink host nodes
  • gives the commonly-used ink-box/ink-text props lightweight types based on the existing Ink DOM, style, and event types

Duplicate PR check

Checked all open PR files in Gitlawb/openclaude before opening this branch. The only nearby overlap was #1562 on src/global.d.ts; this branch edits src/ink/global.d.ts and handles a separate Ink JSX intrinsic-element cluster.

Validation

Ran bun run typecheck on this branch.

  • Ink JSX intrinsic diagnostics: 11 -> 0
  • total src/ diagnostics: 1043 -> 1032

Summary by CodeRabbit

  • Refactor
    • Enhanced TypeScript type definitions for Ink UI components, providing improved IDE autocomplete and type checking for terminal user interface development.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0043b6b1-f0cb-46a8-9834-498a6081e200

📥 Commits

Reviewing files that changed from the base of the PR and between 9e942da and cdedf81.

📒 Files selected for processing (1)
  • src/ink/global.d.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: smoke-and-tests
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/ink/global.d.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/ink/global.d.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes fix: skip assertMinVersion for third-party providers #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/ink/global.d.ts
🔇 Additional comments (4)
src/ink/global.d.ts (4)

1-6: LGTM!


8-30: LGTM!


32-50: LGTM!


52-56: LGTM!


📝 Walkthrough

Walkthrough

This PR strengthens TypeScript type safety for Ink JSX intrinsic elements by replacing generic Record<string, unknown> stubs with precise prop type definitions for ink-box, ink-text, ink-link, and ink-raw-ansi. Types are consolidated and wired into React's JSX namespace.

Changes

Ink JSX Intrinsic Element Typing

Layer / File(s) Summary
Type imports and setup
src/ink/global.d.ts
React and Ink internal type definitions (DOM refs, events, styles) are imported to support element prop typing.
Core element prop types
src/ink/global.d.ts
InkBoxElementProps and InkTextElementProps define precise props including refs, children, styles, interaction handlers, and Ink-specific attributes like stickyScroll and textStyles.
Additional element props and consolidation
src/ink/global.d.ts
InkLinkElementProps and InkRawAnsiElementProps are defined, then all Ink elements are consolidated into InkIntrinsicElements union type with ink-root and ink-virtual-text as generic records.
React JSX module augmentation
src/ink/global.d.ts
React's JSX.IntrinsicElements is extended to include InkIntrinsicElements, making all Ink element types available in JSX without namespace wrapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the Summary section and includes validation results, but omits the Impact and Testing sections required by the template. Add Impact section (user-facing and developer/maintainer impact) and Testing section with checkboxes for build/smoke/typecheck validation.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(typecheck): declare Ink JSX intrinsics' accurately and concisely describes the main change: declaring Ink JSX intrinsic elements to resolve type-checking issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Risk Surface Disclosed ✅ Passed PR modifies only TypeScript type declarations for Ink JSX elements. No changes to auth, permissions, networking, config, or other risky surface areas.
No Hidden Policy Change ✅ Passed PR contains only TypeScript type definitions for Ink JSX intrinsics in src/ink/global.d.ts. No product, trust-model, routing, telemetry, or permission-policy changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution. I do not see any actionable issues from my review.

@kevincodex1 LGTM

@kevincodex1
kevincodex1 merged commit 38b2d83 into Twigpine:main Jun 10, 2026
3 checks passed
@chioarub
chioarub deleted the codex/typecheck-ink-jsx-intrinsics branch June 10, 2026 05:57
deagwon97 pushed a commit to deagwon97/openclaude that referenced this pull request Jun 11, 2026
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.

3 participants