feat(board): add Card detail supplement slot - #64
Conversation
📝 WalkthroughWalkthroughAdds an optional ChangesCard supplement integration
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (12)
packages/board-react/dist/index.d.tsis excluded by!**/dist/**packages/board-react/dist/index.jsis excluded by!**/dist/**packages/board-react/example/package-lock.jsonis excluded by!**/package-lock.jsonpackages/board-react/package-lock.jsonis excluded by!**/package-lock.jsonshared/i18n/locales/en/messages.mjsis excluded by!**/i18n/locales/**shared/i18n/locales/en/messages.pois excluded by!**/i18n/locales/**shared/i18n/locales/ja/messages.mjsis excluded by!**/i18n/locales/**shared/i18n/locales/ja/messages.pois excluded by!**/i18n/locales/**shared/i18n/locales/ko/messages.mjsis excluded by!**/i18n/locales/**shared/i18n/locales/ko/messages.pois excluded by!**/i18n/locales/**shared/i18n/locales/zh/messages.mjsis excluded by!**/i18n/locales/**shared/i18n/locales/zh/messages.pois excluded by!**/i18n/locales/**
📒 Files selected for processing (9)
docs/implementation-notes/card-execution-supplement.mdpackages/board-react/README.mdpackages/board-react/package.jsonpackages/board-react/src/JTypeBoard.tsxshared/components/board/BoardPeek.tsxshared/components/board/BoardSurface.tsxshared/components/board/types.tstests/e2e/board-react-embed.spec.tstests/fixtures/board-react-embed.tsx
| renderMarkdownToContainer={renderMarkdownToContainer} | ||
| renderMarkdownToHtml={renderMarkdownToHtml} | ||
| portalClassName={portalClassName} | ||
| supplement={renderCardSupplement?.(selected)} |
There was a problem hiding this comment.
🎯 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.
| 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.
Summary
renderCardSupplement(card)public API to@jtype/board-reactonCardOpeninterception modesAdditional informationregion and publish package metadata as 0.1.2Product 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
@jtype/board-reactonCardOpeninterceptionVerification
npm --prefix packages/board-react run buildnpm --prefix packages/board-react test— 21 unit + 6 embed E2E tests passednpm run i18n:extractnpm run i18n:compilenpm run buildnpm --prefix services/jtype-web/frontend run buildSummary by CodeRabbit
New Features
Documentation
Tests