Commit Graph

88 Commits

Author SHA1 Message Date
Doruk Kavcioglu f7d4f9f56a lead targetSids docs with the shared-slot default
Put the default first: a value used in several places should usually be one shared
slot referenced from every property.

Frame targetSids as the escape hatch for values that cannot share one slot, mainly
native text, where each slot carries its own document/style. Remove the brand-color
example so the docs do not encourage targetSids for values that should usually be
modeled as a shared slot.
2026-07-05 18:23:58 +03:00
Doruk Kavcioglu d8a51895b1 improve the targetSids contract example
Replace the narrow targetSids example with realistic template cases that show why one
control may fan out to multiple slots.

The updated example covers shared brand colors, branded text, and reused event content
across scenes, instead of placeholder ids like accent/heading. It also keeps the docs at
the contract level by making the same-slot-type rule explicit and avoiding implementation
details.

The ids are plain and deterministic so the example stays easy to read and assert in
tests.
2026-07-05 16:50:37 +03:00
Doruk Kavcioglu 6502846aaf player: let one control drive multiple slots via targetSids
A template value often belongs in several places at once — a brand color
across many fills, one headline reused at different sizes. A slot per
occurrence means editing the same value repeatedly, and the copies drift
out of sync.

Sharing a single slot solves that for uniform cases, but not for text: a
Skottie text slot carries the whole text document — font, size, fill,
stroke — so the same string in two styles or sizes can't share one slot
without collapsing to a single look. Those occurrences are forced apart
into separate slots.

targetSids reconciles both. A control writes its value to its own `sid`
plus every id it lists, and the targeted slots leave the Properties panel:
one input, many slots, always in sync. Text edits go through setText
(string only), so each layer keeps its own style. Works for any slot type;
the primary and every target must share that type.

Contract documented in references/player-contract.md.
2026-07-05 16:41:25 +03:00
Doruk Kavcioglu f516056934 text-to-lottie: document box vs point text for wrapping slots
Editable multi-word text slots (headlines, subtitles, quotes, CTAs) now
default to native Lottie box text (sz/ps) so a longer edit wraps at a
fixed width instead of overflowing; point text stays for single glyphs,
tiles, logos, and choreographed type.

Verified in the current Skottie path (canvaskit-wasm 0.41.1): wraps on
load and re-wraps on live slot edits, j/lh honored, and edit+save
preserves sz/ps/lh. Caveats captured: box text is top-aligned (no auto
vertical-centering) and does not clip to its height.

- player-contract.md: new "Point Text vs Box Text" section
- recipe-typography.md: default editable multi-word slots to box text
- output-rubric.md: eval expectation for wrapping slots
2026-07-04 22:28:40 +03:00
Doruk Kavcioglu 5834d199a2 player: order properties-panel slots by controls.json
Skottie enumerates slots in unordered_map hash order, so the panel
appeared scrambled. Sort the slots memo by controls.json order;
uncontrolled slots sort last (stable sort keeps their order).
2026-07-03 22:35:10 +03:00
Konstantin Paulus 68f801183b Merge pull request #14 from diffusionstudio/font-loading 2026-07-03 19:24:52 +02:00
Doruk Kavcioglu bc7c207a5a text-to-lottie: require a:1 for keyframed text slots
Native text slots authored as slots[id].p = { a:0, k:[{t,s}] } (or with a
missing a) render blank in Skottie: it treats the keyframe array as a static
value and resolves empty text. Document the a:1 requirement in the player
contract, correct the canonical test fixture to the render-safe shape, and add
a local structural invariant test that flags keyframed text slots missing a:1.
2026-07-03 17:27:26 +03:00
Konstantin Paulus 9b1e4f99b4 Remove redundant text in README.md 2026-07-02 07:10:30 +02:00
Konstantin Paulus c04fa0effa Update README to reflect Lottie animation changes
Removed the old LottieView implementation and updated the README to recommend using React Native Skia for rendering Lottie animations.
2026-07-01 15:23:14 +02:00
Konstantin Paulus 215c906b7c Merge pull request #12 from diffusionstudio/font-loading
Make native text slots editable and Unicode-safe
2026-07-01 01:16:27 -07:00
Doruk Kavcioglu 42794345ad Preserve Unicode text slots during Lottie saves
CanvasKit's getTextSlot mangles non-ASCII text (mojibake on save), so
read text slot values from the source JSON plus an in-memory overrides
map instead of off the animation. Edits now write to both the slot
document and its bound layer fallback.

- canvas.tsx: track text edits in a textOverrides signal, derive slots
  from sourceDoc + overrides, reset overrides when the scene reloads,
  and bail out of save on a failed HTTP response
- lottie.ts: add readTextSlotValue/writeTextSlotValue and export
  LottieDoc; cover slot document and bound-layer shapes
- add scripts/text-slot-unicode.test.mjs and a check:text-slots script
2026-06-30 23:30:17 +03:00
Doruk Kavcioglu e262ad7548 Document native text slot schema 2026-06-30 22:08:17 +03:00
Doruk Kavcioglu c3de9c2471 Clarify native text slot defaults 2026-06-30 20:55:19 +03:00
Doruk Kavcioglu 69d2b60cac Persist color picks immediately and make the swatch reactive
Color slots now call commitSource() on the picker's change event (the native OS picker doesn't blur the input), so a pick persists without needing to click away; the onBlur commit stays as a harmless no-op fallback. The swatch/hex now read edits() through reactive accessors so the sidebar updates live instead of showing the stale render-time value. Alpha is preserved; scoped to the color block, no other inputs touched.
2026-06-30 18:53:13 +03:00
Doruk Kavcioglu 1c5dad2862 Persist text and vec2 slot edits on Enter
Enter now applies the current value and calls commitSource without blurring, so the edit persists immediately and survives a refresh while the input keeps focus. The existing blur-to-commit behavior is unchanged; scalar and color inputs are untouched.
2026-06-30 18:35:37 +03:00
Doruk Kavcioglu e6b52e63a7 Make text slot edits re-shape the live preview via setText
setTextSlot updated the slot value (so edits persisted on commit) but did not re-shape the active canvas in canvaskit-wasm 0.41.1 - the preview only updated on reload. Worse, once setTextSlot was called it locked the layer so subsequent setText() calls no longer re-shaped, which would have made only the first edit per slot update live.

Drive the text edit path through setText(key, text, size) only, targeting each text layer bound to the slot (mapped from the source doc by t.d.sid -> layer nm). setText re-shapes on every edit AND updates the slot value (getTextSlot reflects it), so readSlots/applySlotValues still persist correctly on commit. No setTextSlot call remains in this path.

Brings text slots to live-preview parity with color/scalar/vec2, no rebuild, no camera reset. Persistence, the slot abstraction, and other slot setters are unchanged.

Verified in editor: first and second edits to the same slot both re-shape live; commit persists only the edited slot; reload shows latest value; unedited slots and layer inline text unchanged.
2026-06-30 18:15:26 +03:00
Doruk Kavcioglu a5b470b578 Fix text slot editing in the Skottie player
Editing a text slot from the properties panel did nothing because the
runtime path was broken in two places, independent of any scene:

- setTextSlot called `new ck.SlottableTextProperty(...)`, a constructor
  canvaskit-wasm 0.41.1 does not expose, so the call threw before the
  canvas could repaint. Pass the mutated property object to setTextSlot
  directly, which this version accepts.
- applySlotValues persisted text to slots[id].p.p.t, but Skottie reads a
  slotted text document at slots[id].p.k[0].s.t, so committed edits
  reverted on reload. Write to the path Skottie reads (with the old flat
  shape kept as a fallback).

This brings text slots to parity with color/scalar/vec2 slots: apply
live on edit, persist correctly on commit.
2026-06-30 16:03:52 +03:00
Doruk Kavcioglu c3264ff369 Merge pull request #11 from diffusionstudio/font-loading
Enhance text rendering capabilities in text-to-lottie skill
2026-06-30 00:20:49 +03:00
konstantin-paulus bbd399c267 Enhance text rendering capabilities in text-to-lottie skill
- Update documentation to clarify the use of native Lottie text slots, emphasizing the requirement to ship font files alongside the scene.
- Modify the export process to include font files in the project zip, ensuring proper rendering of text layers.
- Refactor scene loading to accommodate both images and fonts, improving asset management.
- Adjust type definitions to include font URLs, enhancing type safety and clarity in the codebase.
- Revise output rubric and typography references to reflect the new font handling guidelines and best practices for text rendering.
2026-06-29 08:24:35 -07:00
Konstantin Paulus 39bb536f27 Merge pull request #9 from diffusionstudio/skill-updates
Improve text-to-lottie skill quality and routing
2026-06-26 13:50:13 -07:00
Doruk Kavcioglu 0043cd71b6 Expand seam mechanics in chapterization reference
Merge cut-on-action and easing-anchor notes into a Seam Mechanics section with a
per-method table (hard cut, jump cut, motion-masked swap, continuous carry,
occlusion wipe, hold/settle cut, loop reset) covering why each seam works, the
outgoing/incoming boundary-frame conditions, supporting anchors, and when to
switch. Add a Seam Plan checklist and a Seam Verification pass.
2026-06-25 21:07:06 +03:00
Doruk Kavcioglu 383935d3c8 Add chapterization and transition grammar reference
New references/chapterization-transition-grammar.md covering when/when-not to
chapter, chapter roles, structure modes, transition grammar, cut-on-action
mechanics, easing-anchor support, and guardrails. Route dense/multi-idea prompts
to it from SKILL.md, add a motion-taste section summary and cross-link, and split
the loop-reset bullet out from the hard-cut rule.
2026-06-25 20:45:34 +03:00
Doruk Kavcioglu 60cf4c09a3 Refine easing-anchor wording: handle placement and locked timing
Clarify that o goes on the start keyframe and i on the destination (final
keyframe needs no outgoing o), reframe the generic-easing principle around
locked vs offset timing, and tidy the overshoot note to end i.y ~1.08 to 1.2.
2026-06-25 20:08:37 +03:00
Doruk Kavcioglu 833d27a0d1 Add behavior-based easing anchors to text-to-lottie skill
Replace conceptual Easing Intent with a curated 7-anchor palette (derive,
not presets), keyed to motion behavior not layer type. Add per-property
orchestration methods, hierarchy, distance/duration, and hard-cut/loop rules.
Document the cubic-bezier -> Lottie o/i handle mapping in lottie-spec-map, and
nudge SKILL.md to derive easing from the anchors.
2026-06-25 19:57:37 +03:00
Doruk Kavcioglu ac5947da98 Resolve dev-server port from Vite output instead of hardcoding 3030
The skill hardcoded localhost:3030 for all curl/navigation, but the Vite
config sets server.port without strictPort, so the server falls back to the
next free port when 3030 is taken.

This happens most often when running multiple text-to-lottie projects in
different folders at once: the second 'npm run dev' lands on 3031+, but the
skill still pointed the agent at 3030 — silently inspecting the wrong
project. Lead with the rule to trust the printed port and use <port>
throughout.
2026-06-24 17:40:38 +03:00
Doruk Kavcioglu 9c7acb41fc Default to premium contrast palette when no brand provided
Replace the warm-near-black/cream default with a preference for pure
black/white (000/fff) contrast or another deliberate premium palette;
warm/cream tones become opt-in only when the user asks.
2026-06-23 22:24:16 +03:00
Doruk Kavcioglu e97f619ad7 docs: clarify lottie target selection guidance 2026-06-22 22:20:50 +03:00
Doruk Kavcioglu 5db3b55a3e Add restraint/anti-chrome taste defaults to text-to-lottie skill
Terse 'premium' prompts (e.g. a KPI stat card) drifted toward generic
chrome: an unnecessary framing card, mismatched divider colors, and muddy
stacked near-black tints. Encode restraint as decisive defaults so premium
reads as subtraction, with escape valves for explicitly-requested chrome.

- SKILL.md: always-on Design Defaults floor (premium=subtract, chrome/
  container budget, one surface tone, one divider treatment) + routing row
  for premium/clean/minimal qualifiers
- design-taste.md: chrome/container budget, one-surface-tone and one-divider
  rules, 'premium fails by adding chrome' note, stat-triad borderless
  default, Premium Restraint Checklist
- recipe-data-stats.md: borderless/one-surface default + framing-card /
  mismatched-divider / muddy-tint failure modes + acceptance checks
- output-rubric.md: regression blockers + the failing prompt as a tracked case
- reference-loading-prompts.json: routing coverage for the terse premium prompt
2026-06-21 01:12:53 +03:00
Doruk Kavcioglu f2c92e22b9 Add vector-text cap-center alignment guidance to skill
Hand-placed vector text has no line-height, so mixing a small label and a
large value on a shared baseline made the smaller run sink, and stacked
title/subline spacing was ad-hoc. Add a font-derived cap-center placement
formula, a type-relative vertical-rhythm rule, and QA gates so the defect
is prevented and caught.

- player-contract: cap-height baseline formula + zoomed-in alignment review
- design-taste: cap-center mixed-size rows, vertical-rhythm rule, review check
- recipe-data-stats: KPI-row alignment failure modes + acceptance checks
- output-rubric: mixed-size row / spacing eval blockers
2026-06-21 00:06:02 +03:00
Doruk Kavcioglu 3aeabe9b08 Document Skottie text rendering fast path 2026-06-20 22:37:05 +03:00
Doruk Kavcioglu 993284019b Add text-to-lottie final review pass 2026-06-20 22:10:58 +03:00
Doruk Kavcioglu e3cc7451b1 Integrate text-to-lottie taste guidance 2026-06-20 21:15:01 +03:00
Doruk Kavcioglu 4ac8ce38c2 Strengthen text-to-lottie design QA 2026-06-19 17:26:38 +03:00
Doruk Kavcioglu 0b6aa1fad3 Improve text-to-lottie quality guidance 2026-06-19 00:58:46 +03:00
Doruk Kavcioglu 4c05ecbb54 Refresh text-to-lottie skill 2026-06-19 00:05:34 +03:00
Konstantin Paulus a4e20b894d Merge pull request #5 from diffusionstudio/solid-rewrite
Solid rewrite
v1.0.0
2026-06-15 16:38:02 +02:00
konstantin-paulus 1d3b2befcd Update README.md to clarify framework description and enhance workspace setup explanation
- Changed "harness" to "framework" for better accuracy in describing Text-to-Lottie.
- Revised the description of the agent's setup process to provide clearer instructions on workspace and player functionality.
2026-06-15 16:34:20 +02:00
konstantin-paulus 10a306550e Update package version to 1.0.0 2026-06-15 16:25:26 +02:00
konstantin-paulus 4f417a2266 minor skill optimizations 2026-06-15 15:13:28 +02:00
konstantin-paulus 0b0c7be3b5 Enhance scene loading and live update functionality
- Updated CanvasProvider to include a refetch mechanism for scene data upon external edits to the Lottie file.
- Modified loadScene function to disable caching for Lottie file fetches, ensuring the latest version is always loaded.
- Implemented a self-write tracking system in the scenes plugin to differentiate between internal and external changes, triggering live reloads only for the latter.
2026-06-15 12:56:35 +02:00
konstantin-paulus 8c1a0c1dc1 Add references section to SKILL.md for Lottie format specification
- Included a new References section in SKILL.md to provide a link to the Lottie format specification documentation.
- This addition aims to enhance the resourcefulness of the document for users seeking detailed information on Lottie animations.
2026-06-14 20:05:29 +02:00
konstantin-paulus cbaa89546d Remove controls.json and update lottie.json for scene 1
- Deleted the controls.json file as it is no longer needed.
- Updated lottie.json to reflect changes in naming and structure, including renaming the main scene and modifying layer properties for improved clarity and functionality.
2026-06-14 20:01:13 +02:00
konstantin-paulus a723283e10 Implement context menu for scene and project deletion in ScenesContainer and SidebarLeft
- Added context menu functionality to allow users to delete scenes and projects directly from the UI.
- Integrated deleteScene and deleteProject functions to handle deletion requests and navigation upon deletion.
- Updated SceneItem and SidebarLeft components to utilize context menus for improved user interaction.
- Enhanced CSS for context menu styling to ensure a consistent and visually appealing design.
2026-06-14 17:07:41 +02:00
konstantin-paulus b6a386caed Update CanvasProvider to re-run totalFrames on animation load for accurate seeking 2026-06-14 16:55:56 +02:00
konstantin-paulus 91153550dd Enhance theming and styling across the application
- Implemented a dynamic color scheme toggle based on user preferences for improved accessibility.
- Updated CSS variables for light and dark themes to ensure consistent styling.
- Refined the NumericSlider component by removing default box-shadow and border styles for a cleaner appearance.
- Adjusted button styles in base.css to support dark mode while maintaining visual consistency.
2026-06-14 16:48:25 +02:00
konstantin-paulus 16597a43c5 Add default focus indicator styles for improved accessibility
- Introduced a focus-visible style to enhance keyboard navigation and accessibility.
- Applied a consistent inset border and box-shadow for focused elements, overriding default styles.
- Ensured smooth transitions for focus effects to improve user experience.
2026-06-14 16:16:46 +02:00
konstantin-paulus 9a7dba90f6 Enhance UI responsiveness and control visibility in Sidebar and App components
- Integrated UI context to manage the visibility of controls in SidebarLeft and SidebarRight.
- Updated App component to conditionally render ScenesContainer based on control expansion state.
- Adjusted SidebarLeft and SidebarRight widths dynamically based on control visibility for improved user experience.
- Refactored SidebarLeft to include project management features only when controls are expanded.
2026-06-14 16:11:21 +02:00
konstantin-paulus 7edb14d682 Implement live playback context and server middleware for scene updates
- Added functionality to track and report live playback state, including project, scene, frame, and playback status.
- Introduced server middleware to handle browser heartbeat updates and provide context for active projects and scenes.
- Enhanced scene metadata retrieval with last modified timestamps for better asset management.
2026-06-14 15:51:02 +02:00
konstantin-paulus 8e81351f36 Add drag-and-drop functionality for Lottie file import in CanvasProvider 2026-06-14 15:16:40 +02:00
konstantin-paulus 613c554058 Enhance keyboard controls in CanvasProvider for improved playback and navigation
- Updated onKeyDown function to handle space key for toggling playback.
- Implemented arrow key navigation to step through frames and seconds.
- Improved input handling to prevent key hijacking while typing in editable fields.
2026-06-14 15:07:16 +02:00