Skip to content

feat(board): add Card detail supplement slot - #64

Merged
cnjack merged 1 commit into
mainfrom
codex/card-execution-supplement
Jul 31, 2026
Merged

feat(board): add Card detail supplement slot#64
cnjack merged 1 commit into
mainfrom
codex/card-execution-supplement

Conversation

@cnjack

@cnjack cnjack commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an optional renderCardSupplement(card) public API to @jtype/board-react
  • render host-owned content after native Card Properties/Relations without replacing jtype editing
  • suppress the supplement in read-only and onCardOpen interception modes
  • add an accessible, localized Additional information region and publish package metadata as 0.1.2

Product boundary

This is the minimal jtype-side contract needed for Cloud to show execution receipts inside the Card detail surface. jtype remains the Work Item editor and owner of native Card fields; the host owns only the additive supplement content.

Impact matrix

Surface Behavior
Desktop Optional supplement appears after native editable details
Web Same BoardSurface/BoardPeek path as Desktop
@jtype/board-react New optional prop; omitted prop preserves current behavior
read-only Card view Supplement is not rendered
onCardOpen interception Supplement is not rendered

Verification

  • npm --prefix packages/board-react run build
  • npm --prefix packages/board-react test — 21 unit + 6 embed E2E tests passed
  • npm run i18n:extract
  • npm run i18n:compile
  • npm run build
  • npm --prefix services/jtype-web/frontend run build
  • Kimi CLI adversarial review: NO FINDINGS
  • Grok CLI adversarial review: NO FINDINGS

Summary by CodeRabbit

  • New Features

    • Added an optional card supplement slot for displaying host-provided content in editable card details.
    • Supplements appear below the built-in Properties and Relations sections without replacing native editing.
    • Supplements are omitted for read-only cards and intercepted card opens.
  • Documentation

    • Documented the new configuration option and usage behavior.
  • Tests

    • Added coverage for editable, read-only, intercepted, and default card-detail scenarios.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an optional renderCardSupplement prop to jtype-board-react, forwards host content into editable card details, renders it below native properties and relations, documents the contract, bumps the package to 0.1.2, and adds end-to-end coverage.

Changes

Card supplement integration

Layer / File(s) Summary
Supplement contract and prop wiring
shared/components/board/types.ts, packages/board-react/src/JTypeBoard.tsx, shared/components/board/BoardSurface.tsx
Adds optional supplement callback and React node props, then forwards the callback from JTypeBoard through BoardSurface.
Card detail rendering
shared/components/board/BoardSurface.tsx, shared/components/board/BoardPeek.tsx
Passes the selected card’s supplement to BoardPeek, which conditionally renders an “Additional information” section beneath relations.
Behavior validation and package release
tests/fixtures/board-react-embed.tsx, tests/e2e/board-react-embed.spec.ts, packages/board-react/README.md, docs/implementation-notes/card-execution-supplement.md, packages/board-react/package.json
Adds fixture configuration and coverage for default, editable, read-only, and intercepted opens; documents the prop and releases version 0.1.2.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant JTypeBoard
  participant BoardSurface
  participant BoardPeek
  JTypeBoard->>BoardSurface: Forward renderCardSupplement
  BoardSurface->>BoardPeek: Pass selected card supplement
  BoardPeek->>BoardPeek: Render Additional information
Loading

Possibly related PRs

  • cnjack/jtype#47: Introduced the package and shared board components extended by this change.
  • cnjack/jtype#61: Also modifies shared card-detail component wiring.
  • cnjack/jtype#63: Updated the editable card-detail UI extended with the supplement slot.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a Card detail supplement slot to the board feature.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/card-execution-supplement

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 `@shared/components/board/BoardSurface.tsx`:
- Line 1434: Update the BoardSurface render path around the PeekComponent
supplement prop so renderCardSupplement is invoked and passed only when the
surface is not read-only and onCardOpen is available; otherwise pass no
supplement. Preserve existing selected-card behavior for editable surfaces while
enforcing the shared boundary for all injected PeekComponent callers.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 762271d8-11f8-4200-b366-86a308d98de4

📥 Commits

Reviewing files that changed from the base of the PR and between c2f9d48 and 939d717.

⛔ Files ignored due to path filters (12)
  • packages/board-react/dist/index.d.ts is excluded by !**/dist/**
  • packages/board-react/dist/index.js is excluded by !**/dist/**
  • packages/board-react/example/package-lock.json is excluded by !**/package-lock.json
  • packages/board-react/package-lock.json is excluded by !**/package-lock.json
  • shared/i18n/locales/en/messages.mjs is excluded by !**/i18n/locales/**
  • shared/i18n/locales/en/messages.po is excluded by !**/i18n/locales/**
  • shared/i18n/locales/ja/messages.mjs is excluded by !**/i18n/locales/**
  • shared/i18n/locales/ja/messages.po is excluded by !**/i18n/locales/**
  • shared/i18n/locales/ko/messages.mjs is excluded by !**/i18n/locales/**
  • shared/i18n/locales/ko/messages.po is excluded by !**/i18n/locales/**
  • shared/i18n/locales/zh/messages.mjs is excluded by !**/i18n/locales/**
  • shared/i18n/locales/zh/messages.po is excluded by !**/i18n/locales/**
📒 Files selected for processing (9)
  • docs/implementation-notes/card-execution-supplement.md
  • packages/board-react/README.md
  • packages/board-react/package.json
  • packages/board-react/src/JTypeBoard.tsx
  • shared/components/board/BoardPeek.tsx
  • shared/components/board/BoardSurface.tsx
  • shared/components/board/types.ts
  • tests/e2e/board-react-embed.spec.ts
  • tests/fixtures/board-react-embed.tsx

renderMarkdownToContainer={renderMarkdownToContainer}
renderMarkdownToHtml={renderMarkdownToHtml}
portalClassName={portalClassName}
supplement={renderCardSupplement?.(selected)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Guard the supplement at the shared surface boundary.

BoardSurface passes renderCardSupplement?.(selected) to any injected PeekComponent regardless of readOnly or onCardOpen. The package wrapper currently masks this by omitting PeekComponent, but shared Desktop/Web callers that retain BoardPeek can still render host content in a read-only detail, violating the stated contract.

Proposed fix
-                supplement={renderCardSupplement?.(selected)}
+                supplement={!readOnly && !onCardOpen ? renderCardSupplement?.(selected) : undefined}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
supplement={renderCardSupplement?.(selected)}
supplement={!readOnly && !onCardOpen ? renderCardSupplement?.(selected) : undefined}
🤖 Prompt for 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.

In `@shared/components/board/BoardSurface.tsx` at line 1434, Update the
BoardSurface render path around the PeekComponent supplement prop so
renderCardSupplement is invoked and passed only when the surface is not
read-only and onCardOpen is available; otherwise pass no supplement. Preserve
existing selected-card behavior for editable surfaces while enforcing the shared
boundary for all injected PeekComponent callers.

@cnjack
cnjack merged commit 5dc8b7f into main Jul 31, 2026
3 checks passed
@cnjack
cnjack deleted the codex/card-execution-supplement branch July 31, 2026 03:18
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