Skip to content

Conversation

@anotherjesse
Copy link
Contributor

@anotherjesse anotherjesse commented Aug 5, 2025

  • Change $mentionable type from Cell<{"$NAME": string, "$UI": any}[]> to Cell<Charm[]>
    to match how the component actually uses the NAME symbol
  • Make children property optional in Child type since ct-outliner is self-closing
  • Set oncharm-link-click to any to support handler proxy pattern

These changes fix type errors in recipes using ct-outliner after the component refactor in commit 4e37bfb.

🤖 Generated with Claude Code


Summary by cubic

Updated ct-outliner JSX types to match the refactored component and fix type errors in recipes.

  • Bug Fixes
    • Changed $mentionable type to Cell<Charm[]>.
    • Made children optional in Child type.
    • Set oncharm-link-click to any for handler proxy support.

- Change $mentionable type from Cell<{"$NAME": string, "$UI": any}[]> to Cell<Charm[]>
  to match how the component actually uses the NAME symbol
- Make children property optional in Child type since ct-outliner is self-closing
- Set oncharm-link-click to any to support handler proxy pattern

These changes fix type errors in recipes using ct-outliner after the
component refactor in commit 4e37bfb.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@anotherjesse
Copy link
Contributor Author

without this change I'm getting:

labs % deno task ct dev ../recipes/recipes/coralreef/factory.tsx
Task ct ROOT=$(pwd) && cd $INIT_CWD && deno run --allow-net --allow-ffi --allow-read --allow-write --allow-env "$ROOT/packages/cli/mod.ts" "dev" "../recipes/recipes/coralreef/factory.tsx"
Warning experimentalDecorators compiler option is deprecated and may be removed at any time
CompilerError: [ERROR] Type 'OpaqueRef<Record<string, unknown>[]>' is not assignable to type 'Cell<{ $NAME: string; $UI: any; }[]>'.
  The types returned by 'get()' are incompatible between these types.
    Type 'Record<string, unknown>[]' is not assignable to type '{ $NAME: string; $UI: any; }[]'.
      Type 'Record<string, unknown>' is missing the following properties from type '{ $NAME: string; $UI: any; }': "$NAME", "$UI"
160 |                 <ct-outliner
161 |                   $value={outline}
162 |                   $mentionable={mentionable}
    |                   ^
163 |                   oncharm-link-click={handleCharmLinkClick({
164 |                     outline,

    at Checker.typeCheck (file:///Users/jesse/ct/labs/packages/js-runtime/typescript/diagnostics/checker.ts:19:13)
    at TypeScriptCompiler.compile (file:///Users/jesse/ct/labs/packages/js-runtime/typescript/compiler.ts:302:15)
    at Engine.process (file:///Users/jesse/ct/labs/packages/runner/src/harness/engine.ts:158:35)
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async process (file:///Users/jesse/ct/labs/packages/cli/lib/dev.ts:72:28)
    at async Command.actionHandler (file:///Users/jesse/ct/labs/packages/cli/commands/dev.ts:37:31)
    at async Command.execute (https://jsr.io/@cliffy/command/1.0.0-rc.8/command.ts:1940:7)
    at async Command.parseCommand (https://jsr.io/@cliffy/command/1.0.0-rc.8/command.ts:1772:14)
    at async parse (file:///Users/jesse/ct/labs/packages/cli/commands/mod.ts:4:10)
    at async main (file:///Users/jesse/ct/labs/packages/cli/mod.ts:5:5) {
  name: "CompilerError"
}

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.

cubic analysis

No issues foundReview in cubic

@anotherjesse
Copy link
Contributor Author

also you need a slight change to page.tsx:

@@ -30,6 +30,7 @@ const OutlinerNodeSchema = {
     },
     attachments: { type: "array", items: {}, default: [] },
   },
+  required: ["body", "children", "attachments"],
 } as const satisfies JSONSchema;
 
 const OutlineSchema = {

@bfollington
Copy link
Contributor

I've added the ct-list types, so this PR now fixes [CT-715]

@bfollington bfollington merged commit 3ed8c28 into main Aug 5, 2025
7 checks passed
@bfollington bfollington deleted the fix-ct-outliner-jsx-types branch August 5, 2025 21:35
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.

3 participants