feat: add code element support for whiteboard#385
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The code.untitled and code.lines keys were added but never referenced by the BaseCodeElement component. Remove to reduce i18n maintenance burden and merge conflict surface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
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.
Summary
wb_draw_codeandwb_edit_codewhiteboard actions for creating and editing syntax-highlighted code blocksBaseCodeElementcomponent with Shiki highlighting, IDE-style header, and line-by-line typing/insert/delete/replace animationsCloses #383
Changes
Type system (2 files)
lib/types/slides.ts:CODEenum,CodeLineinterface,PPTCodeElementtypelib/types/action.ts:WbDrawCodeAction,WbEditCodeAction, registered inSYNC_ACTIONSExecution engine (1 file)
lib/action/engine.ts:executeWbDrawCode(create code block with typing delay) andexecuteWbEditCode(insert_after, insert_before, delete_lines, replace_lines)Rendering (3 files)
BaseCodeElement.tsx: 630-line component — Shiki singleton, per-line HTML parsing, typing reveal with human-like easing, mount gating, replace/delete animations, scroll isolation from whiteboard zoomScreenElement.tsx: registerCodeElementin type mapinline-action-tag.tsx:Code2/FileCodeicons for chat action tagsAgent orchestration (5 files)
tool-schemas.ts: LLM action descriptions with parameter docsregistry/types.ts+store.ts: add toWHITEBOARD_ACTIONSdirector-prompt.ts:WhiteboardActionRecordunion, summarization casesprompt-builder.ts: action guidelines, Code Element Layout section,summarizeElementcase, virtual whiteboard contextOther (1 file)
element-fingerprint.ts: addcodecase for exhaustive switchCode Review Results
Assessment: Ready to merge — no Critical issues found.
Low-priority observations (not blocking):
replace_linesassumes contiguous line IDs (matches LLM prompt guidance)lineIdCounteris client-side only;Date.now()suffix prevents collisionsTest plan
tsc --noEmitpasses with zero errorspnpm devstarts without build errorswb_draw_code/wb_edit_code🤖 Generated with Claude Code