Skip to content

docs(adr): 0004 — chat-react debug frames package shape (#84)#85

Merged
beeeku merged 2 commits into
masterfrom
docs/adr-0004-chat-react-debug-frames
Apr 19, 2026
Merged

docs(adr): 0004 — chat-react debug frames package shape (#84)#85
beeeku merged 2 commits into
masterfrom
docs/adr-0004-chat-react-debug-frames

Conversation

@beeeku
Copy link
Copy Markdown
Owner

@beeeku beeeku commented Apr 19, 2026

ADR 0004 picks option (b): ship useChatDebugFrames as a new @workkit/chat-react package, not a subpath of @workkit/chat (a) and not a type-only export (c). Rationale is pinned on constitution rule 4 and the runtime-concern separation the rest of the monorepo already uses (mail/notify, ai-gateway/agent).

Design-only, no implementation. Implementation remains help-wanted on #84.

Summary by CodeRabbit

  • Documentation
    • Added architecture decision record detailing the design and planned public API for a new React debugging hook package.

Decision record for issue #84: ship useChatDebugFrames as a new
@workkit/chat-react package rather than a subpath of @workkit/chat or a
type-only export. Design-only — implementation remains help-wanted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 19, 2026 10:48
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@beeeku has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 2 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 51 minutes and 2 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74def991-244a-4432-85c1-09a4e5cf2224

📥 Commits

Reviewing files that changed from the base of the PR and between f1a7ad4 and f110f56.

📒 Files selected for processing (1)
  • adr/0004-chat-react-debug-frames-package-shape.md
📝 Walkthrough

Walkthrough

A new Architecture Decision Record (ADR) is added documenting the package shape and design rationale for introducing the useChatDebugFrames React hook. The ADR distinguishes server-side frame observability from client-side debugging needs, evaluates three architectural patterns, selects a new @workkit/chat-react package, and specifies peerDependencies, workspace integration, and explicit scope boundaries.

Changes

Cohort / File(s) Summary
ADR Documentation
adr/0004-chat-react-debug-frames-package-shape.md
New architectural decision record establishing the package shape for @workkit/chat-react, distinguishing server vs. client-side frame observability, justifying the new package approach, specifying React >=18 and @workkit/chat peerDependencies, defining turbo/release workspace integration, documenting v1 public API surface (useChatDebugFrames), and explicitly excluding styled UI, replay/time-travel, production telemetry, and environment-based mounting guards.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

🐰 A frame of clarity, a path crystal clear,
A new package born, the design sincere,
React hooks dance where the debug frames appear,
Server and client in balance here,
Architecture decided—the vision's frontier! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding ADR 0004 that documents the package shape decision for the chat-react debug frames feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/adr-0004-chat-react-debug-frames

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

Package Base PR Delta
@workkit/agent 68KiB 68KiB no change
@workkit/ai 91KiB 91KiB no change
@workkit/ai-gateway 215KiB 215KiB no change
@workkit/api 119KiB 119KiB no change
@workkit/approval 106KiB 106KiB no change
@workkit/astro 18KiB 18KiB no change
@workkit/auth 48KiB 48KiB no change
@workkit/browser 31KiB 31KiB no change
@workkit/cache 39KiB 39KiB no change
@workkit/chat 36KiB 36KiB no change
@workkit/cli 312KiB 312KiB no change
@workkit/cron 68KiB 68KiB no change
@workkit/crypto 40KiB 40KiB no change
@workkit/d1 90KiB 90KiB no change
@workkit/do 58KiB 58KiB no change
@workkit/env 43KiB 43KiB no change
@workkit/errors 40KiB 40KiB no change
@workkit/features 23KiB 23KiB no change
@workkit/health 19KiB 19KiB no change
@workkit/hono 36KiB 36KiB no change
@workkit/kv 52KiB 52KiB no change
@workkit/logger 24KiB 24KiB no change
@workkit/mail 39KiB 39KiB no change
@workkit/mcp 127KiB 127KiB no change
@workkit/memory 41KiB 41KiB no change
@workkit/notify 270KiB 270KiB no change
@workkit/pdf 36KiB 36KiB no change
@workkit/queue 54KiB 54KiB no change
@workkit/r2 57KiB 57KiB no change
@workkit/ratelimit 51KiB 51KiB no change
@workkit/remix 34KiB 34KiB no change
@workkit/testing 114KiB 114KiB no change
@workkit/turnstile 14KiB 14KiB no change
@workkit/types 21KiB 21KiB no change
@workkit/workflow 46KiB 46KiB no change

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds ADR 0004 documenting the accepted decision to ship useChatDebugFrames as a new @workkit/chat-react package (instead of a @workkit/chat/react subpath export or a type-only export), aligning with the monorepo’s runtime-separation principles.

Changes:

  • Introduces ADR 0004 capturing the decision, rationale, and alternatives for the useChatDebugFrames package shape.
  • Defines intended consequences (package layout, dependency approach, and v1 API surface) for a future implementation tracked in #84.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +109 to +111
- `peerDependencies`: `react >= 18`, `@workkit/chat: workspace:*`.
`peerDependenciesMeta.react.optional: false` (React is required; the
package is useless without it).
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

The ADR is internally inconsistent about how @workkit/chat-react depends on @workkit/chat: option (b) describes @workkit/chat as a dependencies entry, but this section lists it under peerDependencies. Please pick one (dependency vs peerDependency) and make the wording consistent throughout, ideally aligning with existing cross-package patterns in the repo (e.g., @workkit/notify uses @workkit/mail as a peerDependency).

Suggested change
- `peerDependencies`: `react >= 18`, `@workkit/chat: workspace:*`.
`peerDependenciesMeta.react.optional: false` (React is required; the
package is useless without it).
- `peerDependencies`: `react >= 18`.
`peerDependenciesMeta.react.optional: false` (React is required; the
package is useless without it). `dependencies` includes
`@workkit/chat: workspace:*`.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@adr/0004-chat-react-debug-frames-package-shape.md`:
- Around line 51-53: Update the ADR high-level summary (lines referencing the
new workspace package) so it matches the Decision/Consequences by declaring
`@workkit/chat` as a peerDependency using the workspace:* protocol (not a regular
dependency); specifically change the text that currently states "`dependencies`
`@workkit/chat`" to state "`peerDependencies` `@workkit/chat: workspace:*`" so
it aligns with the Decision section and the re-export design of
`@workkit/chat-react`.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 014ac63b-dafd-4787-a9ad-be6a2e6cc63b

📥 Commits

Reviewing files that changed from the base of the PR and between 00b68ec and f1a7ad4.

📒 Files selected for processing (1)
  • adr/0004-chat-react-debug-frames-package-shape.md

Comment thread adr/0004-chat-react-debug-frames-package-shape.md
Addresses CodeRabbit + Copilot review feedback on #85: option (b)
described `@workkit/chat` as a `dependencies` entry in the summary
but as a `peerDependencies` entry in the Consequences section. Align
to peerDependencies (matches the notify → mail pattern and the v1
API plan).
@beeeku
Copy link
Copy Markdown
Owner Author

beeeku commented Apr 19, 2026

Addressed CodeRabbit + Copilot inconsistency in f110f56 — aligned option (b) summary to peerDependencies matching the Consequences section and the existing @workkit/notify@workkit/mail pattern. Ready for re-review.

@beeeku beeeku merged commit f7af802 into master Apr 19, 2026
9 checks passed
@beeeku beeeku deleted the docs/adr-0004-chat-react-debug-frames branch April 19, 2026 11:01
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.

2 participants