Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Nov 14, 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 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


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

    • Wrapped input schema properties in Cell<Default<...>> where UI expects CellLike values (chatbot, checkbox, list, select, fetch-data, note; bgCounter, email-summarizer, gcal, gmail-importer, input, research-report, rss).
    • Made inputs with Default optional and added fallback initialization inside recipes.
    • Removed incorrect asCell: true from simpleValue.tsx to fix .length errors.
    • Fixed Note to use a regular Cell import; simplified Chat/Note creation calls.
    • Updated email-summarizer and gcal to mark settings as cells and derive reactive prompts; adjusted gmail-importer/rss settings types.
    • Passed CellLike context to common-iframe in the iframe integration.
  • Refactors

    • Added StripCell and applied it to pattern(), recipe(), lift(), and handler() overloads to normalize inputs/outputs (strip cell wrappers) while preserving developer ergonomics.

Written for commit 7cebc23. Summary will update automatically on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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&lt;Outliner&gt;` 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 || &quot;Untitled Research Report&quot;`), 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&lt;string[]&gt;`. 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

seefeldb and others added 8 commits November 14, 2025 11:16
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
@seefeldb seefeldb force-pushed the feat/correctly-tag-cell-in-pattern-inputs branch from a6c555e to 7cebc23 Compare November 14, 2025 19:16
@seefeldb seefeldb merged commit a34b8e8 into main Nov 14, 2025
8 checks passed
@seefeldb seefeldb deleted the feat/correctly-tag-cell-in-pattern-inputs branch November 14, 2025 19:33
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants