-
Notifications
You must be signed in to change notification settings - Fork 10
chore(examples): Correctly tag inputs as Cell #2078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 issues found across 21 files
Prompt for AI agents (all 4 issues)
Understand the root cause of the following 4 issues and fix them.
<file name="packages/patterns/chatbot-outliner.tsx">
<violation number="1" location="packages/patterns/chatbot-outliner.tsx:128">
`appendOutlinerNode` expects a `Cell<Outliner>` and calls `state.outline.key(...)`. When `outline` is omitted, this new fallback returns a plain object, so the tool crashes because `.key` is missing. Please wrap the default in `Cell.of(...)` to keep providing a cell.</violation>
</file>
<file name="packages/patterns/chatbot-note-composed.tsx">
<violation number="1" location="packages/patterns/chatbot-note-composed.tsx:59">
newNote no longer forwards the provided title/content to Note(), so created notes ignore the user-supplied values and always use the defaults. Please pass args.title/content when instantiating the note.</violation>
</file>
<file name="recipes/research-report.tsx">
<violation number="1" location="recipes/research-report.tsx:9">
Marking the `title` input as a Cell breaks this recipe: the callback still treats `title` like a plain string (`title || "Untitled Research Report"`), so the fallback never triggers and `[NAME]` receives a Cell object instead of the expected string. Either keep `title` as a string or update the recipe logic to unwrap the Cell.</violation>
</file>
<file name="recipes/simpleValue.tsx">
<violation number="1" location="recipes/simpleValue.tsx:53">
Dropping the `asCell` marker turns `values` into a plain `string[]`, but the handlers and `derive` logic in this recipe expect a `Cell<string[]>`. That breaks reactivity and the handler state contract.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
Fixed all TypeScript type errors in recipes and patterns by:
1. Adding Cell<> wrappers to input schema properties where UI components
expect CellLike<T> values:
- recipes: bgCounter, email-summarizer, gcal, gmail-importer, input,
research-report, rss
- patterns: chatbot, ct-checkbox-*, ct-list, ct-select, fetch-data, note
2. Removing extraneous asCell: true from simpleValue.tsx that was causing
.length property errors
3. Making recipe input properties optional where they have Default<> values
and adding fallback handling in recipe implementations
4. Fixing Cell import from type-only to regular import in note.tsx
All files now pass `deno task check` with zero type errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
…/handler/etc so that we can declare types as what the inside needs and produces while not forcing users to also use the same shape
a6c555e to
7cebc23
Compare
jkomoros
pushed a commit
that referenced
this pull request
Nov 15, 2025
`pattern`, `recipe`, `lift` and `handler` now consistently produce factories that strip any Cell annotations, so that the type the developer declares matches the internal view while external callers can call with or without Cells. --- Also fixed TypeScript types in patterns by: 1. Adding Cell<> wrappers to input schema properties where UI components expect CellLike<T> values: - recipes: bgCounter, email-summarizer, gcal, gmail-importer, input, research-report, rss - patterns: chatbot, ct-checkbox-*, ct-list, ct-select, fetch-data, note 2. Removing extraneous asCell: true from simpleValue.tsx that was causing .length property errors 3. Making recipe input properties optional where they have Default<> values and adding fallback handling in recipe implementations 4. Fixing Cell import from type-only to regular import in note.tsx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pattern,recipe,liftandhandlernow consistently produce factories that strip any Cell annotations, so that the type the developer declares matches the internal view while external callers can call with or without Cells.Also fixed TypeScript types in patterns by:
Adding Cell<> wrappers to input schema properties where UI components expect CellLike values:
Removing extraneous asCell: true from simpleValue.tsx that was causing .length property errors
Making recipe input properties optional where they have Default<> values and adding fallback handling in recipe implementations
Fixing Cell import from type-only to regular import in note.tsx
Summary by cubic
Correctly tagged example inputs as Cell to match UI components and Default handling, fixing type errors across patterns and recipes. Updated API types to strip Cell wrappers at module boundaries so patterns/recipes accept plain shapes while callers can pass cells; all examples now pass type checks.
Bug Fixes
Refactors
Written for commit 7cebc23. Summary will update automatically on new commits.